aboutsummaryrefslogtreecommitdiffstats
path: root/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model
diff options
context:
space:
mode:
Diffstat (limited to 'common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model')
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/AllotedResource.java29
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/AllotedResourceWidget.java32
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/FlavorWidget.java32
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ImageWidget.java33
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/L3Network.java29
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/L3NetworkWidget.java33
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/LIntfWidget.java32
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Model.java259
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/OamNetwork.java32
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ProvidingService.java29
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Resource.java52
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ResourceWidget.java26
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Service.java43
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ServiceWidget.java30
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/TenantWidget.java33
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/TunnelXconnectWidget.java31
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VServerWidget.java46
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfModule.java81
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfModuleWidget.java33
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfWidget.java33
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfcWidget.java33
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VirtualFunction.java30
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VolumeGroupWidget.java33
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VolumeWidget.java33
-rw-r--r--common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Widget.java196
25 files changed, 1273 insertions, 0 deletions
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/AllotedResource.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/AllotedResource.java
new file mode 100644
index 0000000000..ef8555002f
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/AllotedResource.java
@@ -0,0 +1,29 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.Model;
+
+@Model(widget = Widget.Type.ALLOTTED_RESOURCE, cardinality = Cardinality.UNBOUNDED,
+ dataDeleteFlag = true)
+public class AllotedResource extends Resource {
+}
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/AllotedResourceWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/AllotedResourceWidget.java
new file mode 100644
index 0000000000..0b0db794c4
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/AllotedResourceWidget.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+
+@org.openecomp.sdc.generator.aai.types.Model(widget = Widget.Type.ALLOTTED_RESOURCE, cardinality
+ = Cardinality.UNBOUNDED, dataDeleteFlag = true)
+@ModelWidget(type = ModelType.WIDGET, name = "allotted-resource")
+public class AllotedResourceWidget extends ResourceWidget {
+}
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/FlavorWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/FlavorWidget.java
new file mode 100644
index 0000000000..0cb76ae2b5
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/FlavorWidget.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.Model;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+@Model(widget = Widget.Type.FLAVOR, cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = false)
+@ModelWidget(type = ModelType.WIDGET, name = "flavor")
+public class FlavorWidget extends ResourceWidget {
+
+}
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ImageWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ImageWidget.java
new file mode 100644
index 0000000000..cb514bcc8f
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ImageWidget.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.Model;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+@Model(widget = Widget.Type.IMAGE, cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = false)
+@ModelWidget(type = ModelType.WIDGET, name = "image")
+public class ImageWidget extends ResourceWidget {
+
+}
+
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/L3Network.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/L3Network.java
new file mode 100644
index 0000000000..3a4c564668
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/L3Network.java
@@ -0,0 +1,29 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.Model;
+
+@org.openecomp.sdc.generator.aai.types.Model(widget = Widget.Type.L3_NET, cardinality = Cardinality
+ .UNBOUNDED, dataDeleteFlag = false)
+public class L3Network extends Resource{
+}
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/L3NetworkWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/L3NetworkWidget.java
new file mode 100644
index 0000000000..67414b4ed8
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/L3NetworkWidget.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+@org.openecomp.sdc.generator.aai.types.Model(widget = Widget.Type.L3_NET,
+ cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = true)
+@ModelWidget(type = ModelType.WIDGET, name = "l3-network")
+public class L3NetworkWidget extends Widget {
+
+}
+
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/LIntfWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/LIntfWidget.java
new file mode 100644
index 0000000000..4aa6cd29aa
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/LIntfWidget.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.Model;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+@Model(widget = Widget.Type.LINT, cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = true)
+@ModelWidget(type = ModelType.WIDGET, name = "l-interface")
+public class LIntfWidget extends ResourceWidget {
+
+}
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Model.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Model.java
new file mode 100644
index 0000000000..c55abb36c2
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Model.java
@@ -0,0 +1,259 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.data.GeneratorConstants;
+import org.openecomp.sdc.generator.error.IllegalAccessException;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+public abstract class Model {
+
+ protected Set<Resource> resources = new HashSet<>();
+ protected Set<Widget> widgets = new HashSet<>();
+ private String modelId;
+ private String modelName;
+ private ModelType modelType;
+ private String modelVersion;
+ private String modelNameVersionId;
+ private String modelDescription;
+
+ /**
+ * Gets model for.
+ *
+ * @param toscaType the tosca type
+ * @return the model for
+ */
+ public static Model getModelFor(String toscaType) {
+
+ Model modelToBeReturned = null;
+ while (toscaType != null && toscaType.lastIndexOf(".") != -1 && modelToBeReturned == null) {
+
+ switch (toscaType) {
+
+ case "org.openecomp.resource.vf.allottedResource":
+ modelToBeReturned = new AllotedResource();
+ break;
+ case "org.openecomp.resource.vfc.AllottedResource":
+ modelToBeReturned = new ProvidingService();
+ break;
+ case "org.openecomp.resource.vfc":
+ modelToBeReturned = new VServerWidget();
+ break;
+ case "org.openecomp.resource.cp":
+ case "org.openecomp.cp":
+ modelToBeReturned = new LIntfWidget();
+ break;
+ case "org.openecomp.resource.vl":
+ modelToBeReturned = new L3Network();
+ break;
+ case "org.openecomp.resource.vf":
+ modelToBeReturned = new VirtualFunction();
+ break;
+ case "org.openecomp.groups.vfmodule":
+ case "org.openecomp.groups.VfModule":
+ modelToBeReturned = new VfModule();
+ break;
+ case "org.openecomp.resource.vfc.nodes.heat.cinder":
+ modelToBeReturned = new VolumeWidget();
+ break;
+ default:
+ modelToBeReturned = null;
+ break;
+ }
+
+ toscaType = toscaType.substring(0, toscaType.lastIndexOf("."));
+ }
+
+ return modelToBeReturned;
+ }
+
+ public abstract boolean addResource(Resource resource);
+
+ public abstract boolean addWidget(Widget resource);
+
+ /**
+ * Gets widget version id.
+ *
+ * @return the widget version id
+ */
+ public String getWidgetId() {
+ org.openecomp.sdc.generator.aai.types.Model model =
+ this.getClass().getAnnotation(org.openecomp.sdc.generator.aai.types.Model.class);
+ return Widget.getWidget(model.widget()).getId();
+ }
+
+ /**
+ * Gets invariant id.
+ *
+ * @return the invariant id
+ */
+ public String getWidgetInvariantId() {
+ org.openecomp.sdc.generator.aai.types.Model model =
+ this.getClass().getAnnotation(org.openecomp.sdc.generator.aai.types.Model.class);
+ return Widget.getWidget(model.widget()).getWidgetId();
+ }
+
+ /**
+ * Gets delete flag.
+ *
+ * @return the delete flag
+ */
+ public boolean getDeleteFlag() {
+ org.openecomp.sdc.generator.aai.types.Model model =
+ this.getClass().getAnnotation(org.openecomp.sdc.generator.aai.types.Model.class);
+ return model.dataDeleteFlag();
+ }
+
+ /**
+ * Gets cardinality.
+ *
+ * @return the cardinality
+ */
+ public Cardinality getCardinality() {
+ org.openecomp.sdc.generator.aai.types.Model model =
+ this.getClass().getAnnotation(org.openecomp.sdc.generator.aai.types.Model.class);
+ return model.cardinality();
+ }
+
+ public abstract Widget.Type getWidgetType();
+
+ public String getModelId() {
+ checkSupported();
+ return modelId;
+ }
+
+ /**
+ * Gets model type.
+ *
+ * @return the model type
+ */
+ public ModelType getModelType() {
+ //checkSupported();
+ if (this instanceof Service) {
+ return ModelType.SERVICE;
+ } else if (this instanceof Resource) {
+ return ModelType.RESOURCE;
+ } else if (this instanceof Widget) {
+ return ModelType.WIDGET;
+ } else {
+ return null;
+ }
+ }
+
+ public String getModelName() {
+ //checkSupported();
+ return modelName;
+ }
+
+ public String getModelVersion() {
+ //checkSupported();
+ return modelVersion;
+ }
+
+ public String getModelNameVersionId() {
+ checkSupported();
+ return modelNameVersionId;
+ }
+
+ public String getModelDescription() {
+ //checkSupported();
+ return modelDescription;
+ }
+
+ /**
+ * Populate model identification information.
+ *
+ * @param modelIdentInfo the model ident info
+ */
+ public void populateModelIdentificationInformation(Map<String, String> modelIdentInfo) {
+ Iterator<String> iter = modelIdentInfo.keySet().iterator();
+ String property;
+ while (iter.hasNext()) {
+ switch (property = iter.next()) {
+
+ case "vfModuleModelInvariantUUID":
+ case "serviceInvariantUUID":
+ case "resourceInvariantUUID":
+ case "invariantUUID":
+ case "providing_service_invariant_uuid":
+ modelId = modelIdentInfo.get(property);
+ break;
+ case "vfModuleModelUUID":
+ case "resourceUUID":
+ case "serviceUUID":
+ case "UUID":
+ case "providing_service_uuid":
+ modelNameVersionId = modelIdentInfo.get(property);
+ break;
+ case "vfModuleModelVersion":
+ case "serviceVersion":
+ case "resourceversion":
+ case "version":
+ modelVersion = modelIdentInfo.get(property);
+ break;
+ case "vfModuleModelName":
+ case "serviceName":
+ case "resourceName":
+ case "name":
+ modelName = modelIdentInfo.get(property);
+ break;
+ case "serviceDescription":
+ case "resourceDescription":
+ case "vf_module_description":
+ case "description":
+ modelDescription = modelIdentInfo.get(property);
+ break;
+ case "providing_service_name":
+ modelName = modelIdentInfo.get(property);
+ modelDescription = modelIdentInfo.get(property);
+ break;
+ default:
+ break;
+ }
+ property = null;
+ }
+
+
+
+ }
+
+ public Set<Resource> getResources() {
+ return resources;
+ }
+
+ public Set<Widget> getWidgets() {
+ return widgets;
+ }
+
+ private void checkSupported() throws IllegalAccessException {
+ if (this instanceof Widget) {
+ throw new IllegalAccessException(GeneratorConstants
+ .GENERATOR_AAI_ERROR_UNSUPPORTED_WIDGET_OPERATION);
+ }
+ }
+
+}
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/OamNetwork.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/OamNetwork.java
new file mode 100644
index 0000000000..f51fb529fb
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/OamNetwork.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.Model;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+@Model(widget = Widget.Type.L3_NET, cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = true)
+@ModelWidget(type = ModelType.WIDGET, name = "oam-network")
+public class OamNetwork extends Widget {
+}
+
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ProvidingService.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ProvidingService.java
new file mode 100644
index 0000000000..1eb4095f45
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ProvidingService.java
@@ -0,0 +1,29 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+
+@org.openecomp.sdc.generator.aai.types.Model(widget = Widget.Type.ALLOTTED_RESOURCE, cardinality = Cardinality
+ .UNBOUNDED,
+ dataDeleteFlag = false)
+public class ProvidingService extends Resource {
+}
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Resource.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Resource.java
new file mode 100644
index 0000000000..cc95706d9f
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Resource.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+public class Resource extends Model {
+
+ @Override
+ public int hashCode() {
+ return getModelNameVersionId().hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Resource) {
+ return getModelNameVersionId().equals(((Resource) obj).getModelNameVersionId());
+ }
+ return false;
+ }
+
+ public boolean addResource(Resource resource) {
+ return resources.add(resource);
+ }
+
+ public boolean addWidget(Widget widget) {
+ return widgets.add(widget);
+ }
+
+ @Override
+ public Widget.Type getWidgetType() {
+ org.openecomp.sdc.generator.aai.types.Model model =
+ this.getClass().getAnnotation(org.openecomp.sdc.generator.aai.types.Model.class);
+ return model.widget();
+ }
+}
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ResourceWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ResourceWidget.java
new file mode 100644
index 0000000000..26ff95dd7a
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ResourceWidget.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+public class ResourceWidget extends Widget {
+
+}
+
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Service.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Service.java
new file mode 100644
index 0000000000..8b3b7f2c60
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Service.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+
+@org.openecomp.sdc.generator.aai.types.Model(widget = Widget.Type.SERVICE,
+ cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = true)
+public class Service extends Model {
+
+ public boolean addResource(Resource resource) {
+ return resources.add(resource);
+ }
+
+ public boolean addWidget(Widget widget) {
+ return widgets.add(widget);
+ }
+
+ @Override
+ public Widget.Type getWidgetType() {
+ return null;
+ }
+
+}
+
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ServiceWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ServiceWidget.java
new file mode 100644
index 0000000000..58ae7b6e63
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/ServiceWidget.java
@@ -0,0 +1,30 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+@ModelWidget(type = ModelType.WIDGET, name = "service-instance")
+public class ServiceWidget extends Widget {
+
+}
+
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/TenantWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/TenantWidget.java
new file mode 100644
index 0000000000..4fc6f6e8af
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/TenantWidget.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.Model;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+@Model(widget = Widget.Type.TENANT, cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = false)
+@ModelWidget(type = ModelType.WIDGET, name = "tenant")
+public class TenantWidget extends Widget {
+
+}
+
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/TunnelXconnectWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/TunnelXconnectWidget.java
new file mode 100644
index 0000000000..87fd514fa2
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/TunnelXconnectWidget.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+@org.openecomp.sdc.generator.aai.types.Model(widget = Widget.Type.TUNNEL_XCONNECT,
+ cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = true)
+@ModelWidget(type = ModelType.WIDGET, name = "tunnel-xconnect")
+public class TunnelXconnectWidget extends Widget {
+}
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VServerWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VServerWidget.java
new file mode 100644
index 0000000000..58dd677a18
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VServerWidget.java
@@ -0,0 +1,46 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.Model;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+@Model(widget = Widget.Type.VSERVER, cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = true)
+@ModelWidget(type = ModelType.WIDGET, name = "vserver")
+public class VServerWidget extends Widget {
+
+ /**
+ * Instantiates a new V server widget.
+ */
+ public VServerWidget() {
+ addWidget(new FlavorWidget());
+ addWidget(new ImageWidget());
+ addWidget(new TenantWidget());
+ addWidget(new VfcWidget());
+ }
+
+ public boolean addWidget(Widget widget) {
+ return widgets.add(widget);
+ }
+
+}
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfModule.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfModule.java
new file mode 100644
index 0000000000..594cfedcbc
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfModule.java
@@ -0,0 +1,81 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.Model;
+
+import java.util.List;
+
+@Model(widget = Widget.Type.VFMODULE, cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = true)
+public class VfModule extends Resource {
+
+ Widget vserver = null;
+ boolean addlintf = false;
+ boolean addvolume = false;
+
+ List<String> members;
+
+ public void setMembers(List<String> members) {
+ this.members = members;
+ }
+
+ /**
+ * Adds Widget.
+ *
+ * @param widget the widget
+ * @return the boolean
+ */
+ public boolean addWidget(Widget widget) {
+ if (widget.memberOf(members)) {
+ if (vserver == null && widget.getId().equals(new VServerWidget().getId())) {
+ vserver = widget;
+ if (addlintf) {
+ vserver.addWidget(new LIntfWidget());
+ }
+ if (addvolume) {
+ vserver.addWidget(new VolumeWidget());
+ }
+ } else if (widget.getId().equals(new LIntfWidget().getId())) {
+ if (vserver != null) {
+ vserver.addWidget(widget);
+ return true;
+ } else {
+ addlintf = true;
+ }
+ return false;
+ } else if (widget.getId().equals(new VolumeWidget().getId())) {
+ if (vserver != null) {
+ vserver.addWidget(widget);
+ } else {
+ addvolume = true;
+ }
+ return true;
+ }
+ if (widget.getId().equals(new OamNetwork().getId())) {
+ return false;
+ }
+ return widgets.add(widget);
+ }
+ return false;
+ }
+
+}
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfModuleWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfModuleWidget.java
new file mode 100644
index 0000000000..3641ba9171
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfModuleWidget.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+@org.openecomp.sdc.generator.aai.types.Model(widget = Widget.Type.VFMODULE,
+ cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = true)
+@ModelWidget(type = ModelType.WIDGET, name = "vf-module")
+public class VfModuleWidget extends Widget {
+
+}
+
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfWidget.java
new file mode 100644
index 0000000000..a2fde75b20
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfWidget.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+@org.openecomp.sdc.generator.aai.types.Model(widget = Widget.Type.VF,
+ cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = true)
+@ModelWidget(type = ModelType.WIDGET, name = "generic-vnf")
+public class VfWidget extends ResourceWidget {
+
+}
+
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfcWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfcWidget.java
new file mode 100644
index 0000000000..41a07ce1de
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VfcWidget.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+@org.openecomp.sdc.generator.aai.types.Model(widget = Widget.Type.VFC,
+ cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = true)
+@ModelWidget(type = ModelType.WIDGET, name = "vnfc")
+public class VfcWidget extends ResourceWidget {
+
+}
+
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VirtualFunction.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VirtualFunction.java
new file mode 100644
index 0000000000..ec2ca38cbf
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VirtualFunction.java
@@ -0,0 +1,30 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.Model;
+
+@Model(widget = Widget.Type.VF, cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = true)
+public class VirtualFunction extends Resource {
+
+}
+
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VolumeGroupWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VolumeGroupWidget.java
new file mode 100644
index 0000000000..c253ea9058
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VolumeGroupWidget.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+@org.openecomp.sdc.generator.aai.types.Model(widget = Widget.Type.VOLUME_GROUP,
+ cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = true)
+@ModelWidget(type = ModelType.WIDGET, name = "volume-group")
+public class VolumeGroupWidget extends Widget {
+
+}
+
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VolumeWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VolumeWidget.java
new file mode 100644
index 0000000000..ddf840a822
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/VolumeWidget.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import org.openecomp.sdc.generator.aai.types.Cardinality;
+import org.openecomp.sdc.generator.aai.types.Model;
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+
+@Model(widget = Widget.Type.VOLUME, cardinality = Cardinality.UNBOUNDED, dataDeleteFlag = true)
+@ModelWidget(type = ModelType.WIDGET, name = "volume")
+public class VolumeWidget extends ResourceWidget {
+
+}
+
diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Widget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Widget.java
new file mode 100644
index 0000000000..6220519a3f
--- /dev/null
+++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Widget.java
@@ -0,0 +1,196 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.generator.aai.model;
+
+import static org.openecomp.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_CONFIGLPROP_NOT_FOUND;
+
+import org.openecomp.sdc.generator.aai.types.ModelType;
+import org.openecomp.sdc.generator.aai.types.ModelWidget;
+import org.openecomp.sdc.generator.data.ArtifactType;
+import org.openecomp.sdc.generator.data.GeneratorConstants;
+import org.openecomp.sdc.generator.data.WidgetConfigurationUtil;
+import org.openecomp.sdc.generator.error.IllegalAccessException;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+public abstract class Widget extends Model {
+
+ private Set<String> keys = new HashSet<>();
+
+ /**
+ * Gets widget.
+ *
+ * @param type the type
+ * @return the widget
+ */
+ public static Widget getWidget(Type type) {
+
+ switch (type) {
+ case SERVICE:
+ return new ServiceWidget();
+ case VF:
+ return new VfWidget();
+ case VFC:
+ return new VfcWidget();
+ case VSERVER:
+ return new VServerWidget();
+ case VOLUME:
+ return new VolumeWidget();
+ case FLAVOR:
+ return new FlavorWidget();
+ case TENANT:
+ return new TenantWidget();
+ case VOLUME_GROUP:
+ return new VolumeGroupWidget();
+ case LINT:
+ return new LIntfWidget();
+ case L3_NET:
+ return new L3NetworkWidget();
+ case VFMODULE:
+ return new VfModuleWidget();
+ case IMAGE:
+ return new ImageWidget();
+ case OAM_NETWORK:
+ return new OamNetwork();
+ case ALLOTTED_RESOURCE:
+ return new AllotedResourceWidget();
+ case TUNNEL_XCONNECT:
+ return new TunnelXconnectWidget();
+ default:
+ return null;
+ }
+
+ }
+
+ /**
+ * Gets id.
+ *
+ * @return the id
+ */
+ public String getId() {
+ Properties properties = WidgetConfigurationUtil.getConfig();
+ String id = properties.getProperty(ArtifactType.AAI.name() + ".model-version-id." + getName());
+ if (id == null) {
+ throw new IllegalArgumentException(String.format(GENERATOR_AAI_CONFIGLPROP_NOT_FOUND,
+ ArtifactType.AAI.name() + ".model-version-id." + getName()));
+ }
+ return id;
+ }
+
+ public ModelType getType() {
+ ModelWidget widgetModel = this.getClass().getAnnotation(ModelWidget.class);
+ return widgetModel.type();
+ }
+
+ public String getName() {
+ ModelWidget widgetModel = this.getClass().getAnnotation(ModelWidget.class);
+ return widgetModel.name();
+ }
+
+ /**
+ * Get Widget Id from properties file.
+ * @return - Widget Id
+ */
+ public String getWidgetId() {
+ Properties properties = WidgetConfigurationUtil.getConfig();
+ String id = properties.getProperty(ArtifactType.AAI.name() + ".model-invariant-id."
+ + getName());
+ if (id == null) {
+ throw new IllegalArgumentException(String.format(GENERATOR_AAI_CONFIGLPROP_NOT_FOUND,
+ ArtifactType.AAI.name() + ".model-invariant-id." + getName()));
+ }
+ return id;
+ }
+
+ public int hashCode() {
+ return getId().hashCode();
+ }
+
+ @Override
+ public Type getWidgetType() {
+ return null;
+ }
+
+ /**
+ * Equals.
+ *
+ * @param obj Object
+ * @return the boolean
+ */
+ public boolean equals(Object obj) {
+ if (obj instanceof Widget) {
+ if (getId().equals(((Widget) obj).getId())) {
+ ((Widget) obj).keys.addAll(this.keys);
+ return true;
+ }
+ return false;
+ } else {
+ return false;
+ }
+ }
+
+ public void addKey(String key) {
+ this.keys.add(key);
+ }
+
+ /**
+ * Member of boolean.
+ *
+ * @param keys the keys
+ * @return the boolean
+ */
+ public boolean memberOf(List<String> keys) {
+ if (keys == null) {
+ return false;
+ }
+ return !Collections.disjoint(this.keys, keys);
+ }
+
+ /**
+ * All instances used boolean.
+ *
+ * @param collection the collection
+ * @return the boolean
+ */
+ public boolean allInstancesUsed(Set<String> collection) {
+ Set<String> keyCopy = new HashSet<>(keys);
+ keyCopy.removeAll(collection);
+ return keyCopy.isEmpty();
+ }
+
+ public boolean addResource(Resource resource) {
+ throw new IllegalAccessException(GeneratorConstants
+ .GENERATOR_AAI_ERROR_UNSUPPORTED_WIDGET_OPERATION);
+ }
+
+ public boolean addWidget(Widget widget) {
+ return true;
+ }
+
+ public enum Type {
+ SERVICE, VF, VFC, VSERVER, VOLUME, FLAVOR, TENANT, VOLUME_GROUP, LINT, L3_NET, VFMODULE, IMAGE,
+ OAM_NETWORK,ALLOTTED_RESOURCE,TUNNEL_XCONNECT
+ }
+}