aboutsummaryrefslogtreecommitdiffstats
path: root/dcae-controller-core
diff options
context:
space:
mode:
authorCarsten Lund <lund@research.att.com>2017-06-09 16:36:17 +0000
committerCarsten Lund <lund@research.att.com>2017-06-09 16:36:17 +0000
commit50ddefb52b2cd90bf762a4e0c1f36752f7589053 (patch)
tree7ee23832266cf11f0254e87895dd34c533093b73 /dcae-controller-core
parentb4d78b8b553483a5b38d3aa81ff81fa04b057fd2 (diff)
[DCAE-15] Final update for rebased code.
Change-Id: I99532ff4415c2da2271116adc694c39313f30d65 Signed-off-by: Carsten Lund <lund@research.att.com>
Diffstat (limited to 'dcae-controller-core')
-rw-r--r--dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/DcaeInventory.java25
-rw-r--r--dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryConfigurationRule.java131
-rw-r--r--dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryConfigurationRules.java104
-rw-r--r--dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryFactory.java9
-rw-r--r--dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryPackage.java255
-rw-r--r--dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/DcaeInventoryImpl.java51
-rw-r--r--dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/InventoryConfigurationRuleImpl.java326
-rw-r--r--dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/InventoryFactoryImpl.java11
-rw-r--r--dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/InventoryPackageImpl.java89
-rw-r--r--dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/util/InventoryAdapterFactory.java18
-rw-r--r--dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/util/InventorySwitch.java22
-rw-r--r--dcae-controller-core/dcae-controller-core-model/src/main/xcore/inventory.xcore11
-rw-r--r--dcae-controller-core/dcae-controller-core-utils/.classpath12
-rw-r--r--dcae-controller-core/dcae-controller-core-utils/src/main/server/bin/install-docker.sh1
-rw-r--r--dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/DcaePlatformConfiguration.groovy157
-rw-r--r--dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/GenControllerConfiguration.groovy4
-rw-r--r--dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/DcaeControllerClusterProvider.java5
-rw-r--r--dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/DcaeDcaePlatformControllerProvider.java33
-rw-r--r--dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryProvider.java139
-rw-r--r--dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/DcaeInventory.yaml9
-rw-r--r--dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventory.java28
-rw-r--r--dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryClient.java18
-rw-r--r--dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryConsole.java11
-rw-r--r--dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryProviderTemplate.java6
-rw-r--r--dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventory.properties12
-rw-r--r--dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventoryMessageEnum.java4
-rw-r--r--dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventoryOperationEnum.java3
27 files changed, 1294 insertions, 200 deletions
diff --git a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/DcaeInventory.java b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/DcaeInventory.java
index 2677c30..658ee14 100644
--- a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/DcaeInventory.java
+++ b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/DcaeInventory.java
@@ -17,6 +17,7 @@ import org.eclipse.emf.ecore.EObject;
* <ul>
* <li>{@link org.openecomp.dcae.controller.inventory.DcaeInventory#getServiceTypes <em>Service Types</em>}</li>
* <li>{@link org.openecomp.dcae.controller.inventory.DcaeInventory#getServices <em>Services</em>}</li>
+ * <li>{@link org.openecomp.dcae.controller.inventory.DcaeInventory#getRules <em>Rules</em>}</li>
* </ul>
*
* @see org.openecomp.dcae.controller.inventory.InventoryPackage#getDcaeInventory()
@@ -57,6 +58,22 @@ public interface DcaeInventory extends EObject {
EList<DCAEService> getServices();
/**
+ * Returns the value of the '<em><b>Rules</b></em>' containment reference list.
+ * The list contents are of type {@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Rules</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Rules</em>' containment reference list.
+ * @see org.openecomp.dcae.controller.inventory.InventoryPackage#getDcaeInventory_Rules()
+ * @model containment="true"
+ * @generated
+ */
+ EList<InventoryConfigurationRule> getRules();
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model unique="false" typeNameUnique="false" onlyLatestUnique="false" onlyActiveUnique="false" vnfTypeUnique="false" serviceIdUnique="false" serviceLocationUnique="false" asdcServiceIdUnique="false" asdcResourceIdUnique="false" offsetUnique="false"
@@ -136,4 +153,12 @@ public interface DcaeInventory extends EObject {
*/
void poll();
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @model
+ * @generated
+ */
+ void updateConfiguration();
+
} // DcaeInventory
diff --git a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryConfigurationRule.java b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryConfigurationRule.java
new file mode 100644
index 0000000..50aa0b2
--- /dev/null
+++ b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryConfigurationRule.java
@@ -0,0 +1,131 @@
+/**
+ */
+package org.openecomp.dcae.controller.inventory;
+
+import org.openecomp.ncomp.core.NamedEntity;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Configuration Rule</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getTypeNameMatch <em>Type Name Match</em>}</li>
+ * <li>{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getServiceNameMatch <em>Service Name Match</em>}</li>
+ * <li>{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getInstanceNameMatch <em>Instance Name Match</em>}</li>
+ * <li>{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getBpNodeNameMatch <em>Bp Node Name Match</em>}</li>
+ * </ul>
+ *
+ * @see org.openecomp.dcae.controller.inventory.InventoryPackage#getInventoryConfigurationRule()
+ * @model
+ * @generated
+ */
+public interface InventoryConfigurationRule extends NamedEntity {
+ /**
+ * Returns the value of the '<em><b>Type Name Match</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Type Name Match</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Type Name Match</em>' attribute.
+ * @see #setTypeNameMatch(String)
+ * @see org.openecomp.dcae.controller.inventory.InventoryPackage#getInventoryConfigurationRule_TypeNameMatch()
+ * @model unique="false"
+ * @generated
+ */
+ String getTypeNameMatch();
+
+ /**
+ * Sets the value of the '{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getTypeNameMatch <em>Type Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Type Name Match</em>' attribute.
+ * @see #getTypeNameMatch()
+ * @generated
+ */
+ void setTypeNameMatch(String value);
+
+ /**
+ * Returns the value of the '<em><b>Service Name Match</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Service Name Match</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Service Name Match</em>' attribute.
+ * @see #setServiceNameMatch(String)
+ * @see org.openecomp.dcae.controller.inventory.InventoryPackage#getInventoryConfigurationRule_ServiceNameMatch()
+ * @model unique="false"
+ * @generated
+ */
+ String getServiceNameMatch();
+
+ /**
+ * Sets the value of the '{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getServiceNameMatch <em>Service Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Service Name Match</em>' attribute.
+ * @see #getServiceNameMatch()
+ * @generated
+ */
+ void setServiceNameMatch(String value);
+
+ /**
+ * Returns the value of the '<em><b>Instance Name Match</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Instance Name Match</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Instance Name Match</em>' attribute.
+ * @see #setInstanceNameMatch(String)
+ * @see org.openecomp.dcae.controller.inventory.InventoryPackage#getInventoryConfigurationRule_InstanceNameMatch()
+ * @model unique="false"
+ * @generated
+ */
+ String getInstanceNameMatch();
+
+ /**
+ * Sets the value of the '{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getInstanceNameMatch <em>Instance Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Instance Name Match</em>' attribute.
+ * @see #getInstanceNameMatch()
+ * @generated
+ */
+ void setInstanceNameMatch(String value);
+
+ /**
+ * Returns the value of the '<em><b>Bp Node Name Match</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Bp Node Name Match</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Bp Node Name Match</em>' attribute.
+ * @see #setBpNodeNameMatch(String)
+ * @see org.openecomp.dcae.controller.inventory.InventoryPackage#getInventoryConfigurationRule_BpNodeNameMatch()
+ * @model unique="false"
+ * @generated
+ */
+ String getBpNodeNameMatch();
+
+ /**
+ * Sets the value of the '{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getBpNodeNameMatch <em>Bp Node Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Bp Node Name Match</em>' attribute.
+ * @see #getBpNodeNameMatch()
+ * @generated
+ */
+ void setBpNodeNameMatch(String value);
+
+} // InventoryConfigurationRule
diff --git a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryConfigurationRules.java b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryConfigurationRules.java
new file mode 100644
index 0000000..eaf072e
--- /dev/null
+++ b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryConfigurationRules.java
@@ -0,0 +1,104 @@
+/**
+ */
+package org.openecomp.dcae.controller.inventory;
+
+import org.openecomp.ncomp.core.NamedEntity;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Configuration Rules</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRules#getTypeNameMatch <em>Type Name Match</em>}</li>
+ * <li>{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRules#getServiceNameMatch <em>Service Name Match</em>}</li>
+ * <li>{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRules#getInstanceNameMatch <em>Instance Name Match</em>}</li>
+ * </ul>
+ *
+ * @see org.openecomp.dcae.controller.inventory.InventoryPackage#getInventoryConfigurationRules()
+ * @model
+ * @generated
+ */
+public interface InventoryConfigurationRules extends NamedEntity {
+ /**
+ * Returns the value of the '<em><b>Type Name Match</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Type Name Match</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Type Name Match</em>' attribute.
+ * @see #setTypeNameMatch(String)
+ * @see org.openecomp.dcae.controller.inventory.InventoryPackage#getInventoryConfigurationRules_TypeNameMatch()
+ * @model unique="false"
+ * @generated
+ */
+ String getTypeNameMatch();
+
+ /**
+ * Sets the value of the '{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRules#getTypeNameMatch <em>Type Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Type Name Match</em>' attribute.
+ * @see #getTypeNameMatch()
+ * @generated
+ */
+ void setTypeNameMatch(String value);
+
+ /**
+ * Returns the value of the '<em><b>Service Name Match</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Service Name Match</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Service Name Match</em>' attribute.
+ * @see #setServiceNameMatch(String)
+ * @see org.openecomp.dcae.controller.inventory.InventoryPackage#getInventoryConfigurationRules_ServiceNameMatch()
+ * @model unique="false"
+ * @generated
+ */
+ String getServiceNameMatch();
+
+ /**
+ * Sets the value of the '{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRules#getServiceNameMatch <em>Service Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Service Name Match</em>' attribute.
+ * @see #getServiceNameMatch()
+ * @generated
+ */
+ void setServiceNameMatch(String value);
+
+ /**
+ * Returns the value of the '<em><b>Instance Name Match</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Instance Name Match</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Instance Name Match</em>' attribute.
+ * @see #setInstanceNameMatch(String)
+ * @see org.openecomp.dcae.controller.inventory.InventoryPackage#getInventoryConfigurationRules_InstanceNameMatch()
+ * @model unique="false"
+ * @generated
+ */
+ String getInstanceNameMatch();
+
+ /**
+ * Sets the value of the '{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRules#getInstanceNameMatch <em>Instance Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Instance Name Match</em>' attribute.
+ * @see #getInstanceNameMatch()
+ * @generated
+ */
+ void setInstanceNameMatch(String value);
+
+} // InventoryConfigurationRules
diff --git a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryFactory.java b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryFactory.java
index ca0e968..968a460 100644
--- a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryFactory.java
+++ b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryFactory.java
@@ -157,6 +157,15 @@ public interface InventoryFactory extends EFactory {
UriBuilder createUriBuilder();
/**
+ * Returns a new object of class '<em>Configuration Rule</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Configuration Rule</em>'.
+ * @generated
+ */
+ InventoryConfigurationRule createInventoryConfigurationRule();
+
+ /**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryPackage.java b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryPackage.java
index c454c29..682ef6a 100644
--- a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryPackage.java
+++ b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/InventoryPackage.java
@@ -107,13 +107,22 @@ public interface InventoryPackage extends EPackage {
int DCAE_INVENTORY__SERVICES = 1;
/**
+ * The feature id for the '<em><b>Rules</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DCAE_INVENTORY__RULES = 2;
+
+ /**
* The number of structural features of the '<em>Dcae Inventory</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int DCAE_INVENTORY_FEATURE_COUNT = 2;
+ int DCAE_INVENTORY_FEATURE_COUNT = 3;
/**
* The operation id for the '<em>Get Dcae Service Types</em>' operation.
@@ -206,13 +215,22 @@ public interface InventoryPackage extends EPackage {
int DCAE_INVENTORY___POLL = 9;
/**
+ * The operation id for the '<em>Update Configuration</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DCAE_INVENTORY___UPDATE_CONFIGURATION = 10;
+
+ /**
* The number of operations of the '<em>Dcae Inventory</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int DCAE_INVENTORY_OPERATION_COUNT = 10;
+ int DCAE_INVENTORY_OPERATION_COUNT = 11;
/**
* The meta object id for the '{@link org.openecomp.dcae.controller.inventory.impl.ApiResponseMessageImpl <em>Api Response Message</em>}' class.
@@ -1481,6 +1499,106 @@ public interface InventoryPackage extends EPackage {
/**
+ * The meta object id for the '{@link org.openecomp.dcae.controller.inventory.impl.InventoryConfigurationRuleImpl <em>Configuration Rule</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.openecomp.dcae.controller.inventory.impl.InventoryConfigurationRuleImpl
+ * @see org.openecomp.dcae.controller.inventory.impl.InventoryPackageImpl#getInventoryConfigurationRule()
+ * @generated
+ */
+ int INVENTORY_CONFIGURATION_RULE = 15;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INVENTORY_CONFIGURATION_RULE__NAME = CorePackage.NAMED_ENTITY__NAME;
+
+ /**
+ * The feature id for the '<em><b>Last Polled</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INVENTORY_CONFIGURATION_RULE__LAST_POLLED = CorePackage.NAMED_ENTITY__LAST_POLLED;
+
+ /**
+ * The feature id for the '<em><b>Last Changed</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INVENTORY_CONFIGURATION_RULE__LAST_CHANGED = CorePackage.NAMED_ENTITY__LAST_CHANGED;
+
+ /**
+ * The feature id for the '<em><b>Created</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INVENTORY_CONFIGURATION_RULE__CREATED = CorePackage.NAMED_ENTITY__CREATED;
+
+ /**
+ * The feature id for the '<em><b>Type Name Match</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INVENTORY_CONFIGURATION_RULE__TYPE_NAME_MATCH = CorePackage.NAMED_ENTITY_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Service Name Match</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INVENTORY_CONFIGURATION_RULE__SERVICE_NAME_MATCH = CorePackage.NAMED_ENTITY_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Instance Name Match</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INVENTORY_CONFIGURATION_RULE__INSTANCE_NAME_MATCH = CorePackage.NAMED_ENTITY_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Bp Node Name Match</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INVENTORY_CONFIGURATION_RULE__BP_NODE_NAME_MATCH = CorePackage.NAMED_ENTITY_FEATURE_COUNT + 3;
+
+ /**
+ * The number of structural features of the '<em>Configuration Rule</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INVENTORY_CONFIGURATION_RULE_FEATURE_COUNT = CorePackage.NAMED_ENTITY_FEATURE_COUNT + 4;
+
+ /**
+ * The number of operations of the '<em>Configuration Rule</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INVENTORY_CONFIGURATION_RULE_OPERATION_COUNT = CorePackage.NAMED_ENTITY_OPERATION_COUNT + 0;
+
+ /**
* Returns the meta object for class '{@link org.openecomp.dcae.controller.inventory.DcaeInventory <em>Dcae Inventory</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1513,6 +1631,17 @@ public interface InventoryPackage extends EPackage {
EReference getDcaeInventory_Services();
/**
+ * Returns the meta object for the containment reference list '{@link org.openecomp.dcae.controller.inventory.DcaeInventory#getRules <em>Rules</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Rules</em>'.
+ * @see org.openecomp.dcae.controller.inventory.DcaeInventory#getRules()
+ * @see #getDcaeInventory()
+ * @generated
+ */
+ EReference getDcaeInventory_Rules();
+
+ /**
* Returns the meta object for the '{@link org.openecomp.dcae.controller.inventory.DcaeInventory#getDcaeServiceTypes(java.lang.String, java.lang.Boolean, java.lang.Boolean, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Integer) <em>Get Dcae Service Types</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1613,6 +1742,16 @@ public interface InventoryPackage extends EPackage {
EOperation getDcaeInventory__Poll();
/**
+ * Returns the meta object for the '{@link org.openecomp.dcae.controller.inventory.DcaeInventory#updateConfiguration() <em>Update Configuration</em>}' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the '<em>Update Configuration</em>' operation.
+ * @see org.openecomp.dcae.controller.inventory.DcaeInventory#updateConfiguration()
+ * @generated
+ */
+ EOperation getDcaeInventory__UpdateConfiguration();
+
+ /**
* Returns the meta object for class '{@link org.openecomp.dcae.controller.inventory.ApiResponseMessage <em>Api Response Message</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2600,6 +2739,60 @@ public interface InventoryPackage extends EPackage {
EClass getUriBuilder();
/**
+ * Returns the meta object for class '{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule <em>Configuration Rule</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Configuration Rule</em>'.
+ * @see org.openecomp.dcae.controller.inventory.InventoryConfigurationRule
+ * @generated
+ */
+ EClass getInventoryConfigurationRule();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getTypeNameMatch <em>Type Name Match</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Type Name Match</em>'.
+ * @see org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getTypeNameMatch()
+ * @see #getInventoryConfigurationRule()
+ * @generated
+ */
+ EAttribute getInventoryConfigurationRule_TypeNameMatch();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getServiceNameMatch <em>Service Name Match</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Service Name Match</em>'.
+ * @see org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getServiceNameMatch()
+ * @see #getInventoryConfigurationRule()
+ * @generated
+ */
+ EAttribute getInventoryConfigurationRule_ServiceNameMatch();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getInstanceNameMatch <em>Instance Name Match</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Instance Name Match</em>'.
+ * @see org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getInstanceNameMatch()
+ * @see #getInventoryConfigurationRule()
+ * @generated
+ */
+ EAttribute getInventoryConfigurationRule_InstanceNameMatch();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getBpNodeNameMatch <em>Bp Node Name Match</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Bp Node Name Match</em>'.
+ * @see org.openecomp.dcae.controller.inventory.InventoryConfigurationRule#getBpNodeNameMatch()
+ * @see #getInventoryConfigurationRule()
+ * @generated
+ */
+ EAttribute getInventoryConfigurationRule_BpNodeNameMatch();
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2649,6 +2842,14 @@ public interface InventoryPackage extends EPackage {
EReference DCAE_INVENTORY__SERVICES = eINSTANCE.getDcaeInventory_Services();
/**
+ * The meta object literal for the '<em><b>Rules</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference DCAE_INVENTORY__RULES = eINSTANCE.getDcaeInventory_Rules();
+
+ /**
* The meta object literal for the '<em><b>Get Dcae Service Types</b></em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2729,6 +2930,14 @@ public interface InventoryPackage extends EPackage {
EOperation DCAE_INVENTORY___POLL = eINSTANCE.getDcaeInventory__Poll();
/**
+ * The meta object literal for the '<em><b>Update Configuration</b></em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EOperation DCAE_INVENTORY___UPDATE_CONFIGURATION = eINSTANCE.getDcaeInventory__UpdateConfiguration();
+
+ /**
* The meta object literal for the '{@link org.openecomp.dcae.controller.inventory.impl.ApiResponseMessageImpl <em>Api Response Message</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -3484,6 +3693,48 @@ public interface InventoryPackage extends EPackage {
*/
EClass URI_BUILDER = eINSTANCE.getUriBuilder();
+ /**
+ * The meta object literal for the '{@link org.openecomp.dcae.controller.inventory.impl.InventoryConfigurationRuleImpl <em>Configuration Rule</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.openecomp.dcae.controller.inventory.impl.InventoryConfigurationRuleImpl
+ * @see org.openecomp.dcae.controller.inventory.impl.InventoryPackageImpl#getInventoryConfigurationRule()
+ * @generated
+ */
+ EClass INVENTORY_CONFIGURATION_RULE = eINSTANCE.getInventoryConfigurationRule();
+
+ /**
+ * The meta object literal for the '<em><b>Type Name Match</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute INVENTORY_CONFIGURATION_RULE__TYPE_NAME_MATCH = eINSTANCE.getInventoryConfigurationRule_TypeNameMatch();
+
+ /**
+ * The meta object literal for the '<em><b>Service Name Match</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute INVENTORY_CONFIGURATION_RULE__SERVICE_NAME_MATCH = eINSTANCE.getInventoryConfigurationRule_ServiceNameMatch();
+
+ /**
+ * The meta object literal for the '<em><b>Instance Name Match</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute INVENTORY_CONFIGURATION_RULE__INSTANCE_NAME_MATCH = eINSTANCE.getInventoryConfigurationRule_InstanceNameMatch();
+
+ /**
+ * The meta object literal for the '<em><b>Bp Node Name Match</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute INVENTORY_CONFIGURATION_RULE__BP_NODE_NAME_MATCH = eINSTANCE.getInventoryConfigurationRule_BpNodeNameMatch();
+
}
} //InventoryPackage
diff --git a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/DcaeInventoryImpl.java b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/DcaeInventoryImpl.java
index 5e92c3a..f98c884 100644
--- a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/DcaeInventoryImpl.java
+++ b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/DcaeInventoryImpl.java
@@ -26,6 +26,7 @@ import org.openecomp.dcae.controller.inventory.DCAEServiceType;
import org.openecomp.dcae.controller.inventory.DCAEServiceTypeRequest;
import org.openecomp.dcae.controller.inventory.DcaeInventory;
import org.openecomp.dcae.controller.inventory.DcaeServiceTypeResults;
+import org.openecomp.dcae.controller.inventory.InventoryConfigurationRule;
import org.openecomp.dcae.controller.inventory.DcaeServiceResults;
import org.openecomp.dcae.controller.inventory.InventoryPackage;
@@ -39,6 +40,7 @@ import org.openecomp.dcae.controller.inventory.InventoryPackage;
* <ul>
* <li>{@link org.openecomp.dcae.controller.inventory.impl.DcaeInventoryImpl#getServiceTypes <em>Service Types</em>}</li>
* <li>{@link org.openecomp.dcae.controller.inventory.impl.DcaeInventoryImpl#getServices <em>Services</em>}</li>
+ * <li>{@link org.openecomp.dcae.controller.inventory.impl.DcaeInventoryImpl#getRules <em>Rules</em>}</li>
* </ul>
*
* @generated
@@ -65,6 +67,16 @@ public class DcaeInventoryImpl extends MinimalEObjectImpl.Container implements D
protected EList<DCAEService> services;
/**
+ * The cached value of the '{@link #getRules() <em>Rules</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getRules()
+ * @generated
+ * @ordered
+ */
+ protected EList<InventoryConfigurationRule> rules;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -112,6 +124,18 @@ public class DcaeInventoryImpl extends MinimalEObjectImpl.Container implements D
* <!-- end-user-doc -->
* @generated
*/
+ public EList<InventoryConfigurationRule> getRules() {
+ if (rules == null) {
+ rules = new EObjectContainmentEList<InventoryConfigurationRule>(InventoryConfigurationRule.class, this, InventoryPackage.DCAE_INVENTORY__RULES);
+ }
+ return rules;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public DcaeServiceTypeResults getDcaeServiceTypes(String typeName, Boolean onlyLatest, Boolean onlyActive, String vnfType, String serviceId, String serviceLocation, String asdcServiceId, String asdcResourceId, Integer offset) {
// TODO: implement this method
// Ensure that you remove @generated or mark it @generated NOT
@@ -222,6 +246,17 @@ public class DcaeInventoryImpl extends MinimalEObjectImpl.Container implements D
* <!-- end-user-doc -->
* @generated
*/
+ public void updateConfiguration() {
+ // TODO: implement this method
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
@@ -229,6 +264,8 @@ public class DcaeInventoryImpl extends MinimalEObjectImpl.Container implements D
return ((InternalEList<?>)getServiceTypes()).basicRemove(otherEnd, msgs);
case InventoryPackage.DCAE_INVENTORY__SERVICES:
return ((InternalEList<?>)getServices()).basicRemove(otherEnd, msgs);
+ case InventoryPackage.DCAE_INVENTORY__RULES:
+ return ((InternalEList<?>)getRules()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@@ -245,6 +282,8 @@ public class DcaeInventoryImpl extends MinimalEObjectImpl.Container implements D
return getServiceTypes();
case InventoryPackage.DCAE_INVENTORY__SERVICES:
return getServices();
+ case InventoryPackage.DCAE_INVENTORY__RULES:
+ return getRules();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -266,6 +305,10 @@ public class DcaeInventoryImpl extends MinimalEObjectImpl.Container implements D
getServices().clear();
getServices().addAll((Collection<? extends DCAEService>)newValue);
return;
+ case InventoryPackage.DCAE_INVENTORY__RULES:
+ getRules().clear();
+ getRules().addAll((Collection<? extends InventoryConfigurationRule>)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -284,6 +327,9 @@ public class DcaeInventoryImpl extends MinimalEObjectImpl.Container implements D
case InventoryPackage.DCAE_INVENTORY__SERVICES:
getServices().clear();
return;
+ case InventoryPackage.DCAE_INVENTORY__RULES:
+ getRules().clear();
+ return;
}
super.eUnset(featureID);
}
@@ -300,6 +346,8 @@ public class DcaeInventoryImpl extends MinimalEObjectImpl.Container implements D
return serviceTypes != null && !serviceTypes.isEmpty();
case InventoryPackage.DCAE_INVENTORY__SERVICES:
return services != null && !services.isEmpty();
+ case InventoryPackage.DCAE_INVENTORY__RULES:
+ return rules != null && !rules.isEmpty();
}
return super.eIsSet(featureID);
}
@@ -334,6 +382,9 @@ public class DcaeInventoryImpl extends MinimalEObjectImpl.Container implements D
case InventoryPackage.DCAE_INVENTORY___POLL:
poll();
return null;
+ case InventoryPackage.DCAE_INVENTORY___UPDATE_CONFIGURATION:
+ updateConfiguration();
+ return null;
}
return super.eInvoke(operationID, arguments);
}
diff --git a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/InventoryConfigurationRuleImpl.java b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/InventoryConfigurationRuleImpl.java
new file mode 100644
index 0000000..702fd90
--- /dev/null
+++ b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/InventoryConfigurationRuleImpl.java
@@ -0,0 +1,326 @@
+/**
+ */
+package org.openecomp.dcae.controller.inventory.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.openecomp.dcae.controller.inventory.InventoryConfigurationRule;
+import org.openecomp.dcae.controller.inventory.InventoryPackage;
+
+import org.openecomp.ncomp.core.impl.NamedEntityImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Configuration Rule</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.openecomp.dcae.controller.inventory.impl.InventoryConfigurationRuleImpl#getTypeNameMatch <em>Type Name Match</em>}</li>
+ * <li>{@link org.openecomp.dcae.controller.inventory.impl.InventoryConfigurationRuleImpl#getServiceNameMatch <em>Service Name Match</em>}</li>
+ * <li>{@link org.openecomp.dcae.controller.inventory.impl.InventoryConfigurationRuleImpl#getInstanceNameMatch <em>Instance Name Match</em>}</li>
+ * <li>{@link org.openecomp.dcae.controller.inventory.impl.InventoryConfigurationRuleImpl#getBpNodeNameMatch <em>Bp Node Name Match</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class InventoryConfigurationRuleImpl extends NamedEntityImpl implements InventoryConfigurationRule {
+ /**
+ * The default value of the '{@link #getTypeNameMatch() <em>Type Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTypeNameMatch()
+ * @generated
+ * @ordered
+ */
+ protected static final String TYPE_NAME_MATCH_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getTypeNameMatch() <em>Type Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTypeNameMatch()
+ * @generated
+ * @ordered
+ */
+ protected String typeNameMatch = TYPE_NAME_MATCH_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getServiceNameMatch() <em>Service Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getServiceNameMatch()
+ * @generated
+ * @ordered
+ */
+ protected static final String SERVICE_NAME_MATCH_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getServiceNameMatch() <em>Service Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getServiceNameMatch()
+ * @generated
+ * @ordered
+ */
+ protected String serviceNameMatch = SERVICE_NAME_MATCH_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getInstanceNameMatch() <em>Instance Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getInstanceNameMatch()
+ * @generated
+ * @ordered
+ */
+ protected static final String INSTANCE_NAME_MATCH_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getInstanceNameMatch() <em>Instance Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getInstanceNameMatch()
+ * @generated
+ * @ordered
+ */
+ protected String instanceNameMatch = INSTANCE_NAME_MATCH_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getBpNodeNameMatch() <em>Bp Node Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getBpNodeNameMatch()
+ * @generated
+ * @ordered
+ */
+ protected static final String BP_NODE_NAME_MATCH_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getBpNodeNameMatch() <em>Bp Node Name Match</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getBpNodeNameMatch()
+ * @generated
+ * @ordered
+ */
+ protected String bpNodeNameMatch = BP_NODE_NAME_MATCH_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected InventoryConfigurationRuleImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return InventoryPackage.Literals.INVENTORY_CONFIGURATION_RULE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getTypeNameMatch() {
+ return typeNameMatch;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTypeNameMatch(String newTypeNameMatch) {
+ String oldTypeNameMatch = typeNameMatch;
+ typeNameMatch = newTypeNameMatch;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, InventoryPackage.INVENTORY_CONFIGURATION_RULE__TYPE_NAME_MATCH, oldTypeNameMatch, typeNameMatch));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getServiceNameMatch() {
+ return serviceNameMatch;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setServiceNameMatch(String newServiceNameMatch) {
+ String oldServiceNameMatch = serviceNameMatch;
+ serviceNameMatch = newServiceNameMatch;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, InventoryPackage.INVENTORY_CONFIGURATION_RULE__SERVICE_NAME_MATCH, oldServiceNameMatch, serviceNameMatch));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getInstanceNameMatch() {
+ return instanceNameMatch;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setInstanceNameMatch(String newInstanceNameMatch) {
+ String oldInstanceNameMatch = instanceNameMatch;
+ instanceNameMatch = newInstanceNameMatch;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, InventoryPackage.INVENTORY_CONFIGURATION_RULE__INSTANCE_NAME_MATCH, oldInstanceNameMatch, instanceNameMatch));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getBpNodeNameMatch() {
+ return bpNodeNameMatch;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setBpNodeNameMatch(String newBpNodeNameMatch) {
+ String oldBpNodeNameMatch = bpNodeNameMatch;
+ bpNodeNameMatch = newBpNodeNameMatch;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, InventoryPackage.INVENTORY_CONFIGURATION_RULE__BP_NODE_NAME_MATCH, oldBpNodeNameMatch, bpNodeNameMatch));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__TYPE_NAME_MATCH:
+ return getTypeNameMatch();
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__SERVICE_NAME_MATCH:
+ return getServiceNameMatch();
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__INSTANCE_NAME_MATCH:
+ return getInstanceNameMatch();
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__BP_NODE_NAME_MATCH:
+ return getBpNodeNameMatch();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__TYPE_NAME_MATCH:
+ setTypeNameMatch((String)newValue);
+ return;
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__SERVICE_NAME_MATCH:
+ setServiceNameMatch((String)newValue);
+ return;
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__INSTANCE_NAME_MATCH:
+ setInstanceNameMatch((String)newValue);
+ return;
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__BP_NODE_NAME_MATCH:
+ setBpNodeNameMatch((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__TYPE_NAME_MATCH:
+ setTypeNameMatch(TYPE_NAME_MATCH_EDEFAULT);
+ return;
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__SERVICE_NAME_MATCH:
+ setServiceNameMatch(SERVICE_NAME_MATCH_EDEFAULT);
+ return;
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__INSTANCE_NAME_MATCH:
+ setInstanceNameMatch(INSTANCE_NAME_MATCH_EDEFAULT);
+ return;
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__BP_NODE_NAME_MATCH:
+ setBpNodeNameMatch(BP_NODE_NAME_MATCH_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__TYPE_NAME_MATCH:
+ return TYPE_NAME_MATCH_EDEFAULT == null ? typeNameMatch != null : !TYPE_NAME_MATCH_EDEFAULT.equals(typeNameMatch);
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__SERVICE_NAME_MATCH:
+ return SERVICE_NAME_MATCH_EDEFAULT == null ? serviceNameMatch != null : !SERVICE_NAME_MATCH_EDEFAULT.equals(serviceNameMatch);
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__INSTANCE_NAME_MATCH:
+ return INSTANCE_NAME_MATCH_EDEFAULT == null ? instanceNameMatch != null : !INSTANCE_NAME_MATCH_EDEFAULT.equals(instanceNameMatch);
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE__BP_NODE_NAME_MATCH:
+ return BP_NODE_NAME_MATCH_EDEFAULT == null ? bpNodeNameMatch != null : !BP_NODE_NAME_MATCH_EDEFAULT.equals(bpNodeNameMatch);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (typeNameMatch: ");
+ result.append(typeNameMatch);
+ result.append(", serviceNameMatch: ");
+ result.append(serviceNameMatch);
+ result.append(", instanceNameMatch: ");
+ result.append(instanceNameMatch);
+ result.append(", bpNodeNameMatch: ");
+ result.append(bpNodeNameMatch);
+ result.append(')');
+ return result.toString();
+ }
+
+} //InventoryConfigurationRuleImpl
diff --git a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/InventoryFactoryImpl.java b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/InventoryFactoryImpl.java
index 5a25e6a..7678eaf 100644
--- a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/InventoryFactoryImpl.java
+++ b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/InventoryFactoryImpl.java
@@ -71,6 +71,7 @@ public class InventoryFactoryImpl extends EFactoryImpl implements InventoryFacto
case InventoryPackage.LINK: return createLink();
case InventoryPackage.PARAMETER: return createParameter();
case InventoryPackage.URI_BUILDER: return createUriBuilder();
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE: return createInventoryConfigurationRule();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -231,6 +232,16 @@ public class InventoryFactoryImpl extends EFactoryImpl implements InventoryFacto
* <!-- end-user-doc -->
* @generated
*/
+ public InventoryConfigurationRule createInventoryConfigurationRule() {
+ InventoryConfigurationRuleImpl inventoryConfigurationRule = new InventoryConfigurationRuleImpl();
+ return inventoryConfigurationRule;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public InventoryPackage getInventoryPackage() {
return (InventoryPackage)getEPackage();
}
diff --git a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/InventoryPackageImpl.java b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/InventoryPackageImpl.java
index 9cfd0a8..f3f5f83 100644
--- a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/InventoryPackageImpl.java
+++ b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/impl/InventoryPackageImpl.java
@@ -22,6 +22,7 @@ import org.openecomp.dcae.controller.inventory.DCAEServiceType;
import org.openecomp.dcae.controller.inventory.DCAEServiceTypeRequest;
import org.openecomp.dcae.controller.inventory.DcaeInventory;
import org.openecomp.dcae.controller.inventory.DcaeServiceTypeResults;
+import org.openecomp.dcae.controller.inventory.InventoryConfigurationRule;
import org.openecomp.dcae.controller.inventory.DcaeServiceResults;
import org.openecomp.dcae.controller.inventory.InventoryFactory;
import org.openecomp.dcae.controller.inventory.InventoryPackage;
@@ -144,6 +145,13 @@ public class InventoryPackageImpl extends EPackageImpl implements InventoryPacka
private EClass uriBuilderEClass = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass inventoryConfigurationRuleEClass = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
@@ -239,6 +247,15 @@ public class InventoryPackageImpl extends EPackageImpl implements InventoryPacka
* <!-- end-user-doc -->
* @generated
*/
+ public EReference getDcaeInventory_Rules() {
+ return (EReference)dcaeInventoryEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EOperation getDcaeInventory__GetDcaeServiceTypes__String_Boolean_Boolean_String_String_String_String_String_Integer() {
return dcaeInventoryEClass.getEOperations().get(0);
}
@@ -329,6 +346,15 @@ public class InventoryPackageImpl extends EPackageImpl implements InventoryPacka
* <!-- end-user-doc -->
* @generated
*/
+ public EOperation getDcaeInventory__UpdateConfiguration() {
+ return dcaeInventoryEClass.getEOperations().get(10);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getApiResponseMessage() {
return apiResponseMessageEClass;
}
@@ -1148,6 +1174,51 @@ public class InventoryPackageImpl extends EPackageImpl implements InventoryPacka
* <!-- end-user-doc -->
* @generated
*/
+ public EClass getInventoryConfigurationRule() {
+ return inventoryConfigurationRuleEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getInventoryConfigurationRule_TypeNameMatch() {
+ return (EAttribute)inventoryConfigurationRuleEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getInventoryConfigurationRule_ServiceNameMatch() {
+ return (EAttribute)inventoryConfigurationRuleEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getInventoryConfigurationRule_InstanceNameMatch() {
+ return (EAttribute)inventoryConfigurationRuleEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getInventoryConfigurationRule_BpNodeNameMatch() {
+ return (EAttribute)inventoryConfigurationRuleEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public InventoryFactory getInventoryFactory() {
return (InventoryFactory)getEFactoryInstance();
}
@@ -1174,6 +1245,7 @@ public class InventoryPackageImpl extends EPackageImpl implements InventoryPacka
dcaeInventoryEClass = createEClass(DCAE_INVENTORY);
createEReference(dcaeInventoryEClass, DCAE_INVENTORY__SERVICE_TYPES);
createEReference(dcaeInventoryEClass, DCAE_INVENTORY__SERVICES);
+ createEReference(dcaeInventoryEClass, DCAE_INVENTORY__RULES);
createEOperation(dcaeInventoryEClass, DCAE_INVENTORY___GET_DCAE_SERVICE_TYPES__STRING_BOOLEAN_BOOLEAN_STRING_STRING_STRING_STRING_STRING_INTEGER);
createEOperation(dcaeInventoryEClass, DCAE_INVENTORY___DELETE_DCAE_SERVICE_TYPES_TYPE__STRING);
createEOperation(dcaeInventoryEClass, DCAE_INVENTORY___GET_DCAE_SERVICE_TYPES_TYPE__STRING);
@@ -1184,6 +1256,7 @@ public class InventoryPackageImpl extends EPackageImpl implements InventoryPacka
createEOperation(dcaeInventoryEClass, DCAE_INVENTORY___GET_DCAE_SERVICES_SERVICE__STRING);
createEOperation(dcaeInventoryEClass, DCAE_INVENTORY___CREATE_DCAE_SERVICES_SERVICE__STRING_DCAESERVICEREQUEST);
createEOperation(dcaeInventoryEClass, DCAE_INVENTORY___POLL);
+ createEOperation(dcaeInventoryEClass, DCAE_INVENTORY___UPDATE_CONFIGURATION);
apiResponseMessageEClass = createEClass(API_RESPONSE_MESSAGE);
createEAttribute(apiResponseMessageEClass, API_RESPONSE_MESSAGE__CODE);
@@ -1289,6 +1362,12 @@ public class InventoryPackageImpl extends EPackageImpl implements InventoryPacka
createEAttribute(parameterEClass, PARAMETER__VALUE);
uriBuilderEClass = createEClass(URI_BUILDER);
+
+ inventoryConfigurationRuleEClass = createEClass(INVENTORY_CONFIGURATION_RULE);
+ createEAttribute(inventoryConfigurationRuleEClass, INVENTORY_CONFIGURATION_RULE__TYPE_NAME_MATCH);
+ createEAttribute(inventoryConfigurationRuleEClass, INVENTORY_CONFIGURATION_RULE__SERVICE_NAME_MATCH);
+ createEAttribute(inventoryConfigurationRuleEClass, INVENTORY_CONFIGURATION_RULE__INSTANCE_NAME_MATCH);
+ createEAttribute(inventoryConfigurationRuleEClass, INVENTORY_CONFIGURATION_RULE__BP_NODE_NAME_MATCH);
}
/**
@@ -1328,11 +1407,13 @@ public class InventoryPackageImpl extends EPackageImpl implements InventoryPacka
dcaeServiceTypeEClass.getESuperTypes().add(theCorePackage.getNamedEntity());
linkEClass.getESuperTypes().add(theCorePackage.getNamedEntity());
parameterEClass.getESuperTypes().add(theCorePackage.getNamedEntity());
+ inventoryConfigurationRuleEClass.getESuperTypes().add(theCorePackage.getNamedEntity());
// Initialize classes, features, and operations; add parameters
initEClass(dcaeInventoryEClass, DcaeInventory.class, "DcaeInventory", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getDcaeInventory_ServiceTypes(), this.getDCAEServiceType(), null, "serviceTypes", null, 0, -1, DcaeInventory.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getDcaeInventory_Services(), this.getDCAEService(), null, "services", null, 0, -1, DcaeInventory.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getDcaeInventory_Rules(), this.getInventoryConfigurationRule(), null, "rules", null, 0, -1, DcaeInventory.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
EOperation op = initEOperation(getDcaeInventory__GetDcaeServiceTypes__String_Boolean_Boolean_String_String_String_String_String_Integer(), this.getDcaeServiceTypeResults(), "getDcaeServiceTypes", 0, 1, !IS_UNIQUE, IS_ORDERED);
addEParameter(op, theEcorePackage.getEString(), "typeName", 0, 1, !IS_UNIQUE, IS_ORDERED);
@@ -1379,6 +1460,8 @@ public class InventoryPackageImpl extends EPackageImpl implements InventoryPacka
initEOperation(getDcaeInventory__Poll(), null, "poll", 0, 1, !IS_UNIQUE, IS_ORDERED);
+ initEOperation(getDcaeInventory__UpdateConfiguration(), null, "updateConfiguration", 0, 1, !IS_UNIQUE, IS_ORDERED);
+
initEClass(apiResponseMessageEClass, ApiResponseMessage.class, "ApiResponseMessage", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getApiResponseMessage_Code(), theEcorePackage.getEIntegerObject(), "code", null, 0, 1, ApiResponseMessage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getApiResponseMessage_Type(), theEcorePackage.getEString(), "type", null, 0, 1, ApiResponseMessage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -1484,6 +1567,12 @@ public class InventoryPackageImpl extends EPackageImpl implements InventoryPacka
initEClass(uriBuilderEClass, UriBuilder.class, "UriBuilder", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEClass(inventoryConfigurationRuleEClass, InventoryConfigurationRule.class, "InventoryConfigurationRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getInventoryConfigurationRule_TypeNameMatch(), theEcorePackage.getEString(), "typeNameMatch", null, 0, 1, InventoryConfigurationRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getInventoryConfigurationRule_ServiceNameMatch(), theEcorePackage.getEString(), "serviceNameMatch", null, 0, 1, InventoryConfigurationRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getInventoryConfigurationRule_InstanceNameMatch(), theEcorePackage.getEString(), "instanceNameMatch", null, 0, 1, InventoryConfigurationRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getInventoryConfigurationRule_BpNodeNameMatch(), theEcorePackage.getEString(), "bpNodeNameMatch", null, 0, 1, InventoryConfigurationRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
// Create resource
createResource(eNS_URI);
}
diff --git a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/util/InventoryAdapterFactory.java b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/util/InventoryAdapterFactory.java
index a4ecd1f..f4225a2 100644
--- a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/util/InventoryAdapterFactory.java
+++ b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/util/InventoryAdapterFactory.java
@@ -130,6 +130,10 @@ public class InventoryAdapterFactory extends AdapterFactoryImpl {
return createUriBuilderAdapter();
}
@Override
+ public Adapter caseInventoryConfigurationRule(InventoryConfigurationRule object) {
+ return createInventoryConfigurationRuleAdapter();
+ }
+ @Override
public Adapter caseNamedEntity(NamedEntity object) {
return createNamedEntityAdapter();
}
@@ -364,6 +368,20 @@ public class InventoryAdapterFactory extends AdapterFactoryImpl {
}
/**
+ * Creates a new adapter for an object of class '{@link org.openecomp.dcae.controller.inventory.InventoryConfigurationRule <em>Configuration Rule</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.openecomp.dcae.controller.inventory.InventoryConfigurationRule
+ * @generated
+ */
+ public Adapter createInventoryConfigurationRuleAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.openecomp.ncomp.core.NamedEntity <em>Named Entity</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
diff --git a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/util/InventorySwitch.java b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/util/InventorySwitch.java
index bb72107..cca37d2 100644
--- a/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/util/InventorySwitch.java
+++ b/dcae-controller-core/dcae-controller-core-model/src/main/xcore-gen/org/openecomp/dcae/controller/inventory/util/InventorySwitch.java
@@ -163,6 +163,13 @@ public class InventorySwitch<T> extends Switch<T> {
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case InventoryPackage.INVENTORY_CONFIGURATION_RULE: {
+ InventoryConfigurationRule inventoryConfigurationRule = (InventoryConfigurationRule)theEObject;
+ T result = caseInventoryConfigurationRule(inventoryConfigurationRule);
+ if (result == null) result = caseNamedEntity(inventoryConfigurationRule);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
default: return defaultCase(theEObject);
}
}
@@ -393,6 +400,21 @@ public class InventorySwitch<T> extends Switch<T> {
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Configuration Rule</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Configuration Rule</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseInventoryConfigurationRule(InventoryConfigurationRule object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Named Entity</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
diff --git a/dcae-controller-core/dcae-controller-core-model/src/main/xcore/inventory.xcore b/dcae-controller-core/dcae-controller-core-model/src/main/xcore/inventory.xcore
index 911a108..b5acfb4 100644
--- a/dcae-controller-core/dcae-controller-core-model/src/main/xcore/inventory.xcore
+++ b/dcae-controller-core/dcae-controller-core-model/src/main/xcore/inventory.xcore
@@ -25,6 +25,7 @@ import org.openecomp.ncomp.core.NamedEntity
class DcaeInventory {
contains DCAEServiceType[] serviceTypes
contains DCAEService[] services
+ contains InventoryConfigurationRule[] rules
op DcaeServiceTypeResults getDcaeServiceTypes(String typeName, Boolean onlyLatest, Boolean onlyActive, String vnfType, String serviceId, String serviceLocation, String asdcServiceId, String asdcResourceId, Integer offset)
op ApiResponseMessage deleteDcaeServiceTypesType(String[1] typeId)
op DCAEServiceType getDcaeServiceTypesType(String typeId)
@@ -35,6 +36,7 @@ class DcaeInventory {
op DCAEService getDcaeServicesService(String serviceId)
op DCAEService createDcaeServicesService(String serviceId, DCAEServiceRequest body)
op void poll()
+ op void updateConfiguration()
}
class ApiResponseMessage {
@@ -196,3 +198,12 @@ class Parameter extends NamedEntity {
class UriBuilder {
}
+
+
+class InventoryConfigurationRule extends NamedEntity {
+ String typeNameMatch // blueprint.yaml
+ String serviceNameMatch // cdap-map-edge
+ String instanceNameMatch // cfc1
+ String bpNodeNameMatch // map_0_map_map
+}
+
diff --git a/dcae-controller-core/dcae-controller-core-utils/.classpath b/dcae-controller-core/dcae-controller-core-utils/.classpath
index e4af655..f004ea4 100644
--- a/dcae-controller-core/dcae-controller-core-utils/.classpath
+++ b/dcae-controller-core/dcae-controller-core-utils/.classpath
@@ -6,17 +6,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java">
- <attributes>
- <attribute name="optional" value="true"/>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
<classpathentry kind="src" path="src/main/server"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
@@ -28,7 +17,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="src" path="/ncomp-sirius-manager-server"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
<classpathentry kind="output" path="target/classes"/>
diff --git a/dcae-controller-core/dcae-controller-core-utils/src/main/server/bin/install-docker.sh b/dcae-controller-core/dcae-controller-core-utils/src/main/server/bin/install-docker.sh
index 272a54d..7b29006 100644
--- a/dcae-controller-core/dcae-controller-core-utils/src/main/server/bin/install-docker.sh
+++ b/dcae-controller-core/dcae-controller-core-utils/src/main/server/bin/install-docker.sh
@@ -92,7 +92,6 @@ MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | h
FILE1=/etc/default/docker
echo DOCKER_OPTS=\"\$DOCKER_OPTS --mtu=$MTU\" >> $FILE1
-
#
# Start Docker
#
diff --git a/dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/DcaePlatformConfiguration.groovy b/dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/DcaePlatformConfiguration.groovy
index 234e98a..4f35b7e 100644
--- a/dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/DcaePlatformConfiguration.groovy
+++ b/dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/DcaePlatformConfiguration.groovy
@@ -38,7 +38,6 @@ import org.junit.After;
import groovy.text.SimpleTemplateEngine
import org.openecomp.ncomp.utils.CryptoUtils;
-import org.openecomp.ncomp.webservice.utils.IpUtils
class DcaePlatformConfiguration {
def env
@@ -428,162 +427,6 @@ class DcaePlatformConfiguration {
return res
}
- def eforc() {
- def res = [:]
- def list = []
- def d = [:]
- deploymentType.each { n, v ->
- d[n]=v
- }
- d['vm-all'] = [
- type : ['openstack-vm-type': networking ]
- ]
- d.each { n, v ->
-// println "n=$n v=${p(v)}"
- def x = [outbound:[:],inbound:[:]]
- res[n] = x
- def out
- if (n.startsWith('vm-')) {
- def vm = v.type['openstack-vm-type'] ?: [:]
-// println "n=$n vm=$vm"
- out = vm['application-outbound-security-rules'] ?: [:]
- }
- else {
- out = v.type['application-outbound-security-rules'] ?: [:]
- }
-// println "n=$n out=$out"
- out.each { n1, v1 ->
-// println "n1=$n1 v1=$v1 dest=${destination2deployment(n1,v1)}"
- if (v1['only-local']) return
- x.outbound[n1] = []
- findEndpoints(n).each { from ->
- destination2deployment(n1,v1).each { n2 ->
-// println "n1=$n1 v1=$v1 endpoints=${findEndpoints(n2,v1)}"
- findEndpoints(n2,v1).each { to ->
- if (from == to) return
- if (both_local(from,to)) return
- def ip1 = findIps(n,from)
- def ip2 = findIps(n2,to,v1)
- def ports = v1.ports ?: ( v1.port ?: 'TBD')
- def protocol = v1.protocol ?: 'tcp'
-// println "out=$n1 from=$from to=$to $ip1 $ip2"
- x.outbound[n1] += [
- from: "$n@$from($ip1)",
- to: "$n2@$to($ip2) ${protocol}:$ports",
- ]
- ip1.each { y1 ->
- def subnet1 = ip2subnet(y1,from)
- ip2.each { y2 ->
- def subnet2 = ip2subnet(y2,to)
- list += [[n,"in",n1,n,n2,from,to,y1,y2,subnet1,subnet2,protocol,ports]]
- }
- }
- }
- }
- }
- }
- def inn
- if (n.startsWith('vm-')) {
- def vm = v.type['openstack-vm-type'] ?: [:]
-// println "n=$n vm=$vm"
- inn = vm['application-inbound-security-rules'] ?: [:]
- }
- else {
- inn = v.type['application-inbound-security-rules'] ?: [:]
- }
-// println "n=$n in=$in"
- inn.each { n1, v1 ->
-// println "n1=$n1 v1=$v1"
- if (v1['only-local']) return
- x.inbound[n1] = []
- destination2deployment(n1,v1).each { n2 ->
- findEndpoints(n2,v1).each { from ->
- findEndpoints(n).each { to ->
- if (from == to) return
- if (both_local(from,to)) return
- def ip1 = findIps(n2,from,v1)
- def ip2 = findIps(n,to)
- def ports = v1.ports ?: [ ( v1.port ?: 'TBD') ]
- def protocol = v1.protocol ?: 'tcp'
- // println "in=$n1 from=$from to=$to $ip1 $ip2"
- x.inbound[n1] += [
- from: "$n2@$from($ip1)",
- to: "$n@$to($ip2) $protocol:$ports",
- ]
- ip1.each { y1 ->
- def subnet1 = ip2subnet(y1,from)
- ip2.each { y2 ->
- def subnet2 = ip2subnet(y2,to)
- list += [[n,"out",n1,n2,n,from,to,y1,y2,subnet1,subnet2,protocol,ports]]
- }
- }
- }
- }
- }
- }
-// println p(x)
-// println p(res)
-// System.exit(3)
- }
- def res1 = [:]
- res.each { n,v ->
- if (v.inbound.size()==0) v.inbound=null
- if (v.outbound.size()==0) v.outbound=null
- if (v.inbound == null && v.outbound ==null) return
- res1[n] = v
- }
- def m2 = [:]
- list.each { l ->
- def siteA = l[5]
- def siteB = l[6]
- def sA = l[9]
- def sB = l[10]
- def protocol = l[11]
- def ports = l[12]
- def k = "$siteA:$siteB:$sA:$sB:$protocol"
- if (m2[k] == null) {
- m2[k] = [
- siteA:siteA,
- siteB:siteB,
- subnetA:sA,
- subnetB:sB,
- protocol:protocol,
- ports : []
- ]
- }
- ports.each { port ->
- if ( ! m2[k].ports.contains(port))
- m2[k].ports.add(port)
- }
- }
- def list2 = []
- m2.each { n, v ->
- list2 += [ [ v.siteA, v.siteB, v.subnetA, v.subnetB, v.protocol, v.ports.join(":") ]]
- }
- return [m:res1,list:list,m2:m2,list2:list2]
- }
- def site2subnet = [:]
- def ip2subnet(ip,site) {
- if (tenants[site]== null) return ip
- if (! IpUtils.isIpv4(ip) ) return ip
- def subnets = tenants[site].subnets ?: []
- def res = null
- subnets.each { subnet ->
- if (res != null) return
- String[] a = subnet.split("/")
- def ip2 = a[0]
- def len = a[1]
- if (! IpUtils.isIpv4(ip2) || ! len.isInteger()) {
- println "Bad subnet: $subnet at $site"
- System.exit(2)
- }
- if (IpUtils.containedIn(IpUtils.toInetAddress(ip),IpUtils.toInetAddress(ip2),len.toInteger())) res = subnet
- }
- if (res != null) return res
- if (site2subnet[site] == null) site2subnet[site] = [] as Set
- site2subnet[site] += "${IpUtils.mask(IpUtils.toInetAddress(ip),29)}/29".substring(1)
- return "$ip not in any $site subnets"
- }
def both_local(from,to) {
if (tenants[from] == null || tenants[from].type != "opendcae-local-ntc") return false
if (tenants[to] == null || tenants[to].type != "opendcae-local-ntc") return false
diff --git a/dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/GenControllerConfiguration.groovy b/dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/GenControllerConfiguration.groovy
index 6277ab7..c40c583 100644
--- a/dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/GenControllerConfiguration.groovy
+++ b/dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/GenControllerConfiguration.groovy
@@ -580,12 +580,8 @@ class GenControllerConfiguration extends DocUtils {
}
def createEforc() {
- def x = platformConfig.eforc()
- saveYaml("/eforc",x.m,"general")
saveYaml("/dns",platformConfig.dns(),"general")
saveYaml("/ssl",platformConfig.ssl(),"general")
- saveTable("/eforc-table",x.list,"general")
- saveTable("/eforc-subnet-table",x.list2,"general")
saveYaml("/flavors",platformConfig.showFlavors(),"general")
}
diff --git a/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/DcaeControllerClusterProvider.java b/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/DcaeControllerClusterProvider.java
index ab1cff1..b751d96 100644
--- a/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/DcaeControllerClusterProvider.java
+++ b/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/DcaeControllerClusterProvider.java
@@ -38,6 +38,7 @@ import org.json.JSONObject;
import org.openecomp.ncomp.sirius.manager.BasicAdaptorProvider;
import org.openecomp.ncomp.sirius.manager.logging.NcompLogger;
import org.openecomp.ncomp.sirius.manager.metrics.MetricManager;
+import org.openecomp.ncomp.utils.SecurityUtils;
import org.openecomp.ncomp.webservice.utils.DateUtils;
import org.openecomp.dcae.controller.core.server.DcaeBasicServer;
import org.openecomp.dcae.controller.platform.controller.ControllerCluster;
@@ -149,7 +150,7 @@ public class DcaeControllerClusterProvider extends BasicAdaptorProvider implemen
public void start() {
// System.out.println("CLUSTER: start");
try {
- String hostname = InetAddress.getLocalHost().getHostName();
+ String hostname = SecurityUtils.getHostName();
if (hostname.indexOf(".") > 0)
hostname = hostname.substring(0, hostname.indexOf("."));
o.setMyServerName(hostname);
@@ -168,7 +169,7 @@ public class DcaeControllerClusterProvider extends BasicAdaptorProvider implemen
}
}
}
- } catch (UnknownHostException e) {
+ } catch (Exception e) {
e.printStackTrace();
}
// System.out.println("CLUSTER: start");
diff --git a/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/DcaeDcaePlatformControllerProvider.java b/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/DcaeDcaePlatformControllerProvider.java
index fe8a37f..79b26f2 100644
--- a/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/DcaeDcaePlatformControllerProvider.java
+++ b/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/DcaeDcaePlatformControllerProvider.java
@@ -273,6 +273,7 @@ public class DcaeDcaePlatformControllerProvider extends BasicManagementServerPro
o.setInventory(inv);
}
inv.poll();
+ inv.updateConfiguration();
ecomplogger.recordAuditEventEnd();
} catch (Exception e) {
ecomplogger.warn(DcaeControllerMessageEnum.INVENTORY_POLLING_FAILED, e.toString());
@@ -615,16 +616,14 @@ public class DcaeDcaePlatformControllerProvider extends BasicManagementServerPro
for (Iterator<String> i = pub.keys(); i.hasNext();) {
String k = i.next();
JSONObject json1 = pub.getJSONObject(k);
- if (!k.startsWith("external")) {
- String user = "dcae";
- if (json1.has("dcaeLocationName"))
- user = json1.getString("dcaeLocationName");
- json1.put("username", user);
+ String user = "dcae";
+ if (json1.has("dcaeLocationName") && ! json1.getString("dcaeLocationName").equals("notSpecified") )
+ user = json1.getString("dcaeLocationName");
+ json1.put("username", user);
+ if (json1.has("userpwd"))
+ json1.put("userpwd", JavaHttpClient.decryptPassword(json1.getString("userpwd")));
+ else
json1.put("userpwd", password());
- } else {
- if (json1.has("userpwd"))
- json1.put("userpwd", JavaHttpClient.decryptPassword(json1.getString("userpwd")));
- }
if (json1.has("localStreamId"))
json1.remove("localStreamId");
if (json1.has("feedId"))
@@ -716,17 +715,18 @@ public class DcaeDcaePlatformControllerProvider extends BasicManagementServerPro
} catch (Exception e) {
numberOfErrors++;
feed.setFeedName("ERROR: " + e.toString());
+ e.printStackTrace();
}
}
private void encryptPasswords(DatabusStreamFeed feed) {
for (DatabusStreamFeedPublisher p : feed.getPublishers()) {
- if (p.getUserpwd().startsWith("rsa:"))
+ if (p.getUserpwd() == null || p.getUserpwd().startsWith("rsa:"))
continue;
p.setUserpwd(encryptPassword(p.getUserpwd()));
}
for (DatabusStreamFeedSubscriber s : feed.getSubscribers()) {
- if (s.getUserpwd().startsWith("rsa:"))
+ if (s.getUserpwd() == null || s.getUserpwd().startsWith("rsa:"))
continue;
s.setUserpwd(encryptPassword(s.getUserpwd()));
}
@@ -1024,12 +1024,13 @@ public class DcaeDcaePlatformControllerProvider extends BasicManagementServerPro
System.out.println("PPPPPPPPPPP 1.1: " + c1.toString(2));
continue;
}
- if (!uuid.equals(newConfig.getString("uuid").toLowerCase()))
+ if (!uuid.equalsIgnoreCase(newConfig.getString("uuid")))
continue;
a.put(c1);
}
+ default:
+ throw new RuntimeException("Unknown Policy match type: " + matchingType);
}
-
switch (a.length()) {
case 0:
System.out.println("PPPPPPPPPPP 0 no policies: " + matchPolicyName + " " + uuid);
@@ -1078,13 +1079,13 @@ public class DcaeDcaePlatformControllerProvider extends BasicManagementServerPro
}
}
- private JSONObject cleanJson(EObject o2) {
+ public static JSONObject cleanJson(EObject o2) {
JSONObject json = ManagementServer.ecore2json(o2, 1000, null, true);
removeLastChanged(json);
return json;
}
- private void removeLastChanged(Object o) {
+ private static void removeLastChanged(Object o) {
if (o instanceof JSONObject) {
JSONObject json = (JSONObject) o;
json.remove("lastChanged");
@@ -1123,7 +1124,7 @@ public class DcaeDcaePlatformControllerProvider extends BasicManagementServerPro
throw new RuntimeException("unknown service instance: " + i);
}
- protected EList<? extends DcaeServiceInstance> instances(DcaeService s) {
+ public static EList<? extends DcaeServiceInstance> instances(DcaeService s) {
if (s instanceof VirtualMachineService) {
VirtualMachineService s1 = (VirtualMachineService) s;
return s1.getInstances();
diff --git a/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryProvider.java b/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryProvider.java
index ba6f379..5165653 100644
--- a/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryProvider.java
+++ b/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryProvider.java
@@ -24,6 +24,8 @@ package org.openecomp.dcae.controller.platform.servers.controller.inventory;
import org.openecomp.ncomp.sirius.manager.ISiriusServer;
import org.openecomp.ncomp.sirius.manager.JavaHttpClient;
import org.openecomp.ncomp.sirius.manager.ManagementServer;
+import org.openecomp.ncomp.sirius.manager.console.Utils;
+import org.yaml.snakeyaml.Yaml;
import java.util.ArrayList;
import java.util.HashMap;
@@ -33,11 +35,14 @@ import java.util.List;
import org.apache.log4j.Logger;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
import org.json.JSONArray;
import org.json.JSONObject;
import org.mvel2.optimizers.impl.refl.nodes.ArrayLength;
+import org.openecomp.ncomp.core.DeploymentStatus;
import org.openecomp.ncomp.sirius.manager.BasicAdaptorProvider;
-
+import org.openecomp.dcae.controller.core.service.DcaeService;
+import org.openecomp.dcae.controller.core.service.DcaeServiceInstance;
import org.openecomp.dcae.controller.inventory.ApiResponseMessage;
import org.openecomp.dcae.controller.inventory.DCAEService;
import org.openecomp.dcae.controller.inventory.DCAEServiceGroupByResults;
@@ -46,10 +51,18 @@ import org.openecomp.dcae.controller.inventory.DCAEServiceType;
import org.openecomp.dcae.controller.inventory.DCAEServiceTypeRequest;
import org.openecomp.dcae.controller.inventory.DcaeInventory;
import org.openecomp.dcae.controller.inventory.DcaeServiceTypeResults;
+import org.openecomp.dcae.controller.inventory.InventoryConfigurationRule;
import org.openecomp.dcae.controller.inventory.InventoryPackage;
import org.openecomp.dcae.controller.inventory.Link;
+import org.openecomp.dcae.controller.platform.controller.DcaePlatformController;
+import org.openecomp.dcae.controller.service.cdap.CdapService;
+import org.openecomp.dcae.controller.service.cdap.CdapServiceInstance;
+import org.openecomp.dcae.controller.service.docker.DockerService;
+import org.openecomp.dcae.controller.service.vm.VirtualMachineService;
import org.openecomp.dcae.controller.inventory.DcaeServiceResults;
+import static org.openecomp.dcae.controller.platform.servers.controller.DcaeDcaePlatformControllerProvider.*;
+
public class DcaeDcaeInventoryProvider extends BasicAdaptorProvider {
private static final Logger logger = Logger.getLogger(DcaeDcaeInventoryProvider.class);
DcaeInventory o;
@@ -71,7 +84,7 @@ public class DcaeDcaeInventoryProvider extends BasicAdaptorProvider {
// TODO handle parameters, but for now only use is complete dump
addQuery(query,"offset", offset);
JSONObject json = client.httpJsonTransaction("/dcae-service-types" + queryUrl(query), "GET", headers, null);
- System.err.println(json.toString(2));
+// System.out.println(json.toString(2));
JSONArray items = json.getJSONArray("items");
for (int i = 0; i < items.length(); i++) {
JSONObject item = items.getJSONObject(i);
@@ -112,7 +125,7 @@ public class DcaeDcaeInventoryProvider extends BasicAdaptorProvider {
// TODO handle parameters, but for now only use is complete dump
addQuery(query,"offset", offset);
JSONObject json = client.httpJsonTransaction("/dcae-services" + queryUrl(query), "GET", headers, null);
- System.err.println(json.toString(2));
+// System.out.println(json.toString(2));
JSONArray items = json.getJSONArray("items");
for (int i = 0; i < items.length(); i++) {
JSONObject item = items.getJSONObject(i);
@@ -220,7 +233,7 @@ public class DcaeDcaeInventoryProvider extends BasicAdaptorProvider {
o.getServiceTypes().addAll(s.getItems());
offset = offset(s.getLinks());
}
- System.out.println(ManagementServer.ecore2json(o, 1000, null, true).toString(2));
+// System.out.println(ManagementServer.ecore2json(o, 1000, null, true).toString(2));
}
private int offset(EList<Link> links) {
@@ -231,4 +244,122 @@ public class DcaeDcaeInventoryProvider extends BasicAdaptorProvider {
}
return -1;
}
+
+
+ public void updateConfiguration() {
+ System.out.println("BBBBBBB: updateConfiguration");
+ DcaePlatformController root = (DcaePlatformController) controller.getServer().getObject();
+ for (DcaeService s : root.getServices()) {
+ for (DcaeServiceInstance i : instances(s)) {
+ if (! ( i instanceof CdapServiceInstance)) continue;
+ CdapServiceInstance i1 = (CdapServiceInstance) i;
+ for (InventoryConfigurationRule r : o.getRules()) {
+ try {
+ if (r.getServiceNameMatch() != null && ! r.getServiceNameMatch().equals(s.getName())) continue;
+ if (r.getInstanceNameMatch() != null && ! r.getInstanceNameMatch().equals(i.getName())) continue;
+ JSONObject json = findBluePrint(r);
+ System.out.println("BBBBBBB: updateConfiguration " + s.getName() + " " + i.getName() + " " + r + " " + (json ==null ? "NULL" : json.toString(2)));
+ if (json == null) {
+ System.out.println("BBBBBBB: NULL");
+ continue;
+ }
+ EObject oo = controller.getServer().json2ecore(i1.getConfiguration().eClass(), json);
+ JSONObject before = cleanJson(i1.getConfiguration());
+ ManagementServer.merge(i1.getConfiguration(), oo, json, true, null);
+ JSONObject after = cleanJson(i1.getConfiguration());
+ System.out.println("BBBBBBB before: " + before.toString(2));
+ System.out.println("BBBBBBB after: " + after.toString(2));
+ System.out.println("BBBBBBB equal: " + !before.toString(2).equals(after.toString(2)));
+ if (!before.toString(2).equals(after.toString(2))) {
+ System.out.println("BBBBBBB before: " + before.toString(2));
+ System.out.println("BBBBBBB after: " + after.toString(2));
+ if (i.getStatus() == DeploymentStatus.DEPLOYED)
+ s.pushManagerConfiguration(i.getName());
+ }
+ }
+ catch (Exception e) {
+ e.printStackTrace(System.out);
+ System.out.println("BBBBBBB: error "+ s.getName() + " " + i.getName() + " " + e);
+ }
+ }
+ }
+ }
+ }
+
+ private JSONObject findBluePrint(InventoryConfigurationRule r) {
+ DCAEServiceType t = null;
+ int version = -1;
+ for (DCAEServiceType t1 : o.getServiceTypes()) {
+ System.out.println("BBBBBBB: type match: " + t1.getTypeName() + " " + r.getTypeNameMatch());
+ if (t1.getTypeName() == null) continue;
+ if ( ! t1.getTypeName().equals(r.getTypeNameMatch())) continue;
+ System.out.println("BBBBBBB: type version: " + t1.getTypeVersion() + " " + version);
+ if (t1.getTypeVersion() != null && version > t1.getTypeVersion()) continue;
+ System.out.println("BBBBBBB: type match found: " + t1.getTypeName());
+ t = t1;
+ }
+ if (t == null) {
+ System.out.println("BBBBBBB: no type for: " + r.getServiceNameMatch());
+ return null;
+ }
+ JSONObject bp;
+ try {
+ System.out.println("BBBBBBB: bp 1=" );
+ Yaml y = new Yaml();
+ System.out.println("BBBBBBB: bp 2=");
+ bp = (JSONObject) Utils.object2json(y.load(t.getBlueprintTemplate()));
+ System.out.println("BBBBBBB: bp 3=");
+ System.out.println("BBBBBBB: bp=" + bp.toString(2));
+ JSONObject topology_template = getJSONObject(bp,"topology_template");
+ JSONObject node_templates = getJSONObject(topology_template,"node_templates");
+ JSONObject node = null;
+ for (Iterator<String> i = node_templates.keys(); i.hasNext();) {
+ String type = (String) i.next();
+ System.out.println("BBBBBBB: node: " + type);
+ if (type.matches(r.getBpNodeNameMatch())) node = getJSONObject(node_templates,type);
+ }
+ if (node == null) {
+ System.out.println("BBBBBBB: no node for: " + r.getBpNodeNameMatch());
+ return null;
+ }
+ JSONObject p = getJSONObject(node,"properties");
+ JSONObject app_preferences = getJSONObject(p ,"app_preferences");
+ System.out.println("BBBBBBB: app_preferences=" + app_preferences.toString(2));
+ JSONObject json = new JSONObject();
+ for (Iterator<String> i = app_preferences.keys(); i.hasNext();) {
+ String path = (String) i.next();
+ String a[] = path.split("\\.");
+ try {
+ updateJson(json,a,0, app_preferences.get(path));
+ }
+ catch (Exception e) {};
+ }
+ System.out.println("BBBBBBB: fixed value: " + json.toString(2));
+ return json;
+ }
+ catch (Exception e) {
+ e.printStackTrace(System.out);
+ System.out.println("BBBBBBB: bp error=" + e);
+ return null;
+ }
+ }
+
+ private void updateJson(JSONObject json, String[] a, int i, Object v) {
+ if (i == a.length - 1) {
+ json.put(a[i], v);
+ }
+ else {
+ if (! json.has(a[i]))
+ json.put(a[i], new JSONObject());
+ updateJson(json.getJSONObject(a[i]), a, i+1, v);
+ }
+ }
+
+ private JSONObject getJSONObject(JSONObject json, String key) {
+ if (json.has(key)) return json.getJSONObject(key);
+ System.out.println("BBBBBBB: json does not have key =" + json.toString(2) + " " + key);
+ throw new RuntimeException("Unable to find: " + key);
+ }
+
+
}
diff --git a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/DcaeInventory.yaml b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/DcaeInventory.yaml
index 6584d46..19c6769 100644
--- a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/DcaeInventory.yaml
+++ b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/DcaeInventory.yaml
@@ -9,6 +9,7 @@ operations:
DcaeInventory@getDcaeServicesService: {}
DcaeInventory@createDcaeServicesService: {}
DcaeInventory@poll: {}
+ DcaeInventory@updateConfiguration: {}
messages:
dummy: {}
REQUEST-FAILED-getDcaeServiceTypes:
@@ -51,6 +52,10 @@ messages:
errorCode: 4001W
messageFormat: '{0}'
description: Operation Failed with Exception
+ REQUEST-FAILED-updateConfiguration:
+ errorCode: 4001W
+ messageFormat: '{0}'
+ description: Operation Failed with Exception
REMOTE-CALL-FAILED-getDcaeServiceTypes:
errorCode: 4001W
messageFormat: '{0}'
@@ -91,3 +96,7 @@ messages:
errorCode: 4001W
messageFormat: '{0}'
description: Remote Operation Failed with Exception
+ REMOTE-CALL-FAILED-updateConfiguration:
+ errorCode: 4001W
+ messageFormat: '{0}'
+ description: Remote Operation Failed with Exception
diff --git a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventory.java b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventory.java
index 3d41661..498ab56 100644
--- a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventory.java
+++ b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventory.java
@@ -352,6 +352,34 @@ public class DcaeDcaeInventory extends DcaeInventoryImpl implements ISiriusProvi
}
+ public void updateConfiguration() {
+
+ long duration_ = 0;
+ if (server != null)
+ server.getServer().recordApi(null, this, "updateConfiguration", ApiRequestStatus.START, duration_);
+ Date now_ = new Date();
+ ecomplogger.recordAuditEventStartIfNeeded(DcaeInventoryOperationEnum.DcaeInventory_updateConfiguration,server,this);
+ ecomplogger.recordMetricEventStart(DcaeInventoryOperationEnum.DcaeInventory_updateConfiguration,"self:" + ManagementServer.object2ref(this));
+ try {
+ controller.updateConfiguration();
+ }
+ catch (Exception e) {
+ duration_ = new Date().getTime()-now_.getTime();
+ if (server != null)
+ server.getServer().recordApi(null, this, "updateConfiguration", ApiRequestStatus.ERROR, duration_);
+ System.err.println("ERROR: " + e);
+ ecomplogger.warn(DcaeInventoryMessageEnum.REQUEST_FAILED_updateConfiguration, e.toString());
+ EcompException e1 = EcompException.create(DcaeInventoryMessageEnum.REQUEST_FAILED_updateConfiguration,e,e.getMessage());
+ ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DcaeInventoryMessageEnum.REQUEST_FAILED_updateConfiguration, e.getMessage());
+ throw e1;
+ }
+ ecomplogger.recordMetricEventEnd();
+ duration_ = new Date().getTime()-now_.getTime();
+ if (server != null)
+ server.getServer().recordApi(null, this, "updateConfiguration", ApiRequestStatus.OKAY, duration_);
+
+ }
+
diff --git a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryClient.java b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryClient.java
index 7d39e55..46c0b31 100644
--- a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryClient.java
+++ b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryClient.java
@@ -255,4 +255,22 @@ public class DcaeDcaeInventoryClient extends DcaeInventoryImpl {
}
+ @Override
+ public void updateConfiguration() {
+ EClass c = InventoryPackage.eINSTANCE.getDcaeInventory();
+ ecomplogger.recordMetricEventStart(DcaeInventoryOperationEnum.DcaeInventory_updateConfiguration,client.getRemote());
+
+ try {
+ client.operationPath("/inventory", c, "updateConfiguration", null);
+ }
+ catch (Exception e) {
+ ecomplogger.warn(DcaeInventoryMessageEnum.REMOTE_CALL_FAILED_updateConfiguration, e.toString());
+ EcompException e1 = EcompException.create(DcaeInventoryMessageEnum.REMOTE_CALL_FAILED_updateConfiguration,e,e.getMessage());
+ ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DcaeInventoryMessageEnum.REMOTE_CALL_FAILED_updateConfiguration,e.getMessage());
+ throw e1;
+ }
+ ecomplogger.recordMetricEventEnd();
+
+ }
+
}
diff --git a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryConsole.java b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryConsole.java
index 6ff8ba7..4259fef 100644
--- a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryConsole.java
+++ b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryConsole.java
@@ -164,4 +164,15 @@ public class DcaeDcaeInventoryConsole extends Console {
}
+ public void updateConfiguration() {
+
+ try {
+ controller.updateConfiguration();
+ }
+ catch (ManagementServerError e) {
+ System.err.println("ERROR: " + e.getJson().toString(2));
+ }
+
+ }
+
}
diff --git a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryProviderTemplate.java b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryProviderTemplate.java
index bfdb66b..dc711a1 100644
--- a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryProviderTemplate.java
+++ b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryProviderTemplate.java
@@ -115,6 +115,12 @@ public class DcaeDcaeInventoryProviderTemplate extends BasicAdaptorProvider {
throw new UnsupportedOperationException();
}
+ public void updateConfiguration() {
+
+ // TODO IMPLEMENT
+ throw new UnsupportedOperationException();
+ }
+
diff --git a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventory.properties b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventory.properties
index 911d8ac..cbba0ed 100644
--- a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventory.properties
+++ b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventory.properties
@@ -65,6 +65,12 @@ REQUEST_FAILED_poll=\
null|\
Operation Failed with Exception
+REQUEST_FAILED_updateConfiguration=\
+ REQUEST-FAILED-updateConfiguration-4001W|\
+ {0}|\
+ null|\
+ Operation Failed with Exception
+
REMOTE_CALL_FAILED_getDcaeServiceTypes=\
REMOTE-CALL-FAILED-getDcaeServiceTypes-4001W|\
{0}|\
@@ -124,3 +130,9 @@ REMOTE_CALL_FAILED_poll=\
{0}|\
null|\
Remote Operation Failed with Exception
+
+REMOTE_CALL_FAILED_updateConfiguration=\
+ REMOTE-CALL-FAILED-updateConfiguration-4001W|\
+ {0}|\
+ null|\
+ Remote Operation Failed with Exception
diff --git a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventoryMessageEnum.java b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventoryMessageEnum.java
index 460ac99..5fe1877 100644
--- a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventoryMessageEnum.java
+++ b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventoryMessageEnum.java
@@ -17,6 +17,7 @@ public enum DcaeInventoryMessageEnum implements EcompMessageEnum {
REQUEST_FAILED_getDcaeServicesService,
REQUEST_FAILED_createDcaeServicesService,
REQUEST_FAILED_poll,
+ REQUEST_FAILED_updateConfiguration,
REMOTE_CALL_FAILED_getDcaeServiceTypes,
REMOTE_CALL_FAILED_deleteDcaeServiceTypesType,
REMOTE_CALL_FAILED_getDcaeServiceTypesType,
@@ -26,7 +27,8 @@ public enum DcaeInventoryMessageEnum implements EcompMessageEnum {
REMOTE_CALL_FAILED_deleteDcaeServicesService,
REMOTE_CALL_FAILED_getDcaeServicesService,
REMOTE_CALL_FAILED_createDcaeServicesService,
- REMOTE_CALL_FAILED_poll;
+ REMOTE_CALL_FAILED_poll,
+ REMOTE_CALL_FAILED_updateConfiguration;
static {
EELFResourceManager.loadMessageBundle("org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventory");
diff --git a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventoryOperationEnum.java b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventoryOperationEnum.java
index 920dfb4..9191fba 100644
--- a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventoryOperationEnum.java
+++ b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/inventory/logging/DcaeInventoryOperationEnum.java
@@ -14,7 +14,8 @@ public enum DcaeInventoryOperationEnum implements EcompOperationEnum {
DcaeInventory_deleteDcaeServicesService("DcaeInventory@deleteDcaeServicesService"),
DcaeInventory_getDcaeServicesService("DcaeInventory@getDcaeServicesService"),
DcaeInventory_createDcaeServicesService("DcaeInventory@createDcaeServicesService"),
- DcaeInventory_poll("DcaeInventory@poll") ;
+ DcaeInventory_poll("DcaeInventory@poll"),
+ DcaeInventory_updateConfiguration("DcaeInventory@updateConfiguration") ;
private String n;