diff options
author | Carsten Lund <lund@research.att.com> | 2017-06-09 16:36:17 +0000 |
---|---|---|
committer | Carsten Lund <lund@research.att.com> | 2017-06-09 16:36:17 +0000 |
commit | 50ddefb52b2cd90bf762a4e0c1f36752f7589053 (patch) | |
tree | 7ee23832266cf11f0254e87895dd34c533093b73 | |
parent | b4d78b8b553483a5b38d3aa81ff81fa04b057fd2 (diff) |
[DCAE-15] Final update for rebased code.
Change-Id: I99532ff4415c2da2271116adc694c39313f30d65
Signed-off-by: Carsten Lund <lund@research.att.com>
53 files changed, 1986 insertions, 743 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; diff --git a/dcae-controller-service-cdap/dcae-controller-service-cdap-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/cdap/DcaeCdapServiceProvider.java b/dcae-controller-service-cdap/dcae-controller-service-cdap-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/cdap/DcaeCdapServiceProvider.java index aa0ad80..186e03f 100644 --- a/dcae-controller-service-cdap/dcae-controller-service-cdap-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/cdap/DcaeCdapServiceProvider.java +++ b/dcae-controller-service-cdap/dcae-controller-service-cdap-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/cdap/DcaeCdapServiceProvider.java @@ -43,6 +43,8 @@ import org.openecomp.dcae.controller.service.cdap.CdapApplication; import org.openecomp.dcae.controller.service.cdap.CdapArtifact; import org.openecomp.dcae.controller.service.cdap.CdapCreateAppStep; import org.openecomp.dcae.controller.service.cdap.CdapCreateAppWithConfigStep; +import org.openecomp.dcae.controller.service.cdap.CdapDeleteAppStep; +import org.openecomp.dcae.controller.service.cdap.CdapDeleteArtifact; import org.openecomp.dcae.controller.service.cdap.CdapDeployAppStep; import org.openecomp.dcae.controller.service.cdap.CdapFactory; import org.openecomp.dcae.controller.service.cdap.CdapInternalApplicationConfiguration; @@ -60,6 +62,7 @@ import org.openecomp.dcae.controller.service.cdap.CdapStopAppStep; import org.openecomp.dcae.controller.service.cdap.CdapStopFlowStep; import org.openecomp.dcae.controller.service.cdap.CdapStopServiceStep; import org.openecomp.dcae.controller.service.cdap.CdapStopWorkerStep; +import org.openecomp.dcae.controller.service.cdap.CdapSuspendScheduleStep; import org.openecomp.dcae.controller.service.cdap.cluster.servers.manager.DcaeCdapClusterManagerConsole; import org.openecomp.dcae.controller.service.cdap.cluster.servers.service.DcaeCdapClusterService; import org.openecomp.dcae.controller.service.cdap.cluster.servers.service.DcaeCdapClusterServiceProvider; @@ -98,7 +101,7 @@ public class DcaeCdapServiceProvider extends BasicAdaptorProvider { throw new RuntimeException("Unable to find container object: " + containerPath); } if (!(s.o instanceof CdapClusterServiceInstance)) - throw new RuntimeException("Unable to deploy to this container: " + s.o); + throw new RuntimeException("Unable to deploy to this non cdap cluster container: " + containerPath); i.setClusterService((CdapClusterServiceInstance) s.o); } i.setCdapName(cdapName(i)); @@ -190,7 +193,7 @@ public class DcaeCdapServiceProvider extends BasicAdaptorProvider { } if (s instanceof CdapStopAppStep) { CdapStopAppStep s1 = (CdapStopAppStep) s; - console.stopApp(i.getCdapName(), s1.getAppId()); + console.stopApp(i.getCdapName(), s1.getAppId(),s1.getProgramTypes()); continue; } if (s instanceof CdapStopFlowStep) { @@ -213,6 +216,22 @@ public class DcaeCdapServiceProvider extends BasicAdaptorProvider { console.resumeSchedule(i.getCdapName(), s1.getAppId(), s1.getScheduleId()); continue; } + if (s instanceof CdapDeleteAppStep) { + CdapDeleteAppStep s1 = (CdapDeleteAppStep) s; + console.deleteApp(i.getCdapName(), s1.getAppId()); + continue; + } + if (s instanceof CdapDeleteArtifact) { + CdapDeleteArtifact s1 = (CdapDeleteArtifact) s; + console.deleteArtifact(i.getCdapName(), s1.getArtifactName(),s1.getVersion()); + continue; + } + if (s instanceof CdapSuspendScheduleStep) { + CdapSuspendScheduleStep s1 = (CdapSuspendScheduleStep) s; + console.suspendSchedule(i.getCdapName(), s1.getAppId(),s1.getScheduleId()); + continue; + } + throw new RuntimeException("Unable to support: " + s.eClass().getName()); } } @@ -235,7 +254,7 @@ public class DcaeCdapServiceProvider extends BasicAdaptorProvider { } for (String a : i.getAppNames()) { try { - console.stopApp(i.getCdapName(), a); + console.stopApp(i.getCdapName(), a, null); } catch (Exception e) { e.printStackTrace(); } @@ -253,7 +272,7 @@ public class DcaeCdapServiceProvider extends BasicAdaptorProvider { } for (CdapApplication a : i.getApps()) { try { - console.stopApp(i.getCdapName(), a.getName()); + console.stopApp(i.getCdapName(), a.getName(), null); console.deleteApp(i.getCdapName(), a.getName()); console.deleteArtifact(i.getCdapName(), a.getArtifactName(), a.getVersion()); } catch (Exception e) { @@ -270,14 +289,14 @@ public class DcaeCdapServiceProvider extends BasicAdaptorProvider { synchronized (i) { for (CdapArtifact a : i.getArtifacts()) { try { - console.stopApp(i.getCdapName(), a.getName()); + console.stopApp(i.getCdapName(), a.getName(), null); } catch (Exception e) { e.printStackTrace(); } } for (CdapApplication a : i.getApps()) { try { - console.stopApp(i.getCdapName(), a.getName()); + console.stopApp(i.getCdapName(), a.getName(),null); } catch (Exception e) { e.printStackTrace(); } diff --git a/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/java/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerProvider.java b/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/java/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerProvider.java index 5680c6f..c27689f 100644 --- a/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/java/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerProvider.java +++ b/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/java/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerProvider.java @@ -223,8 +223,8 @@ public class DcaeCdapClusterManagerProvider extends DcaeVirtualMachineManagerPro // System.err.println(json.toString(2)); } - public String stopApp(String namespace, String appName) { - return getCluster().stopApp(namespace, appName); + public String stopApp(String namespace, String appName, String programTypes) { + return getCluster().stopApp(namespace, appName, programTypes); } public String startWorker(String namespace, String appName, diff --git a/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManager.java b/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManager.java index 9258c81..23555cd 100644 --- a/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManager.java +++ b/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManager.java @@ -818,21 +818,21 @@ public class DcaeCdapClusterManager extends CdapClusterManagerImpl implements IS return res; } - public java.lang.String stopApp(java.lang.String namespace, java.lang.String appName) { + public java.lang.String stopApp(java.lang.String namespace, java.lang.String appName, java.lang.String programTypes) { java.lang.String res = null; long duration_ = 0; if (server != null) - server.getServer().recordApi(null, this, "stopApp", ApiRequestStatus.START, duration_,namespace,appName); + server.getServer().recordApi(null, this, "stopApp", ApiRequestStatus.START, duration_,namespace,appName,programTypes); Date now_ = new Date(); ecomplogger.recordAuditEventStartIfNeeded(CdapClusterManagerOperationEnum.CdapClusterManager_stopApp,server,this); ecomplogger.recordMetricEventStart(CdapClusterManagerOperationEnum.CdapClusterManager_stopApp,"self:" + ManagementServer.object2ref(this)); try { - res = controller.stopApp(namespace,appName); + res = controller.stopApp(namespace,appName,programTypes); } catch (Exception e) { duration_ = new Date().getTime()-now_.getTime(); if (server != null) - server.getServer().recordApi(null, this, "stopApp", ApiRequestStatus.ERROR, duration_,namespace,appName); + server.getServer().recordApi(null, this, "stopApp", ApiRequestStatus.ERROR, duration_,namespace,appName,programTypes); System.err.println("ERROR: " + e); ecomplogger.warn(CdapClusterManagerMessageEnum.REQUEST_FAILED_stopApp, e.toString()); EcompException e1 = EcompException.create(CdapClusterManagerMessageEnum.REQUEST_FAILED_stopApp,e,e.getMessage()); @@ -842,7 +842,7 @@ public class DcaeCdapClusterManager extends CdapClusterManagerImpl implements IS ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); if (server != null) - server.getServer().recordApi(null, this, "stopApp", ApiRequestStatus.OKAY, duration_,namespace,appName); + server.getServer().recordApi(null, this, "stopApp", ApiRequestStatus.OKAY, duration_,namespace,appName,programTypes); return res; } diff --git a/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerClient.java b/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerClient.java index fb346f4..222293a 100644 --- a/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerClient.java +++ b/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerClient.java @@ -543,12 +543,12 @@ public class DcaeCdapClusterManagerClient extends CdapClusterManagerImpl { } @Override - public java.lang.String stopApp(java.lang.String namespace, java.lang.String appName) { + public java.lang.String stopApp(java.lang.String namespace, java.lang.String appName, java.lang.String programTypes) { EClass c = ManagerPackage.eINSTANCE.getCdapClusterManager(); ecomplogger.recordMetricEventStart(CdapClusterManagerOperationEnum.CdapClusterManager_stopApp,client.getRemote()); java.lang.String res; try { - res = (java.lang.String) client.operationPath("/resources", c, "stopApp", null, namespace,appName); + res = (java.lang.String) client.operationPath("/resources", c, "stopApp", null, namespace,appName,programTypes); } catch (Exception e) { ecomplogger.warn(CdapClusterManagerMessageEnum.REMOTE_CALL_FAILED_stopApp, e.toString()); diff --git a/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerConsole.java b/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerConsole.java index 6f89203..9a34e25 100644 --- a/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerConsole.java +++ b/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerConsole.java @@ -344,10 +344,10 @@ public class DcaeCdapClusterManagerConsole extends Console { return res; } - public java.lang.String stopApp(java.lang.String namespace, java.lang.String appName) { + public java.lang.String stopApp(java.lang.String namespace, java.lang.String appName, java.lang.String programTypes) { java.lang.String res = null; try { - res = controller.stopApp(namespace,appName); + res = controller.stopApp(namespace,appName,programTypes); } catch (ManagementServerError e) { System.err.println("ERROR: " + e.getJson().toString(2)); diff --git a/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerProviderTemplate.java b/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerProviderTemplate.java index 2825ae5..b7aacb1 100644 --- a/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerProviderTemplate.java +++ b/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/cdap/cluster/servers/manager/DcaeCdapClusterManagerProviderTemplate.java @@ -124,7 +124,7 @@ public class DcaeCdapClusterManagerProviderTemplate extends DcaeVirtualMachineMa throw new UnsupportedOperationException(); } - public java.lang.String stopApp(java.lang.String namespace, java.lang.String appName) { + public java.lang.String stopApp(java.lang.String namespace, java.lang.String appName, java.lang.String programTypes) { java.lang.String res = null; // TODO IMPLEMENT throw new UnsupportedOperationException(); diff --git a/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/cluster/manager/ManagerPackage.java b/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/cluster/manager/ManagerPackage.java index 90aeb8f..99a4ca5 100644 --- a/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/cluster/manager/ManagerPackage.java +++ b/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/cluster/manager/ManagerPackage.java @@ -427,7 +427,7 @@ public interface ManagerPackage extends EPackage { * @generated * @ordered */ - int CDAP_CLUSTER_MANAGER___STOP_APP__STRING_STRING = VmmanagerPackage.VIRTUAL_MACHINE_MANAGER_OPERATION_COUNT + 10; + int CDAP_CLUSTER_MANAGER___STOP_APP__STRING_STRING_STRING = VmmanagerPackage.VIRTUAL_MACHINE_MANAGER_OPERATION_COUNT + 10; /** * The operation id for the '<em>Delete App</em>' operation. diff --git a/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/cluster/manager/impl/CdapClusterManagerImpl.java b/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/cluster/manager/impl/CdapClusterManagerImpl.java index c5710dc..bd71802 100644 --- a/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/cluster/manager/impl/CdapClusterManagerImpl.java +++ b/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/cluster/manager/impl/CdapClusterManagerImpl.java @@ -349,7 +349,7 @@ public class CdapClusterManagerImpl extends VirtualMachineManagerImpl implements * <!-- end-user-doc --> * @generated */ - public String stopApp(String namespace, String appName) { + public String stopApp(String namespace, String appName, String programTypes) { // TODO: implement this method // Ensure that you remove @generated or mark it @generated NOT throw new UnsupportedOperationException(); @@ -861,7 +861,7 @@ public class CdapClusterManagerImpl extends VirtualMachineManagerImpl implements case CdapPackage.CDAP_API___START_WORKER__STRING_STRING_STRING_STRING: return ManagerPackage.CDAP_CLUSTER_MANAGER___START_WORKER__STRING_STRING_STRING_STRING; case CdapPackage.CDAP_API___START_SERVICE__STRING_STRING_STRING_STRING: return ManagerPackage.CDAP_CLUSTER_MANAGER___START_SERVICE__STRING_STRING_STRING_STRING; case CdapPackage.CDAP_API___START_APP__STRING_STRING: return ManagerPackage.CDAP_CLUSTER_MANAGER___START_APP__STRING_STRING; - case CdapPackage.CDAP_API___STOP_APP__STRING_STRING: return ManagerPackage.CDAP_CLUSTER_MANAGER___STOP_APP__STRING_STRING; + case CdapPackage.CDAP_API___STOP_APP__STRING_STRING_STRING: return ManagerPackage.CDAP_CLUSTER_MANAGER___STOP_APP__STRING_STRING_STRING; case CdapPackage.CDAP_API___DELETE_APP__STRING_STRING: return ManagerPackage.CDAP_CLUSTER_MANAGER___DELETE_APP__STRING_STRING; case CdapPackage.CDAP_API___LOAD_PREFERENCES_APP__STRING_STRING_STRING: return ManagerPackage.CDAP_CLUSTER_MANAGER___LOAD_PREFERENCES_APP__STRING_STRING_STRING; case CdapPackage.CDAP_API___LOAD_PREFERENCES_FLOW__STRING_STRING_STRING_STRING: return ManagerPackage.CDAP_CLUSTER_MANAGER___LOAD_PREFERENCES_FLOW__STRING_STRING_STRING_STRING; @@ -926,8 +926,8 @@ public class CdapClusterManagerImpl extends VirtualMachineManagerImpl implements return startService((String)arguments.get(0), (String)arguments.get(1), (String)arguments.get(2), (String)arguments.get(3)); case ManagerPackage.CDAP_CLUSTER_MANAGER___START_APP__STRING_STRING: return startApp((String)arguments.get(0), (String)arguments.get(1)); - case ManagerPackage.CDAP_CLUSTER_MANAGER___STOP_APP__STRING_STRING: - return stopApp((String)arguments.get(0), (String)arguments.get(1)); + case ManagerPackage.CDAP_CLUSTER_MANAGER___STOP_APP__STRING_STRING_STRING: + return stopApp((String)arguments.get(0), (String)arguments.get(1), (String)arguments.get(2)); case ManagerPackage.CDAP_CLUSTER_MANAGER___DELETE_APP__STRING_STRING: return deleteApp((String)arguments.get(0), (String)arguments.get(1)); case ManagerPackage.CDAP_CLUSTER_MANAGER___LOAD_PREFERENCES_APP__STRING_STRING_STRING: diff --git a/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/CdapPackage.java b/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/CdapPackage.java index 7582421..881564e 100644 --- a/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/CdapPackage.java +++ b/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/CdapPackage.java @@ -1841,13 +1841,22 @@ public interface CdapPackage extends EPackage { int CDAP_STOP_APP_STEP__APP_ID = CDAP_STEP_FEATURE_COUNT + 0; /** + * The feature id for the '<em><b>Program Types</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CDAP_STOP_APP_STEP__PROGRAM_TYPES = CDAP_STEP_FEATURE_COUNT + 1; + + /** * The number of structural features of the '<em>Stop App Step</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int CDAP_STOP_APP_STEP_FEATURE_COUNT = CDAP_STEP_FEATURE_COUNT + 1; + int CDAP_STOP_APP_STEP_FEATURE_COUNT = CDAP_STEP_FEATURE_COUNT + 2; /** * The number of operations of the '<em>Stop App Step</em>' class. @@ -3287,6 +3296,17 @@ public interface CdapPackage extends EPackage { EAttribute getCdapStopAppStep_AppId(); /** + * Returns the meta object for the attribute '{@link org.openecomp.dcae.controller.service.cdap.CdapStopAppStep#getProgramTypes <em>Program Types</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Program Types</em>'. + * @see org.openecomp.dcae.controller.service.cdap.CdapStopAppStep#getProgramTypes() + * @see #getCdapStopAppStep() + * @generated + */ + EAttribute getCdapStopAppStep_ProgramTypes(); + + /** * Returns the meta object for class '{@link org.openecomp.dcae.controller.service.cdap.CdapStartFlowStep <em>Start Flow Step</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -4108,6 +4128,13 @@ public interface CdapPackage extends EPackage { */ EAttribute CDAP_STOP_APP_STEP__APP_ID = eINSTANCE.getCdapStopAppStep_AppId(); /** + * The meta object literal for the '<em><b>Program Types</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute CDAP_STOP_APP_STEP__PROGRAM_TYPES = eINSTANCE.getCdapStopAppStep_ProgramTypes(); + /** * The meta object literal for the '{@link org.openecomp.dcae.controller.service.cdap.impl.CdapStartFlowStepImpl <em>Start Flow Step</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/CdapStopAppStep.java b/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/CdapStopAppStep.java index e882774..3217654 100644 --- a/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/CdapStopAppStep.java +++ b/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/CdapStopAppStep.java @@ -13,6 +13,7 @@ package org.openecomp.dcae.controller.service.cdap; * </p> * <ul> * <li>{@link org.openecomp.dcae.controller.service.cdap.CdapStopAppStep#getAppId <em>App Id</em>}</li> + * <li>{@link org.openecomp.dcae.controller.service.cdap.CdapStopAppStep#getProgramTypes <em>Program Types</em>}</li> * </ul> * * @see org.openecomp.dcae.controller.service.cdap.CdapPackage#getCdapStopAppStep() @@ -46,4 +47,30 @@ public interface CdapStopAppStep extends CdapStep { */ void setAppId(String value); + /** + * Returns the value of the '<em><b>Program Types</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Program Types</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Program Types</em>' attribute. + * @see #setProgramTypes(String) + * @see org.openecomp.dcae.controller.service.cdap.CdapPackage#getCdapStopAppStep_ProgramTypes() + * @model unique="false" + * @generated + */ + String getProgramTypes(); + + /** + * Sets the value of the '{@link org.openecomp.dcae.controller.service.cdap.CdapStopAppStep#getProgramTypes <em>Program Types</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Program Types</em>' attribute. + * @see #getProgramTypes() + * @generated + */ + void setProgramTypes(String value); + } // CdapStopAppStep diff --git a/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/impl/CdapPackageImpl.java b/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/impl/CdapPackageImpl.java index d2df369..176ccaf 100644 --- a/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/impl/CdapPackageImpl.java +++ b/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/impl/CdapPackageImpl.java @@ -950,6 +950,15 @@ public class CdapPackageImpl extends EPackageImpl implements CdapPackage { * <!-- end-user-doc --> * @generated */ + public EAttribute getCdapStopAppStep_ProgramTypes() { + return (EAttribute)cdapStopAppStepEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public EClass getCdapStartFlowStep() { return cdapStartFlowStepEClass; } @@ -1285,6 +1294,7 @@ public class CdapPackageImpl extends EPackageImpl implements CdapPackage { cdapStopAppStepEClass = createEClass(CDAP_STOP_APP_STEP); createEAttribute(cdapStopAppStepEClass, CDAP_STOP_APP_STEP__APP_ID); + createEAttribute(cdapStopAppStepEClass, CDAP_STOP_APP_STEP__PROGRAM_TYPES); cdapStartFlowStepEClass = createEClass(CDAP_START_FLOW_STEP); createEAttribute(cdapStartFlowStepEClass, CDAP_START_FLOW_STEP__APP_ID); @@ -1469,6 +1479,7 @@ public class CdapPackageImpl extends EPackageImpl implements CdapPackage { initEClass(cdapStopAppStepEClass, CdapStopAppStep.class, "CdapStopAppStep", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getCdapStopAppStep_AppId(), theEcorePackage.getEString(), "appId", null, 0, 1, CdapStopAppStep.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getCdapStopAppStep_ProgramTypes(), theEcorePackage.getEString(), "programTypes", null, 0, 1, CdapStopAppStep.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(cdapStartFlowStepEClass, CdapStartFlowStep.class, "CdapStartFlowStep", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getCdapStartFlowStep_AppId(), theEcorePackage.getEString(), "appId", null, 0, 1, CdapStartFlowStep.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); diff --git a/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/impl/CdapStopAppStepImpl.java b/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/impl/CdapStopAppStepImpl.java index 90eb037..f5229d2 100644 --- a/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/impl/CdapStopAppStepImpl.java +++ b/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/cdap/impl/CdapStopAppStepImpl.java @@ -20,6 +20,7 @@ import org.openecomp.dcae.controller.service.cdap.CdapStopAppStep; * </p> * <ul> * <li>{@link org.openecomp.dcae.controller.service.cdap.impl.CdapStopAppStepImpl#getAppId <em>App Id</em>}</li> + * <li>{@link org.openecomp.dcae.controller.service.cdap.impl.CdapStopAppStepImpl#getProgramTypes <em>Program Types</em>}</li> * </ul> * * @generated @@ -46,6 +47,26 @@ public class CdapStopAppStepImpl extends CdapStepImpl implements CdapStopAppStep protected String appId = APP_ID_EDEFAULT; /** + * The default value of the '{@link #getProgramTypes() <em>Program Types</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getProgramTypes() + * @generated + * @ordered + */ + protected static final String PROGRAM_TYPES_EDEFAULT = null; + + /** + * The cached value of the '{@link #getProgramTypes() <em>Program Types</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getProgramTypes() + * @generated + * @ordered + */ + protected String programTypes = PROGRAM_TYPES_EDEFAULT; + + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -90,11 +111,34 @@ public class CdapStopAppStepImpl extends CdapStepImpl implements CdapStopAppStep * <!-- end-user-doc --> * @generated */ + public String getProgramTypes() { + return programTypes; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setProgramTypes(String newProgramTypes) { + String oldProgramTypes = programTypes; + programTypes = newProgramTypes; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CdapPackage.CDAP_STOP_APP_STEP__PROGRAM_TYPES, oldProgramTypes, programTypes)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case CdapPackage.CDAP_STOP_APP_STEP__APP_ID: return getAppId(); + case CdapPackage.CDAP_STOP_APP_STEP__PROGRAM_TYPES: + return getProgramTypes(); } return super.eGet(featureID, resolve, coreType); } @@ -110,6 +154,9 @@ public class CdapStopAppStepImpl extends CdapStepImpl implements CdapStopAppStep case CdapPackage.CDAP_STOP_APP_STEP__APP_ID: setAppId((String)newValue); return; + case CdapPackage.CDAP_STOP_APP_STEP__PROGRAM_TYPES: + setProgramTypes((String)newValue); + return; } super.eSet(featureID, newValue); } @@ -125,6 +172,9 @@ public class CdapStopAppStepImpl extends CdapStepImpl implements CdapStopAppStep case CdapPackage.CDAP_STOP_APP_STEP__APP_ID: setAppId(APP_ID_EDEFAULT); return; + case CdapPackage.CDAP_STOP_APP_STEP__PROGRAM_TYPES: + setProgramTypes(PROGRAM_TYPES_EDEFAULT); + return; } super.eUnset(featureID); } @@ -139,6 +189,8 @@ public class CdapStopAppStepImpl extends CdapStepImpl implements CdapStopAppStep switch (featureID) { case CdapPackage.CDAP_STOP_APP_STEP__APP_ID: return APP_ID_EDEFAULT == null ? appId != null : !APP_ID_EDEFAULT.equals(appId); + case CdapPackage.CDAP_STOP_APP_STEP__PROGRAM_TYPES: + return PROGRAM_TYPES_EDEFAULT == null ? programTypes != null : !PROGRAM_TYPES_EDEFAULT.equals(programTypes); } return super.eIsSet(featureID); } @@ -155,6 +207,8 @@ public class CdapStopAppStepImpl extends CdapStepImpl implements CdapStopAppStep StringBuffer result = new StringBuffer(super.toString()); result.append(" (appId: "); result.append(appId); + result.append(", programTypes: "); + result.append(programTypes); result.append(')'); return result.toString(); } diff --git a/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore/service.xcore b/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore/service.xcore index 4dd1bb3..eb5b903 100644 --- a/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore/service.xcore +++ b/dcae-controller-service-cdap/dcae-controller-service-cdap-model/src/main/xcore/service.xcore @@ -149,6 +149,7 @@ class CdapStopServiceStep extends CdapStep { class CdapStopAppStep extends CdapStep { String appId + String programTypes } class CdapStartFlowStep extends CdapStep { diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceProvider.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceProvider.java index cdfc596..883ec7b 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceProvider.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceProvider.java @@ -81,7 +81,7 @@ public class DcaeDockerServiceProvider extends BasicAdaptorProvider { throw new RuntimeException("Unable to find container object: " + containerPath); } if (!(s.o instanceof DockerHostServiceInstance)) - throw new RuntimeException("Unable to deploy to this container: " + s.o); + throw new RuntimeException("Unable to deploy to this non docker host container: " + containerPath); i.setHostService((DockerHostServiceInstance) s.o); } if (i.getHostService() == null) { @@ -239,7 +239,7 @@ public class DcaeDockerServiceProvider extends BasicAdaptorProvider { System.err.println("ZZZZZ: unencrypted pw: " + ManagementServer.object2ref(s)); continue; } - System.err.println("ZZZZZ: unknown type: " + s); + System.err.println("ZZZZZ: unknown type: " + s.getClass().getName()); } return l; } diff --git a/dcae-controller-service-vm/dcae-controller-service-common-vm/dcae-controller-service-common-vm-manager/src/main/server/bin/manager.sh b/dcae-controller-service-vm/dcae-controller-service-common-vm/dcae-controller-service-common-vm-manager/src/main/server/bin/manager.sh index 0f1cf2d..972c011 100644 --- a/dcae-controller-service-vm/dcae-controller-service-common-vm/dcae-controller-service-common-vm-manager/src/main/server/bin/manager.sh +++ b/dcae-controller-service-vm/dcae-controller-service-common-vm/dcae-controller-service-common-vm-manager/src/main/server/bin/manager.sh @@ -20,7 +20,7 @@ VMTYPE=$(ls /tmp/vm-*manager.properties | sed s/-manager.properties// | sed sx/t case $CMD1 in start) umask 022 - for jar in /opt/app/{ncomp,dcae}-*-model/lib/*jar; do cp -p $jar lib/; done +for jar in /opt/app/{ncomp,dcae}-*-{model,jars}/lib/*jar; do cp -p $jar lib/; done JVMARGS=$(cat config/manager.properties | grep JVMARGS | sed 's/[^=]*=//') $CMD $CMD1 $JVMARGS ;; diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineServiceProvider.java b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineServiceProvider.java index b5be627..2f9e39b 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineServiceProvider.java +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineServiceProvider.java @@ -110,7 +110,7 @@ public class DcaeVirtualMachineServiceProvider extends BasicAdaptorProvider { throw new RuntimeException("Unable to find container object: " + containerPath); } if (!(s.o instanceof DcaeLocation)) - throw new RuntimeException("Unable to deploy to this container: " + containerPath + " " + s.o); + throw new RuntimeException("Unable to deploy to this non location container: " + containerPath); i.setLocation((DcaeLocation) s.o); } DcaeLocation location = i.getLocation(); diff --git a/dcae-controller-service/dcae-controller-service-dmaap-drsub/dcae-controller-service-dmaap-drsub-manager/src/main/java/org/openecomp/dcae/controller/service/dmaap/drsub/servers/manager/DcaeControllerServiceDmaapDrsubManagerProvider.java b/dcae-controller-service/dcae-controller-service-dmaap-drsub/dcae-controller-service-dmaap-drsub-manager/src/main/java/org/openecomp/dcae/controller/service/dmaap/drsub/servers/manager/DcaeControllerServiceDmaapDrsubManagerProvider.java index bae905d..e2c1b9a 100644 --- a/dcae-controller-service/dcae-controller-service-dmaap-drsub/dcae-controller-service-dmaap-drsub-manager/src/main/java/org/openecomp/dcae/controller/service/dmaap/drsub/servers/manager/DcaeControllerServiceDmaapDrsubManagerProvider.java +++ b/dcae-controller-service/dcae-controller-service-dmaap-drsub/dcae-controller-service-dmaap-drsub-manager/src/main/java/org/openecomp/dcae/controller/service/dmaap/drsub/servers/manager/DcaeControllerServiceDmaapDrsubManagerProvider.java @@ -50,7 +50,7 @@ import org.apache.log4j.Logger; import org.json.JSONObject; import org.openecomp.ncomp.sirius.manager.ISiriusServer; - +import org.openecomp.ncomp.utils.SecurityUtils; import org.openecomp.dcae.controller.service.servers.vmmanager.DcaeVirtualMachineManagerProvider; import org.openecomp.dcae.controller.service.dmaap.drsub.manager.ControllerServiceDmaapDrsubManager; @@ -97,7 +97,8 @@ public class DcaeControllerServiceDmaapDrsubManagerProvider extends DcaeVirtualM String confFile = APP_HOME_ENV == null || APP_HOME_ENV == "" ? APP_HOME + "/conf/conf.json" : APP_HOME_ENV + "/conf/conf.json"; - logger.info("confFile: " + confFile); + confFile = SecurityUtils.safeFileName(confFile); + logger.info("confFile: " + p(confFile)); // save backup copy of configuration file try { @@ -135,7 +136,11 @@ public class DcaeControllerServiceDmaapDrsubManagerProvider extends DcaeVirtualM resume(); } - @Override + private String p(Object v) { + return SecurityUtils.logForcingProtection(v); + } + + @Override public void suspend() { super.suspend(); @@ -165,7 +170,7 @@ public class DcaeControllerServiceDmaapDrsubManagerProvider extends DcaeVirtualM } private void runScript(List<String> command) { - String appBin = APP_HOME_ENV; + String appBin = SecurityUtils.safeFileName(APP_HOME_ENV); if (appBin == null || appBin.equals("")) { appBin=APP_HOME; @@ -176,8 +181,8 @@ public class DcaeControllerServiceDmaapDrsubManagerProvider extends DcaeVirtualM if (cmdFile.exists()) { try { ProcessBuilder builder = new ProcessBuilder(appBin+"/"+command.get(0),command.get(1)); - logger.info("command: ["+appBin+"/"+command.get(0)+" "+command.get(1)+"]"); - System.out.println("command: ["+appBin+"/"+command.get(0)+" "+command.get(1)+"]"); + logger.info("command: ["+p(appBin)+"/"+command.get(0)+" "+command.get(1)+"]"); + System.out.println("command: ["+p(appBin)+"/"+command.get(0)+" "+command.get(1)+"]"); Process process = builder.start(); InputStream inStream = process.getInputStream(); process.waitFor(); @@ -186,7 +191,7 @@ public class DcaeControllerServiceDmaapDrsubManagerProvider extends DcaeVirtualM e.printStackTrace(); } } else { - logger.error("\""+appBin+"/"+command.get(0)+"\" does not exist."); + logger.error("\""+p(appBin)+"/"+command.get(0)+"\" does not exist."); } } } diff --git a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-manager/src/main/java/org/openecomp/dcae/controller/service/standardeventcollector/servers/manager/DcaeControllerServiceStandardeventcollectorManagerProvider.java b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-manager/src/main/java/org/openecomp/dcae/controller/service/standardeventcollector/servers/manager/DcaeControllerServiceStandardeventcollectorManagerProvider.java index 246fdca..0e5f16c 100644 --- a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-manager/src/main/java/org/openecomp/dcae/controller/service/standardeventcollector/servers/manager/DcaeControllerServiceStandardeventcollectorManagerProvider.java +++ b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-manager/src/main/java/org/openecomp/dcae/controller/service/standardeventcollector/servers/manager/DcaeControllerServiceStandardeventcollectorManagerProvider.java @@ -9,7 +9,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -18,7 +18,7 @@ * limitations under the License. * ============LICENSE_END============================================ */ - + package org.openecomp.dcae.controller.service.standardeventcollector.servers.manager; @@ -57,465 +57,464 @@ import org.openecomp.dcae.controller.core.service.impl.ServiceFactoryImpl; public class DcaeControllerServiceStandardeventcollectorManagerProvider extends DcaeDockerManagerProvider { - private static final Logger logger = Logger.getLogger(DcaeControllerServiceStandardeventcollectorManagerProvider.class); - ControllerServiceStandardeventcollectorManager o; - + private static final Logger logger = Logger.getLogger(DcaeControllerServiceStandardeventcollectorManagerProvider.class); + ControllerServiceStandardeventcollectorManager o; - private static final String DMAAP_CONFIG = "/etc/dcae/dmaap.conf"; - private static final String HP_MAIN_CONFIG = "/opt/app/VESCollector/etc/DmaapConfig.json"; + private static final String DMAAP_CONFIG = "/etc/dcae/dmaap.conf"; + private static final String HP_MAIN_CONFIG = "/opt/app/VESCollector/etc/DmaapConfig.json"; + - public DcaeControllerServiceStandardeventcollectorManagerProvider(ISiriusServer controller, ControllerServiceStandardeventcollectorManager o) { - super(controller, o); - this.o = o; - } + public DcaeControllerServiceStandardeventcollectorManagerProvider(ISiriusServer controller, ControllerServiceStandardeventcollectorManager o) { + super(controller, o); + this.o = o; + } private void executeCommand(String cmd) { // TODO Auto-generated method stub - Runtime run = Runtime.getRuntime(); - Process pr; - try { - pr = run.exec(cmd); - pr.waitFor(); - BufferedReader buf = new BufferedReader(new InputStreamReader(pr.getInputStream())); - String line = ""; - while ((line = buf.readLine()) != null) { - System.out.println("line is " +line); - System.out.println("updated the config successfully"); - } - } catch (IOException | InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + Runtime run = Runtime.getRuntime(); + Process pr; + try { + pr = run.exec(cmd); + pr.waitFor(); + BufferedReader buf = new BufferedReader(new InputStreamReader(pr.getInputStream())); + String line = ""; + while ((line = buf.readLine()) != null) { + System.out.println("line is " +line); + System.out.println("updated the config successfully"); + } + } catch (IOException | InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } - /** **/ - @Override - public HealthTestResponse test() { - super.start(); - HealthTestResponse resp = new ServiceFactoryImpl().createHealthTestResponse(); - String cmdOutput = ""; - try { - ShellCmd c = new ShellCmd("/opt/app/VESCollector/bin/VESrestfulCollector_Status.sh"); - String s = c.result(60000); - int i = s.indexOf("\n"); - System.out.println("DEBUG:HealthTestResponse i:" + i + " String S:" + s); - cmdOutput = i > 0 ? s.substring(0,i + 1) : s; - } catch (IOException | InterruptedException | TimeoutException e) { - System.out.println("HealthCheck test execution FAILED"); - // TODO Auto-generated catch block - e.printStackTrace(); - } - - System.out.println("test() VESCollecter check " + cmdOutput); - if (cmdOutput.startsWith("VESCollecter_Is_Running ")) { - resp.setStatus(HealthTestStatus.GREEN); - resp.setMessageCode("OK"); - logger.error("HealthTest: VESCollecter_Is_Running"); - System.out.println("INFO: HealthTest: VESCollecter_Is_Running"); - } else if (cmdOutput.startsWith("VESCollecter_Is_HavingError")) { - resp.setStatus(HealthTestStatus.YELLOW); - resp.setMessageCode("ERROR: VESCollecter_Is_HavingError"); - logger.error("HealthTest: VESCollecter_Is_HavingError"); - System.out.println("ERROR: HealthTest: VESCollecter_Is_HavingError"); - } else { - resp.setStatus(HealthTestStatus.RED); - resp.setMessageCode("ERROR: VESCollecter_Is_Not_Running"); - logger.error("HealthTest: VESCollecter_Is_Not_Running"); - System.out.println("ERROR: HealthTest: VESCollecter_Is_Not_Running"); - } - - return resp; - } + /** **/ + @Override + public HealthTestResponse test() { + super.start(); + HealthTestResponse resp = new ServiceFactoryImpl().createHealthTestResponse(); + String cmdOutput = ""; + try { + ShellCmd c = new ShellCmd("/opt/app/VESCollector/bin/VESrestfulCollector_Status.sh"); + String s = c.result(60000); + int i = s.indexOf("\n"); + System.out.println("DEBUG:HealthTestResponse i:" + i + " String S:" + s); + cmdOutput = i > 0 ? s.substring(0,i + 1) : s; + } catch (IOException | InterruptedException | TimeoutException e) { + System.out.println("HealthCheck test execution FAILED"); + // TODO Auto-generated catch block + e.printStackTrace(); + } + + System.out.println("test() VESCollecter check " + cmdOutput); + if (cmdOutput.startsWith("VESCollecter_Is_Running ")) { + resp.setStatus(HealthTestStatus.GREEN); + resp.setMessageCode("OK"); + logger.error("HealthTest: VESCollecter_Is_Running"); + System.out.println("INFO: HealthTest: VESCollecter_Is_Running"); + } else if (cmdOutput.startsWith("VESCollecter_Is_HavingError")) { + resp.setStatus(HealthTestStatus.YELLOW); + resp.setMessageCode("ERROR: VESCollecter_Is_HavingError"); + logger.error("HealthTest: VESCollecter_Is_HavingError"); + System.out.println("ERROR: HealthTest: VESCollecter_Is_HavingError"); + } else { + resp.setStatus(HealthTestStatus.RED); + resp.setMessageCode("ERROR: VESCollecter_Is_Not_Running"); + logger.error("HealthTest: VESCollecter_Is_Not_Running"); + System.out.println("ERROR: HealthTest: VESCollecter_Is_Not_Running"); + } + + return resp; + } @Override public void configurationChanged() { - // important to call the super methods for handling DMaaP setup. - super.configurationChanged(); - - try { - //Added to avoid timing issues and ensure dmaap.conf is updated - // by the call to super.configurationChanges before checking contents into it. - Thread.sleep(3000); - } catch (InterruptedException e) { - e.printStackTrace(); - System.out.println ("Sleep time expired"); - } - JSONArray charray = retrieveDmaapSetting(); - //System.out.println("Modified HPchannel config:" + charray); - logger.info("Modified HPchannel config: " + charray); - - JSONObject channelconfig = new JSONObject(); - channelconfig.put("channels", charray); - updateJsonToHPConfig (HP_MAIN_CONFIG, HP_MAIN_CONFIG,charray); - - //For debug purpose - //writeJsonToFile(HP_CH_CONFIG, channelconfig); - //updateJsonToHPConfig (HP_MAIN_CONFIG, HP_MAIN_CONFIG_COPY,charray); - - - //Collector port - String cport = o.getCport(); - if (cport !=null) { - String cmd=""; - cmd = "bin/VES_controller_update.sh " + "collector.service.port" +" "+ cport; - executeCommand(cmd); - } - - //Collector csecport - String csecport = o.getCsecport(); - if (csecport !=null) { - String cmd=""; - cmd = "bin/VES_controller_update.sh " + "collector.service.secure.port" +" "+ csecport; - executeCommand(cmd); - } - - //Collector keystoreloc - String keystoreloc = o.getKeystoreloc(); - if (keystoreloc !=null) { - String cmd=""; - cmd = "bin/VES_controller_update.sh " + "collector.keystore.file.location" +" "+ keystoreloc; - executeCommand(cmd); - } - - //Collector keystorepwdfile - String keystorepwdfile = o.getKeystorepwdloc(); - if (keystorepwdfile !=null) { - String cmd=""; - cmd = "bin/VES_controller_update.sh " + "collector.keystore.passwordfile" +" "+ keystorepwdfile; - executeCommand(cmd); - } - - //Collector keystorealias - String keystorealias = o.getKeystorealias(); - if (keystorealias !=null) { - String cmd=""; - cmd = "bin/VES_controller_update.sh " + "collector.keystore.alias" +" "+ keystorealias; - executeCommand(cmd); - } - //Collector maxinputqueue - String maxinputqueue = o.getCport(); - if (maxinputqueue !=null) { - String cmd=""; - cmd = "bin/VES_controller_update.sh " + "collector.inputQueue.maxPending" +" "+ maxinputqueue; - executeCommand(cmd); - } - - //checkschemaflag - String checkschemaflag = o.getCheckschemaflag(); - if (checkschemaflag != null && !checkschemaflag.equals("")) { - String cmd=""; - cmd = "bin/VES_controller_update.sh " + "collector.schema.checkflag" +" "+ checkschemaflag; - executeCommand(cmd); - - } else { - System.out.println("Schemaflag is null"); - } - - //authflag - String authflag = o.getAuthflag(); - if (authflag != null && !authflag.equals("")) { - String cmd=""; - cmd = "bin/VES_controller_update.sh " + "header.authflag" +" "+ authflag; - executeCommand(cmd); - - } else { - System.out.println("authlist is null"); - } - - //authlist - replaces authid/pwd - String authlist = o.getAuthlist(); - if (authlist != null && !authlist.equals("")) { - String cmd=""; - cmd = "bin/VES_controller_update.sh " + "header.authlist" +" "+ authlist; - executeCommand(cmd); - - } else { - System.out.println("authlist is null"); - } - - //StreamID - String streamid = o.getStreamid(); - if (streamid != null && !streamid.equals("")) { - String cmd=""; - cmd = "bin/VES_controller_update.sh " + "collector.dmaap.streamid" +" "+ streamid; - executeCommand(cmd); - } else { - System.out.println("streamid is null"); - } - - // schemafile - String schemafile = o.getSchemafile(); - if (schemafile != null && !schemafile.equals("")) { - String cmd=""; - cmd = "bin/VES_controller_update.sh " + "collector.schema.file" +" "+ schemafile; - executeCommand(cmd); - - } else { - System.out.println("Schemafile is null"); - } - - resume(); + // important to call the super methods for handling DMaaP setup. + super.configurationChanged(); + + try { + //Added to avoid timing issues and ensure dmaap.conf is updated + // by the call to super.configurationChanges before checking contents into it. + Thread.sleep(3000); + } catch (InterruptedException e) { + e.printStackTrace(); + System.out.println ("Sleep time expired"); + } + JSONArray charray = retrieveDmaapSetting(); + //System.out.println("Modified HPchannel config:" + charray); + logger.info("Modified HPchannel config: " + charray); + + JSONObject channelconfig = new JSONObject(); + channelconfig.put("channels", charray); + updateJsonToHPConfig (HP_MAIN_CONFIG, HP_MAIN_CONFIG,charray); + + //For debug purpose + //writeJsonToFile(HP_CH_CONFIG, channelconfig); + //updateJsonToHPConfig (HP_MAIN_CONFIG, HP_MAIN_CONFIG_COPY,charray); + + + //Collector port + String cport = o.getCport(); + if (cport !=null) { + String cmd=""; + cmd = "bin/VES_controller_update.sh " + "collector.service.port" +" "+ cport; + executeCommand(cmd); + } + + //Collector csecport + String csecport = o.getCsecport(); + if (csecport !=null) { + String cmd=""; + cmd = "bin/VES_controller_update.sh " + "collector.service.secure.port" +" "+ csecport; + executeCommand(cmd); + } + + //Collector keystoreloc + String keystoreloc = o.getKeystoreloc(); + if (keystoreloc !=null) { + String cmd=""; + cmd = "bin/VES_controller_update.sh " + "collector.keystore.file.location" +" "+ keystoreloc; + executeCommand(cmd); + } + + //Collector keystorepwdfile + String keystorepwdfile = o.getKeystorepwdloc(); + if (keystorepwdfile !=null) { + String cmd=""; + cmd = "bin/VES_controller_update.sh " + "collector.keystore.passwordfile" +" "+ keystorepwdfile; + executeCommand(cmd); + } + + //Collector keystorealias + String keystorealias = o.getKeystorealias(); + if (keystorealias !=null) { + String cmd=""; + cmd = "bin/VES_controller_update.sh " + "collector.keystore.alias" +" "+ keystorealias; + executeCommand(cmd); + } + //Collector maxinputqueue + String maxinputqueue = o.getCport(); + if (maxinputqueue !=null) { + String cmd=""; + cmd = "bin/VES_controller_update.sh " + "collector.inputQueue.maxPending" +" "+ maxinputqueue; + executeCommand(cmd); + } + + //checkschemaflag + String checkschemaflag = o.getCheckschemaflag(); + if (checkschemaflag != null && !checkschemaflag.equals("")) { + String cmd=""; + cmd = "bin/VES_controller_update.sh " + "collector.schema.checkflag" +" "+ checkschemaflag; + executeCommand(cmd); + + } else { + System.out.println("Schemaflag is null"); + } + + //authflag + String authflag = o.getAuthflag(); + if (authflag != null && !authflag.equals("")) { + String cmd=""; + cmd = "bin/VES_controller_update.sh " + "header.authflag" +" "+ authflag; + executeCommand(cmd); + + } else { + System.out.println("authlist is null"); + } + + //authlist - replaces authid/pwd + String authlist = o.getAuthlist(); + if (authlist != null && !authlist.equals("")) { + String cmd=""; + cmd = "bin/VES_controller_update.sh " + "header.authlist" +" "+ authlist; + executeCommand(cmd); + + } else { + System.out.println("authlist is null"); + } + + //StreamID + String streamid = o.getStreamid(); + if (streamid != null && !streamid.equals("")) { + String cmd=""; + cmd = "bin/VES_controller_update.sh " + "collector.dmaap.streamid" +" "+ streamid; + executeCommand(cmd); + } else { + System.out.println("streamid is null"); + } + + // schemafile + String schemafile = o.getSchemafile(); + if (schemafile != null && !schemafile.equals("")) { + String cmd=""; + cmd = "bin/VES_controller_update.sh " + "collector.schema.file" +" "+ schemafile; + executeCommand(cmd); + + } else { + System.out.println("Schemafile is null"); + } + + resume(); } - + private JSONArray retrieveDmaapSetting() { - String fileName = DMAAP_CONFIG; + String fileName = DMAAP_CONFIG; - File f = new File(fileName); + File f = new File(fileName); - if (!f.exists() || !f.canRead() || f.isDirectory()) { - System.out.println("faile to open file: [" + fileName + "]"); - return null; - } + if (!f.exists() || !f.canRead() || f.isDirectory()) { + System.out.println("faile to open file: [" + fileName + "]"); + return null; + } - String jsonData = readFile(fileName); - JSONArray charray = new JSONArray(); - try { - JSONObject jobj = verifyJSON(jsonData); - JSONArray jarray = jobj.getJSONArray("dmaaps"); + String jsonData = readFile(fileName); + JSONArray charray = new JSONArray(); + try { + JSONObject jobj = verifyJSON(jsonData); + JSONArray jarray = jobj.getJSONArray("dmaaps"); - for (int i = 0; i < jarray.length(); i++) { - JSONObject tmpobj = jarray.getJSONObject(i); - System.out.println("tempobj:" + tmpobj); - JSONObject hpC = buildHpChannel(tmpobj); - charray.put(hpC); - } - } catch (Exception e) { - logger.warn("Failed_To_Get_DMaaP_Configuation: " + e); - } + for (int i = 0; i < jarray.length(); i++) { + JSONObject tmpobj = jarray.getJSONObject(i); + System.out.println("tempobj:" + tmpobj); + JSONObject hpC = buildHpChannel(tmpobj); + charray.put(hpC); + } + } catch (Exception e) { + logger.warn("Failed_To_Get_DMaaP_Configuation: " + e); + } - return charray; + return charray; } private String readFile(String fileName) { - String result = ""; - BufferedReader br = null; - try { - br = new BufferedReader(new FileReader(fileName)); - StringBuilder sb = new StringBuilder(); - String line = br.readLine(); - while (line != null) { - sb.append(line); - line = br.readLine(); - } - result = "{ \"dmaaps\":" + sb.toString() + "}"; - } catch (Exception e) { - System.out.println("Failed to read file: [" + fileName + "]"); - logger.warn("Failed_To_Get_DMaaP_Configuation from file [" + fileName + "]" + e); - e.printStackTrace(); - } finally { - if (null != br) { - try { - br.close(); - } catch (Exception e) { - logger.warn("readFile().BufferedReader cannot be closed"); - } - } - } - return result; + String result = ""; + BufferedReader br = null; + try { + br = new BufferedReader(new FileReader(fileName)); + StringBuilder sb = new StringBuilder(); + String line = br.readLine(); + while (line != null) { + sb.append(line); + line = br.readLine(); + } + result = "{ \"dmaaps\":" + sb.toString() + "}"; + } catch (Exception e) { + System.out.println("Failed to read file: [" + fileName + "]"); + logger.warn("Failed_To_Get_DMaaP_Configuation from file [" + fileName + "]" + e); + e.printStackTrace(); + } finally { + if (null != br) { + try { + br.close(); + } catch (Exception e) { + logger.warn("readFile().BufferedReader cannot be closed"); + } + } + } + return result; } private JSONObject verifyJSON(String data) { - JSONObject temp; - try { - temp = new JSONObject(data); - } catch (Exception e) { - temp = null; - e.printStackTrace(); - } - return temp; + JSONObject temp; + try { + temp = new JSONObject(data); + } catch (Exception e) { + temp = null; + e.printStackTrace(); + } + return temp; } private JSONObject buildHpChannel(JSONObject tmpObj) { - - JSONObject hpC = new JSONObject(); - String hpName; - String mrType = null; // UEB: in|out DMaaP: subscribe|publish - String mrClass = "HpCambriaOutputStream";// getDmaapClass(); - String mrUrl = null; - String sType = "HTTPS"; - String mrTopic = ""; - String hpGroup = ""; - String hpInstance = "0"; - String basicUname = null; // UEB apiKey, DMaaP: dmaapUserName - String basicPwd = null; // DMaaP: dmaapPassword - String dmaapDataType = "message"; - - mrUrl = tmpObj.getString("dmaapUrl"); - String[] urlParts = dmaapUrlSplit(mrUrl); - - mrType = tmpObj.getString("dmaapAction"); - if (mrType.equals("publish")) { - mrType = "out"; - } else { - mrType = "in"; - mrClass = "HpCambriaInputStream";// getDmaapClass(); - } - - hpName = tmpObj.getString("dmaapStreamId"); - hpC.put("name", hpName); - hpC.put("type", mrType); - hpC.put("class", mrClass); - - if (tmpObj.has("dmaapUserName") && tmpObj.has("dmaapPassword") ) - { - basicPwd = tmpObj.getString("dmaapPassword"); - basicUname = tmpObj.getString("dmaapUserName"); - if (basicUname != null && !basicUname.equals("")) - { - if (basicPwd != null && !basicPwd.equals("")) - { - hpC.put("basicAuthUsername", basicUname); - hpC.put("basicAuthPassword", basicPwd); - hpC.put("cambria.connectionType", sType); - } - } - - } - - String dataTypeTmp = tmpObj.getString("dmaapDataType"); - if (!dmaapDataType.equals(dataTypeTmp)) { - System.out.println("Invalid DataType (non message) recieved" + dataTypeTmp ); - logger.warn("Invalid DataType (non message) recieved" + dataTypeTmp); - } - if (null != urlParts) { - mrUrl = urlParts[2]; - - //DCAE internal dmaap topic convention - if (urlParts[3].equals("events")) - { - mrTopic = urlParts[4]; - hpC.put("cambria.url", mrUrl); - - } - else { - //ONAP dmaap topic convention - mrTopic = urlParts[3]; - String[] hostport = mrUrl.split(":"); - hpC.put("cambria.hosts", hostport[0]); - } - - if (mrType.equals("subscribe") || mrType.equals("in")) { - if (urlParts.length > 4) { - hpGroup = urlParts[5]; - } - if (urlParts.length > 4) { - hpInstance = urlParts[6]; - } - } - } - - hpC.put("cambria.topic", mrTopic); - - if (mrType.equals("out")) { - hpC.put("stripHpId", "true"); - } else { - hpC.put("cambria.group", hpGroup); - hpC.put("cambria.instance", hpInstance); - } - - return hpC; + + JSONObject hpC = new JSONObject(); + String hpName; + String mrType = null; // UEB: in|out DMaaP: subscribe|publish + String mrClass = "HpCambriaOutputStream";// getDmaapClass(); + String mrUrl = null; + String sType = "HTTPS"; + String mrTopic = ""; + String hpGroup = ""; + String hpInstance = "0"; + String basicUname = null; // UEB apiKey, DMaaP: dmaapUserName + String basicPwd = null; // DMaaP: dmaapPassword + String dmaapDataType = "message"; + + mrUrl = tmpObj.getString("dmaapUrl"); + String[] urlParts = dmaapUrlSplit(mrUrl); + + mrType = tmpObj.getString("dmaapAction"); + if (mrType.equals("publish")) { + mrType = "out"; + } else { + mrType = "in"; + mrClass = "HpCambriaInputStream";// getDmaapClass(); + } + + hpName = tmpObj.getString("dmaapStreamId"); + hpC.put("name", hpName); + hpC.put("type", mrType); + hpC.put("class", mrClass); + + if (tmpObj.has("dmaapUserName") && tmpObj.has("dmaapPassword") ) + { + basicPwd = tmpObj.getString("dmaapPassword"); + basicUname = tmpObj.getString("dmaapUserName"); + if (basicUname != null && !basicUname.equals("")) + { + if (basicPwd != null && !basicPwd.equals("")) + { + hpC.put("basicAuthUsername", basicUname); + hpC.put("basicAuthPassword", basicPwd); + hpC.put("cambria.connectionType", sType); + } + } + + } + + String dataTypeTmp = tmpObj.getString("dmaapDataType"); + if (!dmaapDataType.equals(dataTypeTmp)) { + System.out.println("Invalid DataType (non message) recieved" + dataTypeTmp ); + logger.warn("Invalid DataType (non message) recieved" + dataTypeTmp); + } + if (null != urlParts) { + mrUrl = urlParts[2]; + + //DCAE internal dmaap topic convention + if (urlParts[3].equals("events")) + { + mrTopic = urlParts[4]; + hpC.put("cambria.url", mrUrl); + + } + else { + //ONAP dmaap topic convention + mrTopic = urlParts[3]; + String[] hostport = mrUrl.split(":"); + hpC.put("cambria.hosts", hostport[0]); + } + + if (mrType.equals("subscribe") || mrType.equals("in")) { + if (urlParts.length > 4) { + hpGroup = urlParts[5]; + } + if (urlParts.length > 4) { + hpInstance = urlParts[6]; + } + } + } + + hpC.put("cambria.topic", mrTopic); + + if (mrType.equals("out")) { + hpC.put("stripHpId", "true"); + } else { + hpC.put("cambria.group", hpGroup); + hpC.put("cambria.instance", hpInstance); + } + + return hpC; } private static void writeJsonToFile(String fileName, JSONObject obj) { - FileWriter file = null; - try { - - file = new FileWriter(fileName); - file.write(obj.toString(4)); - } catch (Exception e) { - System.out.println(" FileWriter Error: " + e); - } finally { - if (file != null) - try { - file.close(); - } catch (Exception fe) { - } - } + FileWriter file = null; + try { + + file = new FileWriter(fileName); + file.write(obj.toString(4)); + } catch (Exception e) { + System.out.println(" FileWriter Error: " + e); + } finally { + if (file != null) + try { + file.close(); + } catch (Exception fe) { + } + } } /*** - * Dmaap url structure + * Dmaap url structure * pub - https://<dmaaphostname>:<port>/events/<namespace>.<dmaapcluster>.<topic>, * sub - https://<dmaaphostname>:<port>/events/<namespace>.<dmaapcluster>.<topic>/G1/u1"; - * + * * Onap url structure * pub - http://<dmaaphostname>:<port>/<unauthenticated>.<topic>, */ private String[] dmaapUrlSplit(String dmUrl) { - String[] multUrls = dmUrl.split(","); - - StringBuffer newUrls = new StringBuffer(); - String urlParts[] = null; - for (int i = 0; i < multUrls.length; i++) { - urlParts = multUrls[i].split("/"); - if (i == 0) { - newUrls = newUrls.append(urlParts[2]); - } else { - newUrls = newUrls.append(",").append(urlParts[2]); - } - } - return urlParts; + String[] multUrls = dmUrl.split(","); + + StringBuffer newUrls = new StringBuffer(); + String urlParts[] = null; + for (int i = 0; i < multUrls.length; i++) { + urlParts = multUrls[i].split("/"); + if (i == 0) { + newUrls = newUrls.append(urlParts[2]); + } else { + newUrls = newUrls.append(",").append(urlParts[2]); + } + } + return urlParts; } private void updateJsonToHPConfig(String sourceName,String targetfile, JSONArray obj) { - String jsonData = readFile(sourceName); - JSONObject jobj = verifyJSON(jsonData); - JSONObject job = jobj.getJSONObject("dmaaps"); - - - - job.remove("channels"); - job.put("channels", obj); - writeJsonToFile(targetfile, job); - + String jsonData = readFile(sourceName); + JSONObject jobj = verifyJSON(jsonData); + JSONObject job = jobj.getJSONObject("dmaaps"); + + + + job.remove("channels"); + job.put("channels", obj); + writeJsonToFile(targetfile, job); + } + + + - - - - @Override - public void start() { - String cmd=""; - cmd = "bin/VES_controller_update.sh " + "ADMIN" +" "+ "start"; + @Override + public void start() { + String cmd=""; + cmd = "bin/VES_controller_update.sh " + "ADMIN" +" "+ "start"; executeCommand(cmd); - // TODO IMPLEMENT - // throw new UnsupportedOperationException(); - } - - @Override - public void suspend() { - String cmd=""; - cmd = "bin/VES_controller_update.sh " + "ADMIN" +" "+ "stop"; - executeCommand(cmd); - } - - @Override - public void resume() { - - String cmd=""; - cmd = "bin/VES_controller_update.sh " + "ADMIN" +" "+ "stop"; - executeCommand(cmd); - - cmd=""; - cmd = "bin/VES_controller_update.sh " + "ADMIN" +" "+ "start"; + // TODO IMPLEMENT + // throw new UnsupportedOperationException(); + } + + @Override + public void suspend() { + String cmd=""; + cmd = "bin/VES_controller_update.sh " + "ADMIN" +" "+ "stop"; + executeCommand(cmd); + } + + @Override + public void resume() { + + String cmd=""; + cmd = "bin/VES_controller_update.sh " + "ADMIN" +" "+ "stop"; + executeCommand(cmd); + + cmd=""; + cmd = "bin/VES_controller_update.sh " + "ADMIN" +" "+ "start"; executeCommand(cmd); // TODO IMPLEMENT - // throw new UnsupportedOperationException(); - } - + // throw new UnsupportedOperationException(); + } + } - diff --git a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-manager/src/main/java/org/openecomp/dcae/controller/service/standardeventcollector/servers/service/DcaeControllerServiceStandardeventcollectorServiceProvider.java b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-manager/src/main/java/org/openecomp/dcae/controller/service/standardeventcollector/servers/service/DcaeControllerServiceStandardeventcollectorServiceProvider.java index 1f1098a..f202570 100644 --- a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-manager/src/main/java/org/openecomp/dcae/controller/service/standardeventcollector/servers/service/DcaeControllerServiceStandardeventcollectorServiceProvider.java +++ b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-manager/src/main/java/org/openecomp/dcae/controller/service/standardeventcollector/servers/service/DcaeControllerServiceStandardeventcollectorServiceProvider.java @@ -45,6 +45,7 @@ import org.openecomp.dcae.controller.service.standardeventcollector.manager.Cont import org.openecomp.dcae.controller.service.standardeventcollector.manager.ManagerFactory; import org.openecomp.dcae.controller.service.standardeventcollector.service.impl.ControllerServiceStandardeventcollectorServiceImpl; import org.openecomp.dcae.controller.service.standardeventcollector.service.ControllerServiceStandardeventcollectorService; +import org.openecomp.dcae.controller.service.standardeventcollector.service.ControllerServiceStandardeventcollectorServiceInstance; public class DcaeControllerServiceStandardeventcollectorServiceProvider extends DcaeDockerServiceProvider { @@ -59,13 +60,10 @@ public class DcaeControllerServiceStandardeventcollectorServiceProvider extends @Override public EObject managerConfiguration(String instanceName) { ControllerServiceStandardeventcollectorManager o1 = ManagerFactory.eINSTANCE.createControllerServiceStandardeventcollectorManager(); - ManagementServer.copy(findInstance(instanceName),o1); + ControllerServiceStandardeventcollectorServiceInstance o2 = (ControllerServiceStandardeventcollectorServiceInstance) findInstance(instanceName); + ManagementServer.copy(o2,o1); o1.setAuthlist(JavaHttpClient.decryptEmbeddedPassword(o1.getAuthlist())); return o1; } - - - - } diff --git a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/manager/impl/ControllerServiceStandardeventcollectorManagerImpl.java b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/manager/impl/ControllerServiceStandardeventcollectorManagerImpl.java index 10c02e8..23f5b1f 100644 --- a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/manager/impl/ControllerServiceStandardeventcollectorManagerImpl.java +++ b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/manager/impl/ControllerServiceStandardeventcollectorManagerImpl.java @@ -426,6 +426,27 @@ public class ControllerServiceStandardeventcollectorManagerImpl extends DockerMa * <!-- end-user-doc --> * @generated */ + public String getAuthlist() { + return authlist; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setAuthlist(String newAuthlist) { + String oldAuthlist = authlist; + authlist = newAuthlist; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ManagerPackage.CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_MANAGER__AUTHLIST, oldAuthlist, authlist)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public String getCheckschemaflag() { return checkschemaflag; } @@ -709,18 +730,6 @@ public class ControllerServiceStandardeventcollectorManagerImpl extends DockerMa return result.toString(); } - @Override - public String getAuthlist() { - // TODO Auto-generated method stub - return null; - } - - @Override - public void setAuthlist(String value) { - // TODO Auto-generated method stub - - } - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/ControllerServiceStandardeventcollectorServiceConfiguration.java b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/ControllerServiceStandardeventcollectorServiceConfiguration.java index c664ea6..1ca05a3 100644 --- a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/ControllerServiceStandardeventcollectorServiceConfiguration.java +++ b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/ControllerServiceStandardeventcollectorServiceConfiguration.java @@ -243,6 +243,33 @@ public interface ControllerServiceStandardeventcollectorServiceConfiguration ext void setAuthflag(String value); /** + * Returns the value of the '<em><b>Authlist</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Authlist</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Authlist</em>' attribute. + * @see #setAuthlist(String) + * @see org.openecomp.dcae.controller.service.standardeventcollector.service.ServicePackage#getControllerServiceStandardeventcollectorServiceConfiguration_Authlist() + * @model unique="false" + * annotation="http://openecomp.org type='configuration'" + * @generated + */ + String getAuthlist(); + + /** + * Sets the value of the '{@link org.openecomp.dcae.controller.service.standardeventcollector.service.ControllerServiceStandardeventcollectorServiceConfiguration#getAuthlist <em>Authlist</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Authlist</em>' attribute. + * @see #getAuthlist() + * @generated + */ + void setAuthlist(String value); + + /** * Returns the value of the '<em><b>Checkschemaflag</b></em>' attribute. * <!-- begin-user-doc --> * <p> @@ -297,33 +324,6 @@ public interface ControllerServiceStandardeventcollectorServiceConfiguration ext void setSchemafile(String value); /** - * Returns the value of the '<em><b>Authlist</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Authlist</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Authlist</em>' attribute. - * @see #setAuthlist(String) - * @see org.openecomp.dcae.controller.service.standardeventcollector.service.ServicePackage#getControllerServiceStandardeventcollectorServiceConfiguration_Authlist() - * @model unique="false" - * annotation="http://openecomp.org type='configuration'" - * @generated - */ - String getAuthlist(); - - /** - * Sets the value of the '{@link org.openecomp.dcae.controller.service.standardeventcollector.service.ControllerServiceStandardeventcollectorServiceConfiguration#getAuthlist <em>Authlist</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Authlist</em>' attribute. - * @see #getAuthlist() - * @generated - */ - void setAuthlist(String value); - - /** * Returns the value of the '<em><b>Streamid</b></em>' attribute. * <!-- begin-user-doc --> * <p> diff --git a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/ServicePackage.java b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/ServicePackage.java index f5bf0fa..7078d6d 100644 --- a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/ServicePackage.java +++ b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/ServicePackage.java @@ -822,6 +822,17 @@ public interface ServicePackage extends EPackage { EAttribute getControllerServiceStandardeventcollectorServiceConfiguration_Authflag(); /** + * Returns the meta object for the attribute '{@link org.openecomp.dcae.controller.service.standardeventcollector.service.ControllerServiceStandardeventcollectorServiceConfiguration#getAuthlist <em>Authlist</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Authlist</em>'. + * @see org.openecomp.dcae.controller.service.standardeventcollector.service.ControllerServiceStandardeventcollectorServiceConfiguration#getAuthlist() + * @see #getControllerServiceStandardeventcollectorServiceConfiguration() + * @generated + */ + EAttribute getControllerServiceStandardeventcollectorServiceConfiguration_Authlist(); + + /** * Returns the meta object for the attribute '{@link org.openecomp.dcae.controller.service.standardeventcollector.service.ControllerServiceStandardeventcollectorServiceConfiguration#getCheckschemaflag <em>Checkschemaflag</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -844,17 +855,6 @@ public interface ServicePackage extends EPackage { EAttribute getControllerServiceStandardeventcollectorServiceConfiguration_Schemafile(); /** - * Returns the meta object for the attribute '{@link org.openecomp.dcae.controller.service.standardeventcollector.service.ControllerServiceStandardeventcollectorServiceConfiguration#getAuthlist <em>Authlist</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Authlist</em>'. - * @see org.openecomp.dcae.controller.service.standardeventcollector.service.ControllerServiceStandardeventcollectorServiceConfiguration#getAuthlist() - * @see #getControllerServiceStandardeventcollectorServiceConfiguration() - * @generated - */ - EAttribute getControllerServiceStandardeventcollectorServiceConfiguration_Authlist(); - - /** * Returns the meta object for the attribute '{@link org.openecomp.dcae.controller.service.standardeventcollector.service.ControllerServiceStandardeventcollectorServiceConfiguration#getStreamid <em>Streamid</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -975,28 +975,28 @@ public interface ServicePackage extends EPackage { EAttribute CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_CONFIGURATION__AUTHFLAG = eINSTANCE.getControllerServiceStandardeventcollectorServiceConfiguration_Authflag(); /** - * The meta object literal for the '<em><b>Checkschemaflag</b></em>' attribute feature. + * The meta object literal for the '<em><b>Authlist</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ - EAttribute CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_CONFIGURATION__CHECKSCHEMAFLAG = eINSTANCE.getControllerServiceStandardeventcollectorServiceConfiguration_Checkschemaflag(); + EAttribute CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_CONFIGURATION__AUTHLIST = eINSTANCE.getControllerServiceStandardeventcollectorServiceConfiguration_Authlist(); /** - * The meta object literal for the '<em><b>Schemafile</b></em>' attribute feature. + * The meta object literal for the '<em><b>Checkschemaflag</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ - EAttribute CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_CONFIGURATION__SCHEMAFILE = eINSTANCE.getControllerServiceStandardeventcollectorServiceConfiguration_Schemafile(); + EAttribute CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_CONFIGURATION__CHECKSCHEMAFLAG = eINSTANCE.getControllerServiceStandardeventcollectorServiceConfiguration_Checkschemaflag(); /** - * The meta object literal for the '<em><b>Authlist</b></em>' attribute feature. + * The meta object literal for the '<em><b>Schemafile</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ - EAttribute CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_CONFIGURATION__AUTHLIST = eINSTANCE.getControllerServiceStandardeventcollectorServiceConfiguration_Authlist(); + EAttribute CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_CONFIGURATION__SCHEMAFILE = eINSTANCE.getControllerServiceStandardeventcollectorServiceConfiguration_Schemafile(); /** * The meta object literal for the '<em><b>Streamid</b></em>' attribute feature. diff --git a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/impl/ControllerServiceStandardeventcollectorServiceConfigurationImpl.java b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/impl/ControllerServiceStandardeventcollectorServiceConfigurationImpl.java index acecfe3..4cdc1e9 100644 --- a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/impl/ControllerServiceStandardeventcollectorServiceConfigurationImpl.java +++ b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/impl/ControllerServiceStandardeventcollectorServiceConfigurationImpl.java @@ -425,8 +425,8 @@ public class ControllerServiceStandardeventcollectorServiceConfigurationImpl ext * <!-- end-user-doc --> * @generated */ - public String getCheckschemaflag() { - return checkschemaflag; + public String getAuthlist() { + return authlist; } /** @@ -434,11 +434,11 @@ public class ControllerServiceStandardeventcollectorServiceConfigurationImpl ext * <!-- end-user-doc --> * @generated */ - public void setCheckschemaflag(String newCheckschemaflag) { - String oldCheckschemaflag = checkschemaflag; - checkschemaflag = newCheckschemaflag; + public void setAuthlist(String newAuthlist) { + String oldAuthlist = authlist; + authlist = newAuthlist; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ServicePackage.CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_CONFIGURATION__CHECKSCHEMAFLAG, oldCheckschemaflag, checkschemaflag)); + eNotify(new ENotificationImpl(this, Notification.SET, ServicePackage.CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_CONFIGURATION__AUTHLIST, oldAuthlist, authlist)); } /** @@ -446,8 +446,8 @@ public class ControllerServiceStandardeventcollectorServiceConfigurationImpl ext * <!-- end-user-doc --> * @generated */ - public String getSchemafile() { - return schemafile; + public String getCheckschemaflag() { + return checkschemaflag; } /** @@ -455,11 +455,11 @@ public class ControllerServiceStandardeventcollectorServiceConfigurationImpl ext * <!-- end-user-doc --> * @generated */ - public void setSchemafile(String newSchemafile) { - String oldSchemafile = schemafile; - schemafile = newSchemafile; + public void setCheckschemaflag(String newCheckschemaflag) { + String oldCheckschemaflag = checkschemaflag; + checkschemaflag = newCheckschemaflag; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ServicePackage.CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_CONFIGURATION__SCHEMAFILE, oldSchemafile, schemafile)); + eNotify(new ENotificationImpl(this, Notification.SET, ServicePackage.CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_CONFIGURATION__CHECKSCHEMAFLAG, oldCheckschemaflag, checkschemaflag)); } /** @@ -467,8 +467,8 @@ public class ControllerServiceStandardeventcollectorServiceConfigurationImpl ext * <!-- end-user-doc --> * @generated */ - public String getAuthlist() { - return authlist; + public String getSchemafile() { + return schemafile; } /** @@ -476,11 +476,11 @@ public class ControllerServiceStandardeventcollectorServiceConfigurationImpl ext * <!-- end-user-doc --> * @generated */ - public void setAuthlist(String newAuthlist) { - String oldAuthlist = authlist; - authlist = newAuthlist; + public void setSchemafile(String newSchemafile) { + String oldSchemafile = schemafile; + schemafile = newSchemafile; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ServicePackage.CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_CONFIGURATION__AUTHLIST, oldAuthlist, authlist)); + eNotify(new ENotificationImpl(this, Notification.SET, ServicePackage.CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_CONFIGURATION__SCHEMAFILE, oldSchemafile, schemafile)); } /** diff --git a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/impl/ControllerServiceStandardeventcollectorServiceInstanceImpl.java b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/impl/ControllerServiceStandardeventcollectorServiceInstanceImpl.java index 4269ae8..c8a9d1b 100644 --- a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/impl/ControllerServiceStandardeventcollectorServiceInstanceImpl.java +++ b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/impl/ControllerServiceStandardeventcollectorServiceInstanceImpl.java @@ -426,8 +426,8 @@ public class ControllerServiceStandardeventcollectorServiceInstanceImpl extends * <!-- end-user-doc --> * @generated */ - public String getCheckschemaflag() { - return checkschemaflag; + public String getAuthlist() { + return authlist; } /** @@ -435,11 +435,11 @@ public class ControllerServiceStandardeventcollectorServiceInstanceImpl extends * <!-- end-user-doc --> * @generated */ - public void setCheckschemaflag(String newCheckschemaflag) { - String oldCheckschemaflag = checkschemaflag; - checkschemaflag = newCheckschemaflag; + public void setAuthlist(String newAuthlist) { + String oldAuthlist = authlist; + authlist = newAuthlist; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ServicePackage.CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_INSTANCE__CHECKSCHEMAFLAG, oldCheckschemaflag, checkschemaflag)); + eNotify(new ENotificationImpl(this, Notification.SET, ServicePackage.CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_INSTANCE__AUTHLIST, oldAuthlist, authlist)); } /** @@ -447,8 +447,8 @@ public class ControllerServiceStandardeventcollectorServiceInstanceImpl extends * <!-- end-user-doc --> * @generated */ - public String getSchemafile() { - return schemafile; + public String getCheckschemaflag() { + return checkschemaflag; } /** @@ -456,11 +456,11 @@ public class ControllerServiceStandardeventcollectorServiceInstanceImpl extends * <!-- end-user-doc --> * @generated */ - public void setSchemafile(String newSchemafile) { - String oldSchemafile = schemafile; - schemafile = newSchemafile; + public void setCheckschemaflag(String newCheckschemaflag) { + String oldCheckschemaflag = checkschemaflag; + checkschemaflag = newCheckschemaflag; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ServicePackage.CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_INSTANCE__SCHEMAFILE, oldSchemafile, schemafile)); + eNotify(new ENotificationImpl(this, Notification.SET, ServicePackage.CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_INSTANCE__CHECKSCHEMAFLAG, oldCheckschemaflag, checkschemaflag)); } /** @@ -468,8 +468,8 @@ public class ControllerServiceStandardeventcollectorServiceInstanceImpl extends * <!-- end-user-doc --> * @generated */ - public String getAuthlist() { - return authlist; + public String getSchemafile() { + return schemafile; } /** @@ -477,11 +477,11 @@ public class ControllerServiceStandardeventcollectorServiceInstanceImpl extends * <!-- end-user-doc --> * @generated */ - public void setAuthlist(String newAuthlist) { - String oldAuthlist = authlist; - authlist = newAuthlist; + public void setSchemafile(String newSchemafile) { + String oldSchemafile = schemafile; + schemafile = newSchemafile; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ServicePackage.CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_INSTANCE__AUTHLIST, oldAuthlist, authlist)); + eNotify(new ENotificationImpl(this, Notification.SET, ServicePackage.CONTROLLER_SERVICE_STANDARDEVENTCOLLECTOR_SERVICE_INSTANCE__SCHEMAFILE, oldSchemafile, schemafile)); } /** diff --git a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/impl/ServicePackageImpl.java b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/impl/ServicePackageImpl.java index 6ff6910..ffbb920 100644 --- a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/impl/ServicePackageImpl.java +++ b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore-gen/org/openecomp/dcae/controller/service/standardeventcollector/service/impl/ServicePackageImpl.java @@ -225,8 +225,8 @@ public class ServicePackageImpl extends EPackageImpl implements ServicePackage { * <!-- end-user-doc --> * @generated */ - public EAttribute getControllerServiceStandardeventcollectorServiceConfiguration_Checkschemaflag() { - return (EAttribute)controllerServiceStandardeventcollectorServiceConfigurationEClass.getEStructuralFeatures().get(8); + public EAttribute getControllerServiceStandardeventcollectorServiceConfiguration_Authlist() { + return (EAttribute)controllerServiceStandardeventcollectorServiceConfigurationEClass.getEStructuralFeatures().get(7); } /** @@ -234,8 +234,8 @@ public class ServicePackageImpl extends EPackageImpl implements ServicePackage { * <!-- end-user-doc --> * @generated */ - public EAttribute getControllerServiceStandardeventcollectorServiceConfiguration_Schemafile() { - return (EAttribute)controllerServiceStandardeventcollectorServiceConfigurationEClass.getEStructuralFeatures().get(9); + public EAttribute getControllerServiceStandardeventcollectorServiceConfiguration_Checkschemaflag() { + return (EAttribute)controllerServiceStandardeventcollectorServiceConfigurationEClass.getEStructuralFeatures().get(8); } /** @@ -243,8 +243,8 @@ public class ServicePackageImpl extends EPackageImpl implements ServicePackage { * <!-- end-user-doc --> * @generated */ - public EAttribute getControllerServiceStandardeventcollectorServiceConfiguration_Authlist() { - return (EAttribute)controllerServiceStandardeventcollectorServiceConfigurationEClass.getEStructuralFeatures().get(7); + public EAttribute getControllerServiceStandardeventcollectorServiceConfiguration_Schemafile() { + return (EAttribute)controllerServiceStandardeventcollectorServiceConfigurationEClass.getEStructuralFeatures().get(9); } /** diff --git a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore/service.xcore b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore/service.xcore index f63a754..4f3da9a 100644 --- a/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore/service.xcore +++ b/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/src/main/xcore/service.xcore @@ -55,7 +55,7 @@ class ControllerServiceStandardeventcollectorServiceConfiguration { @ecomp(^type = "configuration")
String authflag
@ecomp(^type = "configuration")
- String authlist
+ String authlist
@ecomp(^type = "configuration")
String checkschemaflag
@ecomp(^type = "configuration")
@@ -64,4 +64,3 @@ class ControllerServiceStandardeventcollectorServiceConfiguration { String streamid
}
-
|