aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src')
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ActionVersioningManager.java75
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ActionVersioningManagerFactory.java28
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/AsdcItemManager.java40
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/AsdcItemManagerFactory.java27
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManager.java28
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java52
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json2
7 files changed, 203 insertions, 49 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ActionVersioningManager.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ActionVersioningManager.java
new file mode 100644
index 0000000000..3875e59f33
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ActionVersioningManager.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.sdc.versioning;
+
+import java.util.List;
+import java.util.Map;
+import org.openecomp.sdc.versioning.dao.types.Revision;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionCreationMethod;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+public interface ActionVersioningManager {
+
+ void register(String entityType, VersionableEntityMetadata entityMetadata);
+
+ Version create(String entityType, String entityId, String user);
+
+ void delete(String entityType, String entityId, String user);
+
+ void undoDelete(String entityType, String entityId, String user);
+
+ Version checkout(String entityType, String entityId, String user);
+
+ Version undoCheckout(String entityType, String entityId, String user);
+
+ Version checkin(String entityType, String entityId, String user, String checkinDescription);
+
+ Version submit(String entityType, String entityId, String user, String submitDescription);
+
+ VersionInfo getEntityVersionInfo(String entityType, String entityId, String user,
+ VersionableEntityAction action);
+
+ Map<String, VersionInfo> listEntitiesVersionInfo(String entityType, String user,
+ VersionableEntityAction action);
+
+ Map<String, VersionInfo> listDeletedEntitiesVersionInfo(String entityType, String user,
+ VersionableEntityAction action);
+
+
+ List<Version> list(String itemId); // TODO: 5/24/2017 filter (by status for example)
+
+ Version get(String itemId, Version version);
+
+ Version create(String itemId, Version version,
+ VersionCreationMethod creationMethod);
+
+ void submit(String itemId, Version version, String submitDescription);
+
+ void publish(String itemId, Version version, String message);
+
+ void sync(String itemId, Version version);
+
+ void forceSync(String itemId, Version version);
+
+ void revert(String itemId, Version version, String revisionId);
+
+ List<Revision> listRevisions(String itemId, Version version);
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ActionVersioningManagerFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ActionVersioningManagerFactory.java
new file mode 100644
index 0000000000..4ab659ac11
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ActionVersioningManagerFactory.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.sdc.versioning;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class ActionVersioningManagerFactory extends
+ AbstractComponentFactory<ActionVersioningManager> {
+
+ public static ActionVersioningManagerFactory getInstance() {
+ return AbstractFactory.getInstance(ActionVersioningManagerFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/AsdcItemManager.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/AsdcItemManager.java
new file mode 100644
index 0000000000..a4ea65fa08
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/AsdcItemManager.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.sdc.versioning;
+
+import java.util.Collection;
+import java.util.function.Predicate;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.Item;
+
+public interface AsdcItemManager {
+
+ Collection<Item> list(Predicate<Item> predicate);
+
+ Item get(String itemId);
+
+ Item create(Item item);
+
+ void updateVersionStatus(String itemId, VersionStatus addedVersionStatus,
+ VersionStatus removedVersionStatus);
+
+ void updateOwner(String itemId, String owner);
+
+ void updateName(String itemId, String name);
+
+ void delete(Item item);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/AsdcItemManagerFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/AsdcItemManagerFactory.java
new file mode 100644
index 0000000000..a2095b8663
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/AsdcItemManagerFactory.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.sdc.versioning;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class AsdcItemManagerFactory extends AbstractComponentFactory<AsdcItemManager> {
+
+ public static AsdcItemManagerFactory getInstance() {
+ return AbstractFactory.getInstance(AsdcItemManagerFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManager.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManager.java
index 885d96a132..41a2c12058 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManager.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManager.java
@@ -1,10 +1,25 @@
-package org.openecomp.sdc.versioning;
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-import org.openecomp.sdc.versioning.dao.types.VersionStatus;
-import org.openecomp.sdc.versioning.types.Item;
+package org.openecomp.sdc.versioning;
import java.util.Collection;
import java.util.function.Predicate;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.Item;
public interface ItemManager {
@@ -15,10 +30,11 @@ public interface ItemManager {
Item create(Item item);
void updateVersionStatus(String itemId, VersionStatus addedVersionStatus,
- VersionStatus removedVersionStatus);
-
- void updateOwner(String itemId, String owner);
+ VersionStatus removedVersionStatus);
void delete(Item item);
+ void updateName(String itemId, String name);
+
+ void update(Item item);
}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java
index c03769462b..cbb234e3e2 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java
@@ -1,69 +1,34 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
*/
package org.openecomp.sdc.versioning;
+import java.util.List;
import org.openecomp.sdc.versioning.dao.types.Revision;
import org.openecomp.sdc.versioning.dao.types.Version;
import org.openecomp.sdc.versioning.types.VersionCreationMethod;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
-import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
-
-import java.util.List;
-import java.util.Map;
public interface VersioningManager {
- void register(String entityType, VersionableEntityMetadata entityMetadata);
-
- Version create(String entityType, String entityId, String user);
-
- void delete(String entityType, String entityId, String user);
-
- void undoDelete(String entityType, String entityId, String user);
-
- Version checkout(String entityType, String entityId, String user);
-
- Version undoCheckout(String entityType, String entityId, String user);
-
- Version checkin(String entityType, String entityId, String user, String checkinDescription);
-
- Version submit(String entityType, String entityId, String user, String submitDescription);
-
- VersionInfo getEntityVersionInfo(String entityType, String entityId, String user,
- VersionableEntityAction action);
-
- Map<String, VersionInfo> listEntitiesVersionInfo(String entityType, String user,
- VersionableEntityAction action);
-
- Map<String, VersionInfo> listDeletedEntitiesVersionInfo(String entityType, String user,
- VersionableEntityAction action);
-
-
List<Version> list(String itemId); // TODO: 5/24/2017 filter (by status for example)
Version get(String itemId, Version version);
Version create(String itemId, Version version,
- VersionCreationMethod creationMethod);
+ VersionCreationMethod creationMethod);
void submit(String itemId, Version version, String submitDescription);
@@ -77,4 +42,5 @@ public interface VersioningManager {
List<Revision> listRevisions(String itemId, Version version);
+ void updateVersion(String itemId, Version version);
}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json
index 90d11f1700..579f107178 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json
@@ -1,6 +1,8 @@
{
"org.openecomp.sdc.versioning.ItemManagerFactory": "org.openecomp.sdc.versioning.impl.ItemManagerFactoryImpl",
+ "org.openecomp.sdc.versioning.AsdcItemManagerFactory": "org.openecomp.sdc.versioning.impl.AsdcItemManagerFactoryImpl",
"org.openecomp.sdc.versioning.VersioningManagerFactory": "org.openecomp.sdc.versioning.impl.VersioningManagerFactoryImpl",
+ "org.openecomp.sdc.versioning.ActionVersioningManagerFactory": "org.openecomp.sdc.versioning.impl.ActionVersioningManagerFactoryImpl",
"org.openecomp.sdc.versioning.dao.VersionableEntityDaoFactory": "org.openecomp.sdc.versioning.dao.impl.VersionableEntityDaoFactoryImpl",
"org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory": "org.openecomp.sdc.versioning.dao.impl.VersionInfoDaoFactoryImpl",
"org.openecomp.sdc.versioning.dao.VersionInfoDeletedDaoFactory": "org.openecomp.sdc.versioning.dao.impl.VersionInfoDeletedDaoFactoryImpl",