From e0addf5b588a1244f9679becd90999dfcb4c3a94 Mon Sep 17 00:00:00 2001 From: "ITSERVICES\\rb7147" Date: Tue, 25 Apr 2017 11:46:00 -0400 Subject: Policy 1707 commit to LF Change-Id: Ibe6f01d92f9a434c040abb05d5386e89d675ae65 Signed-off-by: ITSERVICES\rb7147 --- ECOMP-REST/pom.xml | 21 +- .../java/org/openecomp/policy/rest/XACMLRest.java | 6 +- .../openecomp/policy/rest/XACMLRestProperties.java | 31 +- .../policy/rest/XacmlAdminAuthorization.java | 13 +- .../policy/rest/adapter/AddressGroupJson.java | 79 ++ .../openecomp/policy/rest/adapter/AddressJson.java | 52 ++ .../policy/rest/adapter/AddressMembers.java | 46 ++ .../policy/rest/adapter/AutoPushTabAdapter.java | 42 ++ .../policy/rest/adapter/ClosedLoopFaultBody.java | 280 +++++++ .../ClosedLoopFaultTriggerUISignatures.java | 44 ++ .../policy/rest/adapter/ClosedLoopPMBody.java | 133 ++++ .../rest/adapter/ClosedLoopPerformanceMetrics.java | 36 + .../policy/rest/adapter/ClosedLoopPolicy.java | 61 ++ .../rest/adapter/ClosedLoopPolicyConditions.java | 39 + .../rest/adapter/ClosedLoopPolicyStatus.java | 41 + .../policy/rest/adapter/ClosedLoopSignatures.java | 52 ++ .../policy/rest/adapter/DeletePolicyCondition.java | 38 + .../policy/rest/adapter/DeployNowJson.java | 36 + .../openecomp/policy/rest/adapter/GridData.java | 54 ++ .../policy/rest/adapter/PolicyExportAdapter.java | 36 + .../policy/rest/adapter/PolicyRestAdapter.java | 827 +++++++++++++++++++++ .../policy/rest/adapter/PrefixIPList.java | 72 ++ .../policy/rest/adapter/ServiceGroupJson.java | 79 ++ .../policy/rest/adapter/ServiceListJson.java | 107 +++ .../policy/rest/adapter/ServiceMembers.java | 48 ++ .../policy/rest/adapter/ServicesJson.java | 44 ++ .../openecomp/policy/rest/adapter/TagDefines.java | 41 + .../org/openecomp/policy/rest/adapter/Tags.java | 52 ++ .../org/openecomp/policy/rest/adapter/Term.java | 201 +++++ .../policy/rest/adapter/TermCollector.java | 141 ++++ .../policy/rest/adapter/package-info.java | 20 + .../openecomp/policy/rest/dao/ActionListDao.java | 33 - .../policy/rest/dao/ActionPolicyDictDao.java | 34 - .../openecomp/policy/rest/dao/AddressGroupDao.java | 33 - .../openecomp/policy/rest/dao/AttributeDao.java | 35 - .../policy/rest/dao/BRMSParamTemplateDao.java | 33 - .../org/openecomp/policy/rest/dao/CategoryDao.java | 29 - .../openecomp/policy/rest/dao/CommonClassDao.java | 57 ++ .../org/openecomp/policy/rest/dao/DCAEUUIDDao.java | 33 - .../policy/rest/dao/DecisionPolicyDao.java | 33 - .../policy/rest/dao/DescriptiveScopeDao.java | 35 - .../openecomp/policy/rest/dao/EcompNameDao.java | 34 - .../policy/rest/dao/EnforcerPolicyDao.java | 32 - .../policy/rest/dao/FirewallDictionaryListDao.java | 37 - .../policy/rest/dao/GroupPolicyScopeListDao.java | 34 - .../policy/rest/dao/MicroServiceConfigNameDao.java | 33 - .../policy/rest/dao/MicroServiceLocationDao.java | 33 - .../policy/rest/dao/MicroServiceModelsDao.java | 33 - .../openecomp/policy/rest/dao/PEPOptionsDao.java | 35 - .../policy/rest/dao/PolicyScopeClosedLoopDao.java | 34 - .../policy/rest/dao/PolicyScopeResourceDao.java | 34 - .../policy/rest/dao/PolicyScopeServiceDao.java | 34 - .../policy/rest/dao/PolicyScopeTypeDao.java | 34 - .../org/openecomp/policy/rest/dao/PortListDao.java | 33 - .../openecomp/policy/rest/dao/PrefixListDao.java | 33 - .../openecomp/policy/rest/dao/ProtocolListDao.java | 33 - .../org/openecomp/policy/rest/dao/RiskTypeDao.java | 34 - .../policy/rest/dao/SafePolicyWarningDao.java | 34 - .../openecomp/policy/rest/dao/SecurityZoneDao.java | 33 - .../policy/rest/dao/ServiceDictionaryDao.java | 33 - .../openecomp/policy/rest/dao/ServiceGroupDao.java | 33 - .../openecomp/policy/rest/dao/ServiceListDao.java | 34 - .../policy/rest/dao/SiteDictionaryDao.java | 33 - .../org/openecomp/policy/rest/dao/TermListDao.java | 34 - .../org/openecomp/policy/rest/dao/UserInfoDao.java | 32 - .../org/openecomp/policy/rest/dao/VNFTypeDao.java | 34 - .../openecomp/policy/rest/dao/VSCLActionDao.java | 35 - .../policy/rest/dao/VarbindDictionaryDao.java | 34 - .../org/openecomp/policy/rest/dao/ZoneDao.java | 33 - .../openecomp/policy/rest/dao/package-info.java | 6 - .../policy/rest/jpa/ActionBodyEntity.java | 3 - .../org/openecomp/policy/rest/jpa/ActionList.java | 3 - .../policy/rest/jpa/ActionPolicyDict.java | 6 +- .../openecomp/policy/rest/jpa/AddressGroup.java | 1 - .../org/openecomp/policy/rest/jpa/Attribute.java | 11 +- .../openecomp/policy/rest/jpa/BRMSController.java | 154 ++++ .../openecomp/policy/rest/jpa/BRMSDependency.java | 153 ++++ .../org/openecomp/policy/rest/jpa/Category.java | 1 - .../policy/rest/jpa/ClosedLoopD2Services.java | 8 +- .../openecomp/policy/rest/jpa/ClosedLoopSite.java | 5 +- .../org/openecomp/policy/rest/jpa/ClosedLoops.java | 99 +++ .../policy/rest/jpa/ConfigurationDataEntity.java | 3 - .../org/openecomp/policy/rest/jpa/DCAEUsers.java | 1 - .../org/openecomp/policy/rest/jpa/DCAEuuid.java | 1 - .../org/openecomp/policy/rest/jpa/Datatype.java | 1 - .../policy/rest/jpa/DecisionSettings.java | 16 +- .../policy/rest/jpa/DescriptiveScope.java | 5 +- .../org/openecomp/policy/rest/jpa/EcompName.java | 13 +- .../java/org/openecomp/policy/rest/jpa/FWTag.java | 180 +++++ .../org/openecomp/policy/rest/jpa/FWTagPicker.java | 178 +++++ .../policy/rest/jpa/FirewallDictionaryList.java | 21 - .../org/openecomp/policy/rest/jpa/GroupEntity.java | 12 +- .../policy/rest/jpa/GroupPolicyScopeList.java | 3 - .../policy/rest/jpa/GroupServiceList.java | 3 - .../policy/rest/jpa/MicroServiceAttribute.java | 109 +++ .../policy/rest/jpa/MicroServiceConfigName.java | 1 - .../policy/rest/jpa/MicroServiceLocation.java | 1 - .../policy/rest/jpa/MicroServiceModels.java | 27 +- .../policy/rest/jpa/ObadviceExpression.java | 3 - .../org/openecomp/policy/rest/jpa/PEPOptions.java | 5 +- .../policy/rest/jpa/PIPConfiguration.java | 41 +- .../org/openecomp/policy/rest/jpa/PREFIXLIST.java | 117 --- .../org/openecomp/policy/rest/jpa/PdpEntity.java | 6 - .../openecomp/policy/rest/jpa/PolicyEntity.java | 16 +- .../org/openecomp/policy/rest/jpa/PolicyRoles.java | 8 +- .../policy/rest/jpa/PolicyScopeClosedLoop.java | 1 - .../policy/rest/jpa/PolicyScopeResource.java | 1 - .../policy/rest/jpa/PolicyScopeService.java | 1 - .../openecomp/policy/rest/jpa/PolicyScopeType.java | 1 - .../org/openecomp/policy/rest/jpa/PolicyScore.java | 5 - .../openecomp/policy/rest/jpa/PolicyVersion.java | 3 +- .../org/openecomp/policy/rest/jpa/PortList.java | 3 - .../org/openecomp/policy/rest/jpa/PrefixList.java | 114 +++ .../openecomp/policy/rest/jpa/ProtocolList.java | 3 - .../policy/rest/jpa/RemoteCatalogValues.java | 1 - .../org/openecomp/policy/rest/jpa/RiskType.java | 12 +- .../openecomp/policy/rest/jpa/SecurityZone.java | 3 - .../org/openecomp/policy/rest/jpa/ServiceList.java | 3 - .../org/openecomp/policy/rest/jpa/SystemLogDB.java | 10 - .../org/openecomp/policy/rest/jpa/TermList.java | 5 +- .../org/openecomp/policy/rest/jpa/UserInfo.java | 2 +- .../java/org/openecomp/policy/rest/jpa/VMType.java | 1 - .../org/openecomp/policy/rest/jpa/VNFType.java | 5 +- .../org/openecomp/policy/rest/jpa/VSCLAction.java | 5 +- .../policy/rest/jpa/VarbindDictionary.java | 5 +- .../java/org/openecomp/policy/rest/jpa/Zone.java | 3 - .../openecomp/policy/rest/jpa/package-info.java | 6 - .../policy/rest/util/MSAttributeObject.java | 33 +- .../openecomp/policy/rest/util/MSModelUtils.java | 701 +++++++++++++++++ .../openecomp/policy/rest/util/MSModelUtitils.java | 450 ----------- .../openecomp/policy/rest/util/ModelObject.java | 157 ---- .../org/openecomp/policy/rest/util/Webapps.java | 11 +- .../org/openecomp/policy/rest/XACMLRestTest.java | 5 +- 133 files changed, 4581 insertions(+), 2259 deletions(-) create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AddressGroupJson.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AddressJson.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AddressMembers.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AutoPushTabAdapter.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopFaultBody.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopFaultTriggerUISignatures.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPMBody.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPerformanceMetrics.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPolicy.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPolicyConditions.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPolicyStatus.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopSignatures.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/DeletePolicyCondition.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/DeployNowJson.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/GridData.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PolicyExportAdapter.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PolicyRestAdapter.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PrefixIPList.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceGroupJson.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceListJson.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceMembers.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServicesJson.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/TagDefines.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/Tags.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/Term.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/TermCollector.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/package-info.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ActionListDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ActionPolicyDictDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/AddressGroupDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/AttributeDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/BRMSParamTemplateDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/CategoryDao.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/CommonClassDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/DCAEUUIDDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/DecisionPolicyDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/DescriptiveScopeDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/EcompNameDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/EnforcerPolicyDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/FirewallDictionaryListDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/GroupPolicyScopeListDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/MicroServiceConfigNameDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/MicroServiceLocationDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/MicroServiceModelsDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PEPOptionsDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeClosedLoopDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeResourceDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeServiceDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeTypeDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PortListDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PrefixListDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ProtocolListDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/RiskTypeDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/SafePolicyWarningDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/SecurityZoneDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ServiceDictionaryDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ServiceGroupDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ServiceListDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/SiteDictionaryDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/TermListDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/UserInfoDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/VNFTypeDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/VSCLActionDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/VarbindDictionaryDao.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ZoneDao.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/BRMSController.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/BRMSDependency.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ClosedLoops.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FWTag.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FWTagPicker.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceAttribute.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PREFIXLIST.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PrefixList.java create mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSModelUtils.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSModelUtitils.java delete mode 100644 ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/ModelObject.java (limited to 'ECOMP-REST') diff --git a/ECOMP-REST/pom.xml b/ECOMP-REST/pom.xml index 77f52e0c3..77f60f0a8 100644 --- a/ECOMP-REST/pom.xml +++ b/ECOMP-REST/pom.xml @@ -18,24 +18,23 @@ limitations under the License. ============LICENSE_END========================================================= --> - 4.0.0 - + org.openecomp.policy.engine PolicyEngineSuite 1.1.0-SNAPSHOT - + ECOMP-REST - + ECOMP REST - + jar @@ -65,6 +64,11 @@ guava 14.0.1 + + com.google.code.gson + gson + 2.8.0 + junit junit @@ -75,7 +79,7 @@ org.mockito mockito-core 1.9.5 - + org.springframework spring-mock @@ -86,11 +90,6 @@ mockrunner 0.3.1 - - org.openecomp.policy.common - ECOMP-Logging - ${common-modules.version} - org.eclipse.emf org.eclipse.emf.ecore.xmi diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/XACMLRest.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/XACMLRest.java index 7e535cbcf..2a6654815 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/XACMLRest.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/XACMLRest.java @@ -34,7 +34,6 @@ import org.apache.commons.logging.LogFactory; import org.openecomp.policy.common.logging.eelf.MessageCodes; import org.openecomp.policy.common.logging.eelf.PolicyLogger; -import org.openecomp.policy.xacml.api.XACMLErrorConstants; import com.att.research.xacml.util.XACMLProperties; @@ -76,6 +75,7 @@ public class XACMLRest { // Look for system override // String xacmlPropertiesName = System.getProperty(XACMLProperties.XACML_PROPERTIES_NAME); + logger.info("\n\n" + xacmlPropertiesName + "\n" + XACMLProperties.XACML_PROPERTIES_NAME); if (xacmlPropertiesName == null) { // // Set it to our servlet default @@ -139,8 +139,6 @@ public class XACMLRest { XACMLProperties.getProperties().putAll(pipProperties); } } catch (IOException e) { - //logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to put init properties into Xacml properties", e); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "Failed to put init properties into Xacml properties"); } // @@ -150,8 +148,6 @@ public class XACMLRest { try { logger.debug(XACMLProperties.getProperties().toString()); } catch (IOException e) { - //logger.error( XACMLErrorConstants.ERROR_PROCESS_FLOW + "Cannot dump properties", e); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "Cannot dump properties"); } } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/XACMLRestProperties.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/XACMLRestProperties.java index bc991aafb..04472f8fe 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/XACMLRestProperties.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/XACMLRestProperties.java @@ -310,16 +310,27 @@ public class XACMLRestProperties extends XACMLProperties { /* * Value for Notification Option */ - public static final String PROP_NOTIFICATION_TYPE = "xacml.notification.type"; - + public static final String PROP_NOTIFICATION_TYPE = "NOTIFICATION_TYPE"; /* - * Value for Notification Servers + * Value for Notification DMaaP servers */ - public static final String PROP_NOTIFICATION_UEB_CLUSTER = "xacml.ueb.cluster"; + public static final String PROP_NOTIFICATION_SERVERS = "NOTIFICATION_SERVERS"; /* * Value for Notification Delay */ - public static final String PROP_NOTIFICATION_DELAY= "xacml.rest.notification.delay"; + public static final String PROP_NOTIFICATION_DELAY= "NOTIFICATION_DELAY"; + /* + * Value for Notification Topic + */ + public static final String PROP_NOTIFICATION_TOPIC= "NOTIFICATION_TOPIC"; + /* + * Value for Notification Topic + */ + public static final String PROP_UEB_API_KEY= "UEB_API_KEY"; + /* + * Value for Notification Topic + */ + public static final String PROP_UEB_API_SECRET= "UEB_API_SECRET"; /* * Closedloop Fault Policy Template Version */ @@ -336,10 +347,6 @@ public class XACMLRestProperties extends XACMLProperties { * MicroService Policy Template Version */ public static final String TemplateVersion_MS= "xacml.rest.microServices"; - /* - * GOC Policy Template Version - */ - public static final String TemplateVersion_GOC= "xacml.rest.gocPolicy"; /* * Firewall Policy Template Version */ @@ -440,4 +447,10 @@ public class XACMLRestProperties extends XACMLProperties { */ public static final String PROP_MODEL_LEVEL = "xacml.model.level"; + /* + * Value for Incoming Notification tries + * + * */ + public static final String PROP_PAP_INCOMINGNOTIFICATION_TRIES = "xacml.rest.pap.incomingnotification.tries"; + } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/XacmlAdminAuthorization.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/XacmlAdminAuthorization.java index f611cf944..ae72db267 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/XacmlAdminAuthorization.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/XacmlAdminAuthorization.java @@ -22,14 +22,16 @@ package org.openecomp.policy.rest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.openecomp.policy.common.logging.eelf.MessageCodes; +import org.openecomp.policy.common.logging.eelf.PolicyLogger; import org.openecomp.policy.rest.jpa.UserInfo; +import org.openecomp.policy.xacml.api.XACMLErrorConstants; import com.att.research.xacml.api.DataTypeException; import com.att.research.xacml.api.Decision; import com.att.research.xacml.api.Request; import com.att.research.xacml.api.Response; import com.att.research.xacml.api.Result; -import org.openecomp.policy.xacml.api.XACMLErrorConstants; import com.att.research.xacml.api.pdp.PDPEngine; import com.att.research.xacml.api.pdp.PDPEngineFactory; import com.att.research.xacml.api.pdp.PDPException; @@ -40,8 +42,7 @@ import com.att.research.xacml.std.annotations.XACMLResource; import com.att.research.xacml.std.annotations.XACMLSubject; import com.att.research.xacml.util.FactoryException; -import org.openecomp.policy.common.logging.eelf.MessageCodes; -import org.openecomp.policy.common.logging.eelf.PolicyLogger; + public class XacmlAdminAuthorization { private static Log logger = LogFactory.getLog(XacmlAdminAuthorization.class); @@ -160,13 +161,11 @@ public class XacmlAdminAuthorization { pdpEngineFactory = PDPEngineFactory.newInstance(); if (pdpEngineFactory == null) { logger.error("Failed to create PDP Engine Factory"); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error("Failed to create PDP Engine Factory"); } this.pdpEngine = pdpEngineFactory.newEngine(); } catch (FactoryException e) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Exception create PDP Engine: " + e.getLocalizedMessage()); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "XacmlAdminAuthorization", "Exception create PDP Engine"); } } @@ -182,13 +181,11 @@ public class XacmlAdminAuthorization { request = RequestParser.parseRequest(new AuthorizationRequest(userid, action.toString(), resource.toString())); } catch (IllegalArgumentException | IllegalAccessException | DataTypeException e) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to create request: " + e.getLocalizedMessage()); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "XacmlAdminAuthorization", "Failed to create request"); return false; } if (request == null) { logger.error("Failed to parse request."); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error("Failed to parse request"); return false; } @@ -200,7 +197,6 @@ public class XacmlAdminAuthorization { Response response = this.pdpEngine.decide(request); if (response == null) { logger.error("Null response from PDP decide"); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error("Null response from PDP decide"); } // @@ -215,7 +211,6 @@ public class XacmlAdminAuthorization { } } catch (PDPException e) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "PDP Decide failed: " + e.getLocalizedMessage()); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "XacmlAdminAuthorization", "PDP Decide failed"); } return false; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AddressGroupJson.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AddressGroupJson.java new file mode 100644 index 000000000..ad6b503a2 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AddressGroupJson.java @@ -0,0 +1,79 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +import java.util.ArrayList; +import java.util.List; + +public class AddressGroupJson { + + protected String name; + protected String description; + protected List members; + + // name + public String getName() { + return name; + } + + public void setName(String value) { + this.name = value; + } + + public boolean equals(Object obj) + { + AddressGroupJson servGroupobj=(AddressGroupJson) obj; + if(this.getName().equals(servGroupobj.getName())) + { + return true; + } + return false; + } + + public int hashCode() { + return Integer.valueOf(name.charAt(0)+(name.charAt(1))); + } + + // description + public String getDescription() { + return description; + } + + public void setDescription(String value) { + this.description = value; + } + + public List getMembers() + { + if(members==null) + { + members= new ArrayList(); + } + return this.members; + } + + public void setMembers(List members) + { + this.members = members; + } + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AddressJson.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AddressJson.java new file mode 100644 index 000000000..d2361d807 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AddressJson.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +public class AddressJson { + + protected String type; + protected String name; + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + // type + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /*public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + }*/ +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AddressMembers.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AddressMembers.java new file mode 100644 index 000000000..f53f61c32 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AddressMembers.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + + +public class AddressMembers { + + protected String type; + protected String value; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AutoPushTabAdapter.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AutoPushTabAdapter.java new file mode 100644 index 000000000..7180f9a46 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/AutoPushTabAdapter.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +import java.util.ArrayList; + +public class AutoPushTabAdapter { + + private ArrayList pdpDatas; + private ArrayList policyDatas; + public ArrayList getPdpDatas() { + return pdpDatas; + } + public void setPdpDatas(ArrayList pdpDatas) { + this.pdpDatas = pdpDatas; + } + public ArrayList getPolicyDatas() { + return policyDatas; + } + public void setPolicyDatas(ArrayList policyDatas) { + this.policyDatas = policyDatas; + } +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopFaultBody.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopFaultBody.java new file mode 100644 index 000000000..469b1075c --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopFaultBody.java @@ -0,0 +1,280 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + + +public class ClosedLoopFaultBody { + + private boolean trinity; + private boolean vUSP; + private boolean mcr; + private boolean gama; + private boolean vDNS; + + private String vnfType; + private String vServices; + private String ECOMPname; + + private String closedLoopPolicyStatus; + private ClosedLoopSignatures triggerSignatures; + private String actions; + private int timeInterval; + private int timeOutvPRO; + private int timeOutRuby; + private int retrys; + private int agingWindow; + private String geoLink; + private String emailAddress; + private ClosedLoopSignatures verificationSignatures; + private ClosedLoopPolicyConditions conditions; + private ClosedLoopFaultTriggerUISignatures triggerSignaturesUsedForUI; + private ClosedLoopFaultTriggerUISignatures verificationSignaturesUsedForUI; + private int triggerTimeWindowUsedForUI; + private int verfificationTimeWindowUsedForUI; + private String pepName; + private String pepAction; + private String templateVersion; + private int trapMaxAgeUsedForUI; + + + public Integer getTrapMaxAgeUsedForUI() { + return trapMaxAgeUsedForUI; + } + + public void setTrapMaxAgeUsedForUI(int trapMaxAgeUsedForUI) { + this.trapMaxAgeUsedForUI = trapMaxAgeUsedForUI; + } + + public String getTemplateVersion() { + return templateVersion; + } + + public void setTemplateVersion(String templateVersion) { + this.templateVersion = templateVersion; + } + + public Integer getTimeOutvPRO() { + return timeOutvPRO; + } + + public void setTimeOutvPRO(int timeOutvPRO) { + this.timeOutvPRO = timeOutvPRO; + } + + + public Integer getTriggerTimeWindowUsedForUI() { + return triggerTimeWindowUsedForUI; + } + + public String getPepName() { + return pepName; + } + + public void setPepName(String pepName) { + this.pepName = pepName; + } + + public String getPepAction() { + return pepAction; + } + + public void setPepAction(String pepAction) { + this.pepAction = pepAction; + } + + public void setTriggerTimeWindowUsedForUI(int triggerTimeWindowUsedForUI) { + this.triggerTimeWindowUsedForUI = triggerTimeWindowUsedForUI; + } + + public Integer getVerfificationTimeWindowUsedForUI() { + return verfificationTimeWindowUsedForUI; + } + + public void setVerfificationTimeWindowUsedForUI( + int verfificationTimeWindowUsedForUI) { + this.verfificationTimeWindowUsedForUI = verfificationTimeWindowUsedForUI; + } + + public String getECOMPname(){ + return ECOMPname; + } + + public void setECOMPname(String ECOMPname){ + this.ECOMPname = ECOMPname; + } + + public String getvServices() { + return vServices; + } + public void setvServices(String vServices) { + this.vServices = vServices; + } + + public ClosedLoopFaultTriggerUISignatures getVerificationSignaturesUsedForUI() { + return verificationSignaturesUsedForUI; + } + public void setVerificationSignaturesUsedForUI( + ClosedLoopFaultTriggerUISignatures verificationSignaturesUsedForUI) { + this.verificationSignaturesUsedForUI = verificationSignaturesUsedForUI; + } + public ClosedLoopFaultTriggerUISignatures getTriggerSignaturesUsedForUI() { + return triggerSignaturesUsedForUI; + } + public void setTriggerSignaturesUsedForUI( + ClosedLoopFaultTriggerUISignatures triggerSignaturesUsedForUI) { + this.triggerSignaturesUsedForUI = triggerSignaturesUsedForUI; + } + public ClosedLoopPolicyConditions getConditions() { + return conditions; + } + public void setConditions(ClosedLoopPolicyConditions conditions) { + this.conditions = conditions; + } + + public String getVnfType() { + return vnfType; + } + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public Integer getAgingWindow() { + return agingWindow; + } + public void setAgingWindow(int agingWindow) { + this.agingWindow = agingWindow; + } + + public String getClosedLoopPolicyStatus() { + return closedLoopPolicyStatus; + } + public void setClosedLoopPolicyStatus( + String closedLoopPolicyStatus) { + this.closedLoopPolicyStatus = closedLoopPolicyStatus; + } + public ClosedLoopSignatures getTriggerSignatures() { + return triggerSignatures; + } + public void setTriggerSignatures(ClosedLoopSignatures triggerSignatures) { + this.triggerSignatures = triggerSignatures; + } + public String getActions() { + return actions; + } + public void setActions(String actions) { + this.actions = actions; + } + public Integer getTimeInterval() { + return timeInterval; + } + public void setTimeInterval(int timeInterval) { + this.timeInterval = timeInterval; + } + public Integer getTimeOutRuby() { + return timeOutRuby; + } + public void setTimeOutRuby(int timeOutRuby) { + this.timeOutRuby = timeOutRuby; + } + public Integer getRetrys() { + return retrys; + } + public void setRetrys(int retrys) { + this.retrys = retrys; + } + public String getGeoLink() { + return geoLink; + } + public void setGeoLink(String geoLink) { + this.geoLink = geoLink; + } + public String getEmailAddress() { + return emailAddress; + } + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + public ClosedLoopSignatures getVerificationSignatures() { + return verificationSignatures; + } + public void setVerificationSignatures( + ClosedLoopSignatures verificationSignatures) { + this.verificationSignatures = verificationSignatures; + } + + /*public ArrayList getD2Services() { + return d2Services; + } + + public void setD2Services(ArrayList d2Services) { + this.d2Services = d2Services; + } + + public ArrayList getSiteNames() { + return siteNames; + } + + public void setSiteNames(ArrayList siteNames) { + this.siteNames = siteNames; + }*/ + + public boolean isvDNS() { + return vDNS; + } + + public void setvDNS(boolean vDNS) { + this.vDNS = vDNS; + } + + public boolean isTrinity() { + return trinity; + } + + public void setTrinity(boolean trinity) { + this.trinity = trinity; + } + + public boolean isvUSP() { + return vUSP; + } + + public void setvUSP(boolean vUSP) { + this.vUSP = vUSP; + } + + public boolean isMcr() { + return mcr; + } + + public void setMcr(boolean mcr) { + this.mcr = mcr; + } + + public boolean isGama() { + return gama; + } + + public void setGama(boolean gama) { + this.gama = gama; + } +} + diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopFaultTriggerUISignatures.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopFaultTriggerUISignatures.java new file mode 100644 index 000000000..1c1702e89 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopFaultTriggerUISignatures.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + + +public class ClosedLoopFaultTriggerUISignatures { + + private String signatures; + + private String connectSignatures; + + public String getConnectSignatures() { + return connectSignatures; + } + public void setConnectSignatures(String connectSignatures) { + this.connectSignatures = connectSignatures; + } + public String getSignatures() { + return signatures; + } + public void setSignatures(String signatures) { + this.signatures = signatures; + } + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPMBody.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPMBody.java new file mode 100644 index 000000000..419c7d7ea --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPMBody.java @@ -0,0 +1,133 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +import java.util.Map; + +public class ClosedLoopPMBody { + + private boolean trinity; + private boolean vUSP; + private boolean mcr; + private boolean gama; + private boolean vDNS; + private String geoLink; + private String vServices; + private String ECOMPname; + + private String emailAddress; + + private String serviceTypePolicyName; + + private Map attributes; + private String templateVersion; + + public String getTemplateVersion() { + return templateVersion; + } + + public void setTemplateVersion(String templateVersion) { + this.templateVersion = templateVersion; + } + + public String getECOMPname(){ + return ECOMPname; + } + + public void setECOMPname(String ECOMPname){ + this.ECOMPname = ECOMPname; + } + + public String getvServices() { + return vServices; + } + + public void setvServices(String vServices) { + this.vServices = vServices; + } + + public Map getAttributes() { + return attributes; + } + + public void setAttributes(Map map) { + this.attributes = map; + } + + public String getGeoLink() { + return geoLink; + } + + public void setGeoLink(String geoLink) { + this.geoLink = geoLink; + } + + public String getEmailAddress() { + return emailAddress; + } + + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + public String getServiceTypePolicyName() { + return serviceTypePolicyName; + } + + public void setServiceTypePolicyName(String serviceTypePolicyName) { + this.serviceTypePolicyName = serviceTypePolicyName; + } + + public boolean isGama() { + return gama; + } + public void setGama(boolean gama) { + this.gama = gama; + } + public boolean isvDNS() { + return vDNS; + } + public void setvDNS(boolean vDNS) { + this.vDNS = vDNS; + } + + public boolean isTrinity() { + return trinity; + } + public void setTrinity(boolean trinity) { + this.trinity = trinity; + } + public boolean isvUSP() { + return vUSP; + } + public void setvUSP(boolean vUSP) { + this.vUSP = vUSP; + } + public boolean isMcr() { + return mcr; + } + public void setMcr(boolean mcr) { + this.mcr = mcr; + } + +} + diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPerformanceMetrics.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPerformanceMetrics.java new file mode 100644 index 000000000..ad858a6af --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPerformanceMetrics.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +public class ClosedLoopPerformanceMetrics { + public static final String CLPM_UIFIELD_ONSET_MESSAGE = "Onset Message"; + public static final String CLPM_UIJSON_ONSET_MESSAGE = "attributes.OnsetMessage"; + + public static final String CLPM_UIFIELD_POLICY_NAME = "PolicyName"; + public static final String CLPM_UIJSON_POLICY_NAME = "attributes.PolicyName"; + + public static final String CLPM_UIFIELD_ABATEMENT_MESSAGE = "Abatement Message"; + public static final String CLPM_UIJSON_ABATEMENT_MESSAGE = "attributes.AbatementMessage"; + + public static final String CLPM_UIFIELD_GEOLINK = "Geo Link"; + public static final String CLPM_UIJSON_GEOLINK = "geoLink"; +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPolicy.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPolicy.java new file mode 100644 index 000000000..16db3c2b4 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPolicy.java @@ -0,0 +1,61 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +public class ClosedLoopPolicy { + public static final String CLFAULT_UIFIELD_D2_SERVICES_TRINITY = "Hosted Voice (Trinity)"; + public static final String CLFAULT_UIJSON_D2_SERVICES_TRINITY = "trinity"; + + public static final String CLFAULT_UIFIELD_D2_SERVICES_VUSP = "vUSP"; + public static final String CLFAULT_UIJSON_D2_SERVICES_VUSP = "vUSP"; + + public static final String CLFAULT_UIFIELD_D2_SERVICES_MCR = "MCR"; + public static final String CLFAULT_UIJSON_D2_SERVICES_MCR = "mcr"; + + public static final String CLFAULT_UIFIELD_D2_SERVICES_GAMMA = "Gamma"; + public static final String CLFAULT_UIJSON_D2_SERVICES_GAMMA = "gama"; + + public static final String CLFAULT_UIFIELD_D2_SERVICES_VDNS = "vDNS"; + public static final String CLFAULT_UIJSON_D2_SERVICES_VDNS = "vDNS"; + + public static final String CLFAULT_UIFIELD_EMAIL_ADDRESS = "Email Address"; + public static final String CLFAULT_UIJSON_EMAIL_ADDRESS = "emailAddress"; + + public static final String CLFAULT_UIFIELD_TRIGGER_SIGNATURE = "Trigger Signature"; + public static final String CLFAULT_UIJSON_TRIGGER_SIGNATURE = "triggerSignaturesUsedForUI.signatures"; + + public static final String CLFAULT_UIFIELD_VERIFICATION_SIGNATURE = "Verification Signature"; + public static final String CLFAULT_UIJSON_VERIFICATION_SIGNATURE = "verificationSignaturesUsedForUI.signatures"; + + public static final String CLFAULT_UIFIELD_CONNECT_ALL_TRAPS = "Connect All Traps"; + public static final String CLFAULT_UIJSON_CONNECT_ALL_TRAPS = "triggerSignaturesUsedForUI.connectSignatures"; + + public static final String CLFAULT_UIFIELD_CONNECT_ALL_FAULTS = "Connect All Faults"; + public static final String CLFAULT_UIJSON_CONNECT_ALL_FAULTS = "verificationSignaturesUsedForUI.connectSignatures"; + + public static final String CLFAULT_UIFIELD_POLICY_STATUS_ACTIVE = "Active"; + public static final String CLFAULT_UIJSON_POLICY_STATUS_ACTIVE = "ACTIVE"; + + public static final String CLFAULT_UIFIELD_POLICY_STATUS_INACTIVE = "InActive"; + public static final String CLFAULT_UIJSON_POLICY_STATUS_INACTIVE = "INACTIVE"; + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPolicyConditions.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPolicyConditions.java new file mode 100644 index 000000000..ff7efdfbc --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPolicyConditions.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +public enum ClosedLoopPolicyConditions { + SEND("DCAE should send event notification"), + + NOTSEND("DCAE should not send event notification"); + private String name; + + private ClosedLoopPolicyConditions(String name){ + this.name = name; + } + + @Override + public String toString(){ + return this.name; + } +} + diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPolicyStatus.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPolicyStatus.java new file mode 100644 index 000000000..74138f448 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopPolicyStatus.java @@ -0,0 +1,41 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +public enum ClosedLoopPolicyStatus { + ACTIVE("active"), + + INACTIVE("inactive") + ; + + private String name; + + private ClosedLoopPolicyStatus(String name){ + this.name = name; + } + + @Override + public String toString(){ + return this.name; + } +} + diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopSignatures.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopSignatures.java new file mode 100644 index 000000000..793e93ed8 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ClosedLoopSignatures.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +public class ClosedLoopSignatures { + + private String signatures; + + private int timeWindow; + + private Integer trapMaxAge; + + public String getSignatures() { + return signatures; + } + public void setSignatures(String signatures) { + this.signatures = signatures; + } + + public Integer getTimeWindow() { + return timeWindow; + } + public void setTimeWindow(Integer timeWindow) { + this.timeWindow = timeWindow; + } + + public Integer getTrapMaxAge() { + return trapMaxAge; + } + public void setTrapMaxAge(Integer trapMaxAge) { + this.trapMaxAge = trapMaxAge; + } +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/DeletePolicyCondition.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/DeletePolicyCondition.java new file mode 100644 index 000000000..f34bc1d3e --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/DeletePolicyCondition.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +public enum DeletePolicyCondition { + ONE("Are you sure you want to delete Current Version of policy"), + + ALL("Are you sure you want to delete All Versions of policy"); + private String name; + + private DeletePolicyCondition(String name){ + this.name = name; + } + + @Override + public String toString(){ + return this.name; + } +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/DeployNowJson.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/DeployNowJson.java new file mode 100644 index 000000000..6344fbfcb --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/DeployNowJson.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +public class DeployNowJson { + + protected boolean deployNow; + + // deployNow + public boolean getDeployNow() { + return deployNow; + } + + public void setDeployNow(boolean value) { + this.deployNow = value; + } +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/GridData.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/GridData.java new file mode 100644 index 000000000..f39156cf1 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/GridData.java @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +import java.util.ArrayList; + +public class GridData { + private ArrayList attributes; + private ArrayList transportProtocols; + private ArrayList appProtocols; + + public ArrayList getAttributes() { + return attributes; + } + + public void setAttributes(ArrayList attributes) { + this.attributes = attributes; + } + + public ArrayList getAppProtocols() { + return appProtocols; + } + + public void setAppProtocols(ArrayList appProtocols) { + this.appProtocols = appProtocols; + } + + public ArrayList getTransportProtocols() { + return transportProtocols; + } + + public void setTransportProtocols(ArrayList transportProtocols) { + this.transportProtocols = transportProtocols; + } +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PolicyExportAdapter.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PolicyExportAdapter.java new file mode 100644 index 000000000..ce2d21083 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PolicyExportAdapter.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +import java.util.ArrayList; + +public class PolicyExportAdapter { + + private ArrayList policyDatas; + + public ArrayList getPolicyDatas() { + return policyDatas; + } + public void setPolicyDatas(ArrayList policyDatas) { + this.policyDatas = policyDatas; + } +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PolicyRestAdapter.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PolicyRestAdapter.java new file mode 100644 index 000000000..c823ec6ab --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PolicyRestAdapter.java @@ -0,0 +1,827 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP-PAP-REST + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import javax.persistence.EntityManagerFactory; + +import org.openecomp.policy.rest.jpa.EcompName; + +public class PolicyRestAdapter { + + //Common + private Object data; + private String policyName = null; + private String configBodyData = null; + private String configType = null; + private String policyID = null; + private String policyType = null; + private String comboPolicyType; + private String configPolicyType = null; + private String policyDescription = null; + private String ecompName = null; + private String configName = null; + private String ruleID = null; + private String parentPath; + private boolean isValidData = false; + private String adminNotification = null; + public boolean isEditPolicy = false; + public boolean isViewPolicy = false; + private boolean isDraft = false; + private Object policyData = null; + private String gitPath; + private boolean readOnly; + private String configHome; + private String configUrl; + private String finalPolicyPath; + private String version; + private String jsonBody; + private String apiflag; + private String prevJsonBody; + private Integer highestVersion; + private EntityManagerFactory entityManagerFactory = null; + private Boolean policyExists = false; + private String oldPolicyFileName = null; + private String domain = null; + private String userId; + private String newFileName; + private String clWarning = null; + private String newCLName = null; + private String existingCLName = null; + //Used by GUI + private EcompName ecompNameField; + private Object jsonBodyData; + private String dirPath; + private String configBodyPath; + private ArrayList attributes; + private ArrayList settings; + private ArrayList ruleAlgorithmschoices; + + private LinkedHashMap serviceTypePolicyName; + + private LinkedHashMap verticaMetrics; + private LinkedHashMap description; + private LinkedHashMap attributeFields; + + //ClosedLoop + private String clearTimeOut; + private String trapMaxAge; + private String verificationclearTimeOut; + public Map dynamicLayoutMap; + + //FireWall + private String fwPolicyType; + private ArrayList fwattributes; + private String parentForChild; + private String securityZone; + + //Action & Decision + private String ruleCombiningAlgId = null; + private Map dynamicFieldConfigAttributes; + private Map dynamicSettingsMap; + private Map dropDownMap; + private String actionPerformer = null; + private String actionAttribute = null; + private List dynamicRuleAlgorithmLabels; + private List dynamicRuleAlgorithmCombo; + private List dynamicRuleAlgorithmField1; + private List dynamicRuleAlgorithmField2; + private List dynamicVariableList; + private List dataTypeList; + private String actionAttributeValue; + private String ruleProvider; + private String actionBody = null; + private String actionDictHeader = null; + private String actionDictType = null; + private String actionDictUrl = null; + private String actionDictMethod = null; + + //MicroSerice + private String serviceType = null; + private String uuid = null; + private String location = null; + private String priority = null; + private String msLocation = null; + + //BRMS Policies + private String ruleName; + private Map brmsParamBody=null; + private String brmsController = null; + private ArrayList brmsDependency = null; + private LinkedHashMap ruleData; + private LinkedHashMap ruleListData; + private Map drlRuleAndUIParams=null; + + //Safe Policy + private String policyScope; + private String providerComboBox = null; + private String riskType; + private String riskLevel; + private String guard = null; + private String ttlDate; + private Map matching; + + private ArrayList triggerSignatures; + private ArrayList symptomSignatures; + private String logicalConnector; + private String policyStatus; + public String gocServerScope; + private String supressionType; + + + public ArrayList getTriggerSignatures() { + return triggerSignatures; + } + public void setTriggerSignatures(ArrayList triggerSignatures) { + this.triggerSignatures = triggerSignatures; + } + public ArrayList getSymptomSignatures() { + return symptomSignatures; + } + public void setSymptomSignatures(ArrayList symptomSignatures) { + this.symptomSignatures = symptomSignatures; + } + public String getLogicalConnector() { + return logicalConnector; + } + public void setLogicalConnector(String logicalConnector) { + this.logicalConnector = logicalConnector; + } + public String getPolicyStatus() { + return policyStatus; + } + public void setPolicyStatus(String policyStatus) { + this.policyStatus = policyStatus; + } + public String getGocServerScope() { + return gocServerScope; + } + public void setGocServerScope(String gocServerScope) { + this.gocServerScope = gocServerScope; + } + + public String getSupressionType() { + return supressionType; + } + public void setSupressionType(String supressionType) { + this.supressionType = supressionType; + } + + /********************************************************************************/ + + + + public String getComboPolicyType() { + return comboPolicyType; + } + public void setComboPolicyType(String comboPolicyType) { + this.comboPolicyType = comboPolicyType; + } + public String getGitPath() { + return gitPath; + } + public void setGitPath(String gitPath) { + this.gitPath = gitPath; + } + public String getOldPolicyFileName() { + return oldPolicyFileName; + } + public void setOldPolicyFileName(String oldPolicyFileName) { + this.oldPolicyFileName = oldPolicyFileName; + } + public String getDomainDir() { + return domain; + } + public void setDomainDir(String domain) { + this.domain = domain; + } + public Integer getHighestVersion() { + return highestVersion; + } + public void setHighestVersion(Integer highestVersion) { + this.highestVersion = highestVersion; + } + public Object getData() { + return data; + } + public void setData(Object data) { + this.data = data; + } + public String getPolicyName() { + return policyName; + } + public void setPolicyName(String policyName) { + this.policyName = policyName; + } + public String getConfigBodyData() { + return configBodyData; + } + public void setConfigBodyData(String configBodyData) { + this.configBodyData = configBodyData; + } + public String getConfigType() { + return configType; + } + public void setConfigType(String configType) { + this.configType = configType; + } + public String getPolicyID() { + return policyID; + } + public void setPolicyID(String policyID) { + this.policyID = policyID; + } + public String getPolicyType() { + return policyType; + } + public void setPolicyType(String policyType) { + this.policyType = policyType; + } + public String getPolicyDescription() { + return policyDescription; + } + public void setPolicyDescription(String policyDescription) { + this.policyDescription = policyDescription; + } + public String getEcompName() { + return ecompName; + } + public void setEcompName(String ecompName) { + this.ecompName = ecompName; + } + public String getConfigName() { + return configName; + } + public void setConfigName(String configName) { + this.configName = configName; + } + public String getRuleID() { + return ruleID; + } + public void setRuleID(String ruleID) { + this.ruleID = ruleID; + } + public String getRuleCombiningAlgId() { + return ruleCombiningAlgId; + } + public void setRuleCombiningAlgId(String ruleCombiningAlgId) { + this.ruleCombiningAlgId = ruleCombiningAlgId; + } + public Map getDynamicFieldConfigAttributes() { + return dynamicFieldConfigAttributes; + } + public void setDynamicFieldConfigAttributes( + Map dynamicFieldConfigAttributes) { + this.dynamicFieldConfigAttributes = dynamicFieldConfigAttributes; + } + public String getParentPath() { + return parentPath; + } + public void setParentPath(String parentPath) { + this.parentPath = parentPath; + } + public boolean isEditPolicy() { + return isEditPolicy; + } + public void setEditPolicy(boolean isEditPolicy) { + this.isEditPolicy = isEditPolicy; + } + public boolean isViewPolicy() { + return isViewPolicy; + } + public void setViewPolicy(boolean isViewPolicy) { + this.isViewPolicy = isViewPolicy; + } + public Object getPolicyData() { + return policyData; + } + public void setPolicyData(Object policyData) { + this.policyData = policyData; + } + public boolean isReadOnly() { + return readOnly; + } + public void setReadOnly(boolean readOnly) { + this.readOnly = readOnly; + } + public String getUserGitPath() { + return gitPath; + } + public void setUserGitPath(String gitPath) { + this.gitPath = gitPath; + } + public boolean isValidData() { + return isValidData; + } + public void setValidData(boolean isValidData) { + this.isValidData = isValidData; + } + public String getAdminNotification() { + return adminNotification; + } + public void setAdminNotification(String adminNotification) { + this.adminNotification = adminNotification; + } + public String getConfigHome() { + return configHome; + } + public void setConfigHome(String configHome) { + this.configHome = configHome; + } + public String getConfigUrl() { + return configUrl; + } + public void setConfigUrl(String configUrl) { + this.configUrl = configUrl; + } + public String getFinalPolicyPath() { + return finalPolicyPath; + } + public void setFinalPolicyPath(String finalPolicyPath) { + this.finalPolicyPath = finalPolicyPath; + } + public String getVersion() { + return version; + } + public void setVersion(String version) { + this.version = version; + } + public String getJsonBody() { + return jsonBody; + } + public void setJsonBody(String jsonBody) { + this.jsonBody = jsonBody; + } + public String getPrevJsonBody() { + return prevJsonBody; + } + public void setPrevJsonBody(String prevJsonBody) { + this.prevJsonBody = prevJsonBody; + } + public String getApiflag() { + return apiflag; + } + public void setApiflag(String apiflag) { + this.apiflag = apiflag; + } + /** + * @return the actionPerformer + */ + public String getActionPerformer() { + return actionPerformer; + } + /** + * @param actionPerformer the actionPerformer to set + */ + public void setActionPerformer(String actionPerformer) { + this.actionPerformer = actionPerformer; + } + /** + * @return the actionAttribute + */ + public String getActionAttribute() { + return actionAttribute; + } + /** + * @param actionAttribute the actionAttribute to set + */ + public void setActionAttribute(String actionAttribute) { + this.actionAttribute = actionAttribute; + } + /** + * @return the dynamicRuleAlgorithmLabels + */ + public List getDynamicRuleAlgorithmLabels() { + return dynamicRuleAlgorithmLabels; + } + /** + * @param dynamicRuleAlgorithmLabels the dynamicRuleAlgorithmLabels to set + */ + public void setDynamicRuleAlgorithmLabels( + List dynamicRuleAlgorithmLabels) { + this.dynamicRuleAlgorithmLabels = dynamicRuleAlgorithmLabels; + } + /** + * @return the dynamicRuleAlgorithmCombo + */ + public List getDynamicRuleAlgorithmCombo() { + return dynamicRuleAlgorithmCombo; + } + /** + * @param dynamicRuleAlgorithmCombo the dynamicRuleAlgorithmCombo to set + */ + public void setDynamicRuleAlgorithmCombo(List dynamicRuleAlgorithmCombo) { + this.dynamicRuleAlgorithmCombo = dynamicRuleAlgorithmCombo; + } + /** + * @return the dynamicRuleAlgorithmField1 + */ + public List getDynamicRuleAlgorithmField1() { + return dynamicRuleAlgorithmField1; + } + /** + * @param dynamicRuleAlgorithmField1 the dynamicRuleAlgorithmField1 to set + */ + public void setDynamicRuleAlgorithmField1( + List dynamicRuleAlgorithmField1) { + this.dynamicRuleAlgorithmField1 = dynamicRuleAlgorithmField1; + } + /** + * @return the dynamicRuleAlgorithmField2 + */ + public List getDynamicRuleAlgorithmField2() { + return dynamicRuleAlgorithmField2; + } + /** + * @param dynamicRuleAlgorithmField2 the dynamicRuleAlgorithmField2 to set + */ + public void setDynamicRuleAlgorithmField2( + List dynamicRuleAlgorithmField2) { + this.dynamicRuleAlgorithmField2 = dynamicRuleAlgorithmField2; + } + public Map getDropDownMap() { + return dropDownMap; + } + public void setDropDownMap(Map dropDownMap) { + this.dropDownMap = dropDownMap; + } + + public Map getDynamicSettingsMap() { + return dynamicSettingsMap; + } + public void setDynamicSettingsMap(Map dynamicSettingsMap) { + this.dynamicSettingsMap = dynamicSettingsMap; + } + public List getDynamicVariableList() { + return dynamicVariableList; + } + public void setDynamicVariableList(List dynamicVariableList) { + this.dynamicVariableList = dynamicVariableList; + } + public List getDataTypeList() { + return dataTypeList; + } + public void setDataTypeList(List dataTypeList) { + this.dataTypeList = dataTypeList; + } + public boolean isDraft() { + return isDraft; + } + public void setDraft(boolean isDraft) { + this.isDraft = isDraft; + } + public String getConfigPolicyType() { + return configPolicyType; + } + public void setConfigPolicyType(String configPolicyType) { + this.configPolicyType = configPolicyType; + } + public String getServiceType() { + return serviceType; + } + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + public String getLocation() { + return location; + } + public void setLocation(String location) { + this.location = location; + } + public String getPriority() { + return priority; + } + public void setPriority(String priority) { + this.priority = priority; + } + public Map getBrmsParamBody() { + return brmsParamBody; + } + public void setBrmsParamBody(Map brmsParamBody) { + this.brmsParamBody = brmsParamBody; + } + public EntityManagerFactory getEntityManagerFactory() { + return entityManagerFactory; + } + public void setEntityManagerFactory(EntityManagerFactory entityManagerFactory) { + this.entityManagerFactory = entityManagerFactory; + } + /** + * @return the policyExists + */ + public Boolean getPolicyExists() { + return policyExists; + } + /** + * @param policyExists the policyExists to set + */ + public void setPolicyExists(Boolean policyExists) { + this.policyExists = policyExists; + } + public String getPolicyScope() { + return policyScope; + } + + public void setPolicyScope(String domainDir) { + this. policyScope=domainDir; + } + public String getProviderComboBox() { + return providerComboBox; + } + public void setProviderComboBox(String providerComboBox) { + this.providerComboBox = providerComboBox; + } + public String getRiskType() { + return riskType; + } + public void setRiskType(String riskType) { + this.riskType = riskType; + } + public String getGuard() { + return guard; + } + public void setGuard(String guard) { + this.guard = guard; + } + public String getRiskLevel() { + return riskLevel; + } + public void setRiskLevel(String riskLevel) { + this.riskLevel = riskLevel; + } + public String getTtlDate() { + return ttlDate; + } + public void setTtlDate(String ttlDate) { + this.ttlDate = ttlDate; + } + public String getBrmsController() { + return brmsController; + } + public void setBrmsController(String brmsController) { + this.brmsController = brmsController; + } + public ArrayList getBrmsDependency() { + return brmsDependency; + } + public void setBrmsDependency(ArrayList brmsDependency) { + this.brmsDependency = brmsDependency; + } + public Map getMatching() { + return matching; + } + public void setMatching(Map matching) { + this.matching = matching; + } + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + public String getNewFileName() { + return newFileName; + } + public void setNewFileName(String newFileName) { + this.newFileName = newFileName; + } + + public String getDomain() { + return domain; + } + public void setDomain(String domain) { + this.domain = domain; + } + public EcompName getEcompNameField() { + return ecompNameField; + } + public void setEcompNameField(EcompName ecompNameField) { + this.ecompNameField = ecompNameField; + } + public Object getJsonBodyData() { + return jsonBodyData; + } + public void setJsonBodyData(Object jsonBodyData) { + this.jsonBodyData = jsonBodyData; + } + public String getDirPath() { + return dirPath; + } + public void setDirPath(String dirPath) { + this.dirPath = dirPath; + } + public String getConfigBodyPath() { + return configBodyPath; + } + public void setConfigBodyPath(String configBodyPath) { + this.configBodyPath = configBodyPath; + } + public ArrayList getAttributes() { + return attributes; + } + public void setAttributes(ArrayList attributes) { + this.attributes = attributes; + } + public ArrayList getSettings() { + return settings; + } + public void setSettings(ArrayList settings) { + this.settings = settings; + } + public ArrayList getRuleAlgorithmschoices() { + return ruleAlgorithmschoices; + } + public void setRuleAlgorithmschoices(ArrayList ruleAlgorithmschoices) { + this.ruleAlgorithmschoices = ruleAlgorithmschoices; + } + public LinkedHashMap getServiceTypePolicyName() { + return serviceTypePolicyName; + } + public void setServiceTypePolicyName(LinkedHashMap serviceTypePolicyName) { + this.serviceTypePolicyName = serviceTypePolicyName; + } + public LinkedHashMap getVerticaMetrics() { + return verticaMetrics; + } + public void setVerticaMetrics(LinkedHashMap verticaMetrics) { + this.verticaMetrics = verticaMetrics; + } + public LinkedHashMap getDescription() { + return description; + } + public void setDescription(LinkedHashMap description) { + this.description = description; + } + public LinkedHashMap getAttributeFields() { + return attributeFields; + } + public void setAttributeFields(LinkedHashMap attributeFields) { + this.attributeFields = attributeFields; + } + public String getClearTimeOut() { + return clearTimeOut; + } + public void setClearTimeOut(String clearTimeOut) { + this.clearTimeOut = clearTimeOut; + } + public String getTrapMaxAge() { + return trapMaxAge; + } + public void setTrapMaxAge(String trapMaxAge) { + this.trapMaxAge = trapMaxAge; + } + public String getVerificationclearTimeOut() { + return verificationclearTimeOut; + } + public void setVerificationclearTimeOut(String verificationclearTimeOut) { + this.verificationclearTimeOut = verificationclearTimeOut; + } + public Map getDynamicLayoutMap() { + return dynamicLayoutMap; + } + public void setDynamicLayoutMap(Map dynamicLayoutMap) { + this.dynamicLayoutMap = dynamicLayoutMap; + } + public String getFwPolicyType() { + return fwPolicyType; + } + public void setFwPolicyType(String fwPolicyType) { + this.fwPolicyType = fwPolicyType; + } + public ArrayList getFwattributes() { + return fwattributes; + } + public void setFwattributes(ArrayList fwattributes) { + this.fwattributes = fwattributes; + } + public String getParentForChild() { + return parentForChild; + } + public void setParentForChild(String parentForChild) { + this.parentForChild = parentForChild; + } + public String getRuleName() { + return ruleName; + } + public void setRuleName(String ruleName) { + this.ruleName = ruleName; + } + public LinkedHashMap getRuleData() { + return ruleData; + } + public void setRuleData(LinkedHashMap ruleData) { + this.ruleData = ruleData; + } + public LinkedHashMap getRuleListData() { + return ruleListData; + } + public void setRuleListData(LinkedHashMap ruleListData) { + this.ruleListData = ruleListData; + } + public String getSecurityZone() { + return securityZone; + } + public void setSecurityZone(String securityZone) { + this.securityZone = securityZone; + } + public String getActionAttributeValue() { + return actionAttributeValue; + } + public void setActionAttributeValue(String actionAttributeValue) { + this.actionAttributeValue = actionAttributeValue; + } + public String getRuleProvider() { + return ruleProvider; + } + public void setRuleProvider(String ruleProvider) { + this.ruleProvider = ruleProvider; + } + public String getMsLocation() { + return msLocation; + } + public void setMsLocation(String msLocation) { + this.msLocation = msLocation; + } + public Map getDrlRuleAndUIParams() { + return drlRuleAndUIParams; + } + public void setDrlRuleAndUIParams(Map drlRuleAndUIParams) { + this.drlRuleAndUIParams = drlRuleAndUIParams; + } + public String getActionBody() { + return actionBody; + } + public void setActionBody(String actionBody) { + this.actionBody = actionBody; + } + public String getActionDictHeader() { + return actionDictHeader; + } + public void setActionDictHeader(String actionDictHeader) { + this.actionDictHeader = actionDictHeader; + } + public String getActionDictType() { + return actionDictType; + } + public void setActionDictType(String actionDictType) { + this.actionDictType = actionDictType; + } + public String getActionDictUrl() { + return actionDictUrl; + } + public void setActionDictUrl(String actionDictUrl) { + this.actionDictUrl = actionDictUrl; + } + public String getActionDictMethod() { + return actionDictMethod; + } + public void setActionDictMethod(String actionDictMethod) { + this.actionDictMethod = actionDictMethod; + } + public String getClWarning() { + return clWarning; + } + public void setClWarning(String clWarning) { + this.clWarning = clWarning; + } + public String getNewCLName() { + return newCLName; + } + public void setNewCLName(String newCLName) { + this.newCLName = newCLName; + } + public String getExistingCLName() { + return existingCLName; + } + public void setExistingCLName(String existingCLName) { + this.existingCLName = existingCLName; + } +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PrefixIPList.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PrefixIPList.java new file mode 100644 index 000000000..3de72ee68 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PrefixIPList.java @@ -0,0 +1,72 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + + +import java.util.ArrayList; +import java.util.List; + + +public class PrefixIPList { + protected String name; + protected String description; + protected List members; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public List getMembers() + { + if(members==null) + { + members= new ArrayList(); + } + return this.members; + } + + public void setMembers(List members) + { + this.members = members; + } + /*public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + }*/ + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceGroupJson.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceGroupJson.java new file mode 100644 index 000000000..6b368d331 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceGroupJson.java @@ -0,0 +1,79 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +import java.util.ArrayList; +import java.util.List; + +public class ServiceGroupJson { + + protected String name; + protected String description; + protected List members; + + // name + public String getName() { + return name; + } + + public void setName(String value) { + this.name = value; + } + + public boolean equals(Object obj) + { + ServiceGroupJson servGroupobj=(ServiceGroupJson) obj; + if(this.getName().equals(servGroupobj.getName())) + { + return true; + } + return false; + } + + public int hashCode() { + return Integer.valueOf(name.charAt(0)+(name.charAt(1))); + } + + // description + public String getDescription() { + return description; + } + + public void setDescription(String value) { + this.description = value; + } + + public List getMembers() + { + if(members==null) + { + members= new ArrayList(); + } + return this.members; + } + + public void setMembers(List members) + { + this.members = members; + } + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceListJson.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceListJson.java new file mode 100644 index 000000000..81cfc03c6 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceListJson.java @@ -0,0 +1,107 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + + +public class ServiceListJson { + + protected String name; + protected String description; + protected String type; + protected String transportProtocol; + protected String appProtocol; + protected String ports; + // name + public String getName() { + return name; + } + + public void setName(String value) { + this.name = value; + } + + public boolean equals(Object obj) + { + ServiceListJson servobj=(ServiceListJson) obj; + if(this.getName().equals(servobj.getName())) + { + return true; + } + return false; + } + + public int hashCode() { + if(name!=null){ + return Integer.valueOf(name.charAt(0)+(name.charAt(1))); + }else{ + return 0; + } + } + + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + // type + public String getType() { + return type; + } + + public void setType(String value) { + this.type = value; + } + + // transportProtocol + public String getTransportProtocol() { + return transportProtocol; + } + + public void setTransportProtocol(String value) { + this.transportProtocol = value; + } + + // appProtocol + public String getAppProtocol() { + return appProtocol; + } + + public void setAppProtocol(String value) { + this.appProtocol = value; + } + + // ports + public String getPorts() { + return ports; + } + + public void setPorts(String value) { + this.ports = value; + } + + + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceMembers.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceMembers.java new file mode 100644 index 000000000..a88df5174 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceMembers.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + + +public class ServiceMembers { + + protected String type; + protected String name; + + // type + public String getType() { + return type; + } + + public void setType(String value) { + this.type = value; + } + + // transportProtocol + public String getName() { + return name; + } + + public void setName(String value) { + this.name = value; + } + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServicesJson.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServicesJson.java new file mode 100644 index 000000000..c64af9a3c --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServicesJson.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +public class ServicesJson { + + protected String type; + protected String name; + // type + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String value) { + this.name = value; + } +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/TagDefines.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/TagDefines.java new file mode 100644 index 000000000..0af88912a --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/TagDefines.java @@ -0,0 +1,41 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP-REST + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + +public class TagDefines { + String key; + String value; + + public String getKey() { + return key; + } + public void setKey(String key) { + this.key = key; + } + public String getValue() { + return value; + } + public void setValue(String value) { + this.value = value; + } + + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/Tags.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/Tags.java new file mode 100644 index 000000000..8fec46482 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/Tags.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP-REST + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + +import java.util.List; + + +public class Tags { + String ruleName; + List tags; + String tagPickerName; + + public String getRuleName() { + return ruleName; + } + public void setRuleName(String ruleName) { + this.ruleName = ruleName; + } + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } + public String getTagPickerName() { + return tagPickerName; + } + + public void setTagPickerName(String tagPickerName) { + this.tagPickerName = tagPickerName; + } + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/Term.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/Term.java new file mode 100644 index 000000000..e5e0a7b00 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/Term.java @@ -0,0 +1,201 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + + +public class Term { + + String position; + protected String ruleName; + protected List fromZones; + protected List toZones; + protected boolean negateSource; //hardcoded + protected boolean negateDestination; //hardcoded + protected List sourceList; + protected List destinationList; + protected List sourceServices; + protected Set destServices; + protected String action; + protected String description; + boolean enabled; //hardcoded + boolean log; //hardcoded + + //position + public String getPosition() { + return position; + } + + public void setPosition(String value) { + this.position = value; + } + + //RuleName + public String getRuleName() { + return ruleName; + } + + public void setRuleName(String value) { + this.ruleName = value; + } + + //From Zone + public List getFromZones() { + if (fromZones==null) + { + fromZones= new ArrayList(); + } + return fromZones; + } + + public void setFromZones(List fromZones) { + this.fromZones = fromZones; + } + + //To Zone + public List getToZones() { + if (toZones==null) + { + toZones= new ArrayList(); + } + return toZones; + } + + public void setToZones(List toZones) { + this.toZones = toZones; + } + + + //Negate Source + public boolean getNegateSource() { + return negateSource; + } + + public void setNegateSource(boolean negateSource) { + this.negateSource = negateSource; + } + + //Negate Destination + public boolean getNegateDestination() { + return negateDestination; + } + + public void setNegateDestination(boolean negateDestination) { + this.negateDestination = negateDestination; + } + + //SourceList + public List getSourceList() + { + if(sourceList==null) + { + sourceList= new ArrayList(); + } + return this.sourceList; + } + + public void setSourceList(List srcList) { + this.sourceList = srcList; + } + + //Destination List + public List getDestinationList() + { + if(destinationList==null) + { + destinationList= new ArrayList(); + } + return this.destinationList; + } + + public void setDestinationList(List destList) { + this.destinationList = destList; + } + + //Source Services + public List getSourceServices() { + if(sourceServices==null) + { + sourceServices= new ArrayList(); + } + return this.sourceServices; + } + + public void setSourceServices(List sourceServices) { + this.sourceServices = sourceServices; + } + + //Destination services. + public Set getDestServices() { + if(destServices==null) + { + destServices= new HashSet(); + } + return this.destServices; + } + + public void setDestServices(Set destServices) { + this.destServices = destServices; + } + + //Action + public String getAction() { + return action; + } + + public void setAction(String value) { + this.action = value; + } + + //description + public String getDescription() { + return description; + } + + public void setDescription(String desc) { + this.description = desc; + } + + //enabled + public boolean getEnabled() { + return enabled; + } + + public void setEnabled(boolean value) { + this.enabled = value; + } + + //Log + public boolean getLog() { + return log; + } + + public void setLog(boolean value) { + this.log = value; + } + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/TermCollector.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/TermCollector.java new file mode 100644 index 000000000..26853d360 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/TermCollector.java @@ -0,0 +1,141 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.adapter; + + + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + + +public class TermCollector { + String serviceTypeId; + String configName; + DeployNowJson deploymentOption; + String securityZoneId; + + protected Set serviceGroups; + protected Set addressGroups; + protected List firewallRuleList; + + private String primaryParentZoneId; + + protected List ruleToTag; + + public List getRuleToTag() { + return ruleToTag; + } + + public void setRuleToTag(List ruleToTag) { + this.ruleToTag = ruleToTag; + } + + //SecurityTypeId + public String getServiceTypeId() { + return serviceTypeId; + } + + public void setServiceTypeId(String serviceTypeId) { + this.serviceTypeId = serviceTypeId; + } + + //ConfigName + public String getConfigName() { + return configName; + } + + public void setConfigName(String configName) { + this.configName = configName; + } + + //DeploymentControl + public DeployNowJson getDeploymentOption() { + return deploymentOption; + } + + public void setDeploymentOption(DeployNowJson deploymentOption) { + this.deploymentOption = deploymentOption; + } + + //SecurityZoneId + public String getSecurityZoneId() { + return securityZoneId; + } + public void setSecurityZoneId(String securityZoneId) { + this.securityZoneId = securityZoneId; + } + + + //ServiceGroup + public Set getServiceGroups() { + if(serviceGroups==null) + { + serviceGroups= new HashSet(); + } + return this.serviceGroups; + } + + public void setServiceGroups(Set servListArray) { + this.serviceGroups = servListArray; + } + + //AddressGroup + public Set getAddressGroups() { + if(addressGroups==null) + { + addressGroups= new HashSet(); + } + return this.addressGroups; + } + + public void setAddressGroups(Set addressGroups) { + this.addressGroups = addressGroups; + } + + //FirewallRuleList + public List getFirewallRuleList() { + + if(firewallRuleList==null) + { + firewallRuleList= new ArrayList(); + } + return this.firewallRuleList; + } + + public void setFirewallRuleList(List firewallRuleList) { + this.firewallRuleList = firewallRuleList; + } + + + //primaryParentZoneId + public String getPrimaryParentZoneId() { + return primaryParentZoneId; + } + + public void setPrimaryParentZoneId(String primaryParentZoneId) { + this.primaryParentZoneId = primaryParentZoneId; + } + + + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/package-info.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/package-info.java new file mode 100644 index 000000000..a78bbf203 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/package-info.java @@ -0,0 +1,20 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP-REST + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.openecomp.policy.rest.adapter; \ No newline at end of file diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ActionListDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ActionListDao.java deleted file mode 100644 index b8aa2948a..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ActionListDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.ActionList; - -public interface ActionListDao { - List getActionListData(); - List getActionListDataByName(); - void Save(ActionList actionList); - void delete(ActionList actionList); - void update(ActionList actionList); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ActionPolicyDictDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ActionPolicyDictDao.java deleted file mode 100644 index c4914eb47..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ActionPolicyDictDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.ActionPolicyDict; - -public interface ActionPolicyDictDao { - List getActionDictData(); - List getActionDictDataByName(); - ActionPolicyDict getActionEntityDatabyId(String action); - void Save(ActionPolicyDict action); - void delete(ActionPolicyDict action); - void update(ActionPolicyDict action); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/AddressGroupDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/AddressGroupDao.java deleted file mode 100644 index c4c7002b3..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/AddressGroupDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.AddressGroup; - -public interface AddressGroupDao { - List getAddressGroupData(); - List getAddressGroupDataByName(); - void Save(AddressGroup addressGroup); - void delete(AddressGroup addressGroup); - void update(AddressGroup addressGroup); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/AttributeDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/AttributeDao.java deleted file mode 100644 index 796157f62..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/AttributeDao.java +++ /dev/null @@ -1,35 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.Attribute; - -public interface AttributeDao { - - List getData(); - List getAttributeData(); - void Save(Attribute attribute); - void delete(Attribute attribute); - void update(Attribute attribute); - -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/BRMSParamTemplateDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/BRMSParamTemplateDao.java deleted file mode 100644 index 2c03192c0..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/BRMSParamTemplateDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.BRMSParamTemplate; - -public interface BRMSParamTemplateDao { - List getBRMSParamTemplateData(); - List getBRMSParamDataByName(); - void Save(BRMSParamTemplate brmsParam); - void delete(BRMSParamTemplate brmsParam); - void update(BRMSParamTemplate brmsParam); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/CategoryDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/CategoryDao.java deleted file mode 100644 index e90aa1d8b..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/CategoryDao.java +++ /dev/null @@ -1,29 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.Category; - -public interface CategoryDao { - List getCategoryListData(); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/CommonClassDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/CommonClassDao.java new file mode 100644 index 000000000..3d0da0e6b --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/CommonClassDao.java @@ -0,0 +1,57 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP-REST + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.dao; + +import java.util.List; + +import org.openecomp.policy.rest.jpa.PolicyRoles; + +public interface CommonClassDao { + + //Common methods + List getData(@SuppressWarnings("rawtypes") Class className); + List getDataById(@SuppressWarnings("rawtypes") Class className, String columnName, String key); + List getDataByColumn(@SuppressWarnings("rawtypes") Class className, String columnName); + List checkDuplicateEntry(String value, String columnName, @SuppressWarnings("rawtypes") Class className); + Object getEntityItem(@SuppressWarnings("rawtypes") Class className, String columnName, String key); + List getDataByQuery(String query); + List getMultipleDataOnAddingConjunction(@SuppressWarnings("rawtypes") Class className, String columnName, List data); + void save(Object entity); + void delete(Object entity); + void update(Object entity); + void updateQuery(String query); + + //Group Policy Scope + List checkExistingGroupListforUpdate(String groupListValue, String groupNameValue); + + + //Roles + List getUserRoles(); + + + //ClosedLoops + void updateClAlarms(String clName, String alarms); + void updateClYaml(String clName, String yaml); + void deleteAll(); + + + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/DCAEUUIDDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/DCAEUUIDDao.java deleted file mode 100644 index 418d77629..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/DCAEUUIDDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.DCAEuuid; - -public interface DCAEUUIDDao { - List getDCAEuuidData(); - List getDCAEuuidDataByName(); - void Save(DCAEuuid dcaeUUID); - void delete(DCAEuuid dcaeUUID); - void update(DCAEuuid dcaeUUID); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/DecisionPolicyDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/DecisionPolicyDao.java deleted file mode 100644 index 372a1fb7c..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/DecisionPolicyDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.DecisionSettings; - -public interface DecisionPolicyDao { - List getDecisionSettingsData(); - List getDecisionDataByName(); - void Save(DecisionSettings decisionSettings); - void delete(DecisionSettings decisionSettings); - void update(DecisionSettings decisionSettings); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/DescriptiveScopeDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/DescriptiveScopeDao.java deleted file mode 100644 index b0001390e..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/DescriptiveScopeDao.java +++ /dev/null @@ -1,35 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.DescriptiveScope; - -public interface DescriptiveScopeDao { - - List getDescriptiveScope(); - List getDescriptiveScopeDataByName(); - void Save(DescriptiveScope descriptiveScope); - void delete(DescriptiveScope descriptiveScope); - void update(DescriptiveScope descriptiveScope); - DescriptiveScope getDescriptiveScopeById(String name); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/EcompNameDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/EcompNameDao.java deleted file mode 100644 index 420121883..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/EcompNameDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.EcompName; - -public interface EcompNameDao { - List getEcompName(); - List getEcompNameDataByName(); - void Save(EcompName ecompName); - void delete(EcompName ecompName); - void update(EcompName ecompName); - -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/EnforcerPolicyDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/EnforcerPolicyDao.java deleted file mode 100644 index 55f4bf599..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/EnforcerPolicyDao.java +++ /dev/null @@ -1,32 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.EnforcingType; - -public interface EnforcerPolicyDao { - List getEnforcingTypeData(); - void Save(EnforcingType enforcingType); - void delete(EnforcingType enforcingType); - void update(EnforcingType enforcingType); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/FirewallDictionaryListDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/FirewallDictionaryListDao.java deleted file mode 100644 index 76cb1bc1f..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/FirewallDictionaryListDao.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.FirewallDictionaryList; - - -public interface FirewallDictionaryListDao { - List getFWDictionaryListData(); - List getFWDictionaryListDataByName(); - void Save(FirewallDictionaryList firewallDictionaryList); - void delete(FirewallDictionaryList firewallDictionaryList); - void update(FirewallDictionaryList firewallDictionaryList); - void updateQuery(String query); - FirewallDictionaryList getFWDictionaryDataById(String value); -} - diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/GroupPolicyScopeListDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/GroupPolicyScopeListDao.java deleted file mode 100644 index fdab28a0f..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/GroupPolicyScopeListDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.GroupPolicyScopeList; - -public interface GroupPolicyScopeListDao{ - List getGroupPolicyScopeListData(); - List getGroupPolicyScopeListDataByName(); - void Save(GroupPolicyScopeList attribute); - void delete(GroupPolicyScopeList attribute); - void update(GroupPolicyScopeList attribute); - List CheckDuplicateEntry(String value); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/MicroServiceConfigNameDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/MicroServiceConfigNameDao.java deleted file mode 100644 index f0321031c..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/MicroServiceConfigNameDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.MicroServiceConfigName; - -public interface MicroServiceConfigNameDao { - List getMicroServiceConfigNameData(); - List getMSConfigDataByName(); - void Save(MicroServiceConfigName microServiceConfigName); - void delete(MicroServiceConfigName microServiceConfigName); - void update(MicroServiceConfigName microServiceConfigName); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/MicroServiceLocationDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/MicroServiceLocationDao.java deleted file mode 100644 index fdb9c559e..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/MicroServiceLocationDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.MicroServiceLocation; - -public interface MicroServiceLocationDao { - List getMicroServiceLocationData(); - List getMSLocationDataByName(); - void Save(MicroServiceLocation microServiceLocation); - void delete(MicroServiceLocation microServiceLocation); - void update(MicroServiceLocation microServiceLocation); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/MicroServiceModelsDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/MicroServiceModelsDao.java deleted file mode 100644 index 0a56edd2c..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/MicroServiceModelsDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.MicroServiceModels; - -public interface MicroServiceModelsDao { - List getMicroServiceModelsData(); - List getMSModelsDataByName(); - void Save(MicroServiceModels microServiceModels); - void delete(MicroServiceModels microServiceModels); - void update(MicroServiceModels microServiceModels); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PEPOptionsDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PEPOptionsDao.java deleted file mode 100644 index d1bbf2a1a..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PEPOptionsDao.java +++ /dev/null @@ -1,35 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.PEPOptions; - - - -public interface PEPOptionsDao { - List getPEPOptionsData(); - List getPEPOptionsDataByName(); - void Save(PEPOptions pepOptions); - void delete(PEPOptions pepOptions); - void update(PEPOptions pepOptions); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeClosedLoopDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeClosedLoopDao.java deleted file mode 100644 index 7730adacb..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeClosedLoopDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.PolicyScopeClosedLoop; - -public interface PolicyScopeClosedLoopDao { - List getPolicyScopeClosedLoopData(); - List getPolicyScopeClosedLoopDataByName(); - void Save(PolicyScopeClosedLoop attribute); - void delete(PolicyScopeClosedLoop attribute); - void update(PolicyScopeClosedLoop attribute); - List CheckDuplicateEntry(String value); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeResourceDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeResourceDao.java deleted file mode 100644 index 4ff88fed8..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeResourceDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.PolicyScopeResource; - -public interface PolicyScopeResourceDao { - List getPolicyScopeResourceData(); - List getPolicyScopeResourceDataByName(); - void Save(PolicyScopeResource attribute); - void delete(PolicyScopeResource attribute); - void update(PolicyScopeResource attribute); - List CheckDuplicateEntry(String value); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeServiceDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeServiceDao.java deleted file mode 100644 index 2a5c8c565..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeServiceDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.PolicyScopeService; - -public interface PolicyScopeServiceDao { - List getPolicyScopeServiceData(); - List getPolicyScopeServiceDataByName(); - void Save(PolicyScopeService attribute); - void delete(PolicyScopeService attribute); - void update(PolicyScopeService attribute); - List CheckDuplicateEntry(String value); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeTypeDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeTypeDao.java deleted file mode 100644 index e49f84cec..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PolicyScopeTypeDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.PolicyScopeType; - -public interface PolicyScopeTypeDao { - List getPolicyScopeTypeData(); - List getPolicyScopeTypeDataByName(); - void Save(PolicyScopeType attribute); - void delete(PolicyScopeType attribute); - void update(PolicyScopeType attribute); - List CheckDuplicateEntry(String value); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PortListDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PortListDao.java deleted file mode 100644 index 461387f4a..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PortListDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.PortList; - -public interface PortListDao { - List getPortListData(); - List getPortListDataByName(); - void Save(PortList portList); - void delete(PortList portList); - void update(PortList portList); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PrefixListDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PrefixListDao.java deleted file mode 100644 index 29571dddb..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/PrefixListDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.PREFIXLIST; - -public interface PrefixListDao { - List getPREFIXLISTData(); - List getPrefixListDataByName(); - void Save(PREFIXLIST prefixList); - void delete(PREFIXLIST prefixList); - void update(PREFIXLIST prefixList); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ProtocolListDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ProtocolListDao.java deleted file mode 100644 index 11956ee94..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ProtocolListDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.ProtocolList; - -public interface ProtocolListDao { - List getProtocolListData(); - List getProtocolListDataByName(); - void Save(ProtocolList protocolList); - void delete(ProtocolList protocolList); - void update(ProtocolList protocolList); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/RiskTypeDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/RiskTypeDao.java deleted file mode 100644 index 6c14928d8..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/RiskTypeDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.RiskType; - -public interface RiskTypeDao { - List getRiskName(); - List getRiskTypeDataByName(); - void Save(RiskType riskName); - void delete(RiskType riskName); - void update(RiskType riskName); - -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/SafePolicyWarningDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/SafePolicyWarningDao.java deleted file mode 100644 index 3812f9470..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/SafePolicyWarningDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.SafePolicyWarning; - -public interface SafePolicyWarningDao{ - List getSafePolicyWarningData(); - List getSafePolicyWarningDataByName(); - void Save(SafePolicyWarning attribute); - void delete(SafePolicyWarning attribute); - void update(SafePolicyWarning attribute); - SafePolicyWarning getSafePolicyWarningDataById(String riskType); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/SecurityZoneDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/SecurityZoneDao.java deleted file mode 100644 index 4367023b5..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/SecurityZoneDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.SecurityZone; - -public interface SecurityZoneDao { - List getSecurityZoneData(); - List getSecurityZoneDataByName(); - void Save(SecurityZone securityZone); - void delete(SecurityZone securityZone); - void update(SecurityZone securityZone); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ServiceDictionaryDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ServiceDictionaryDao.java deleted file mode 100644 index a756f3234..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ServiceDictionaryDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.ClosedLoopD2Services; - -public interface ServiceDictionaryDao { - List getClosedLoopD2ServicesData(); - List getCLServiceDictDataByName(); - void Save(ClosedLoopD2Services closedLoopD2Services); - void delete(ClosedLoopD2Services closedLoopD2Services); - void update(ClosedLoopD2Services closedLoopD2Services); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ServiceGroupDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ServiceGroupDao.java deleted file mode 100644 index 678c6426a..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ServiceGroupDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.GroupServiceList; - -public interface ServiceGroupDao { - List getGroupServiceListData(); - List getGroupServiceDataByName(); - void Save(GroupServiceList groupServiceList); - void delete(GroupServiceList groupServiceList); - void update(GroupServiceList groupServiceList); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ServiceListDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ServiceListDao.java deleted file mode 100644 index 116f9cb17..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ServiceListDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.ServiceList; - - -public interface ServiceListDao { - List getServiceListData(); - List getServiceListDataByName(); - void Save(ServiceList serviceList); - void delete(ServiceList serviceList); - void update(ServiceList serviceList); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/SiteDictionaryDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/SiteDictionaryDao.java deleted file mode 100644 index 21cae69b9..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/SiteDictionaryDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.ClosedLoopSite; - -public interface SiteDictionaryDao { - List getClosedLoopSiteData(); - List getCLSiteDataByName(); - void Save(ClosedLoopSite closedLoopSite); - void delete(ClosedLoopSite closedLoopSite); - void update(ClosedLoopSite closedLoopSite); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/TermListDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/TermListDao.java deleted file mode 100644 index c2c81cfd8..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/TermListDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.TermList; - -public interface TermListDao { - List getTermListData(); - List getTermListDataByName(); - void Save(TermList termList); - void delete(TermList termList); - void update(TermList termList); - TermList getTermListValueByName(String name); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/UserInfoDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/UserInfoDao.java deleted file mode 100644 index a144a463f..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/UserInfoDao.java +++ /dev/null @@ -1,32 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.UserInfo; - -public interface UserInfoDao { - void save(UserInfo userInfo); - List getUserInfo(); - UserInfo getUserInfoByLoginId(String loginid); - String getUserName(String loginid); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/VNFTypeDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/VNFTypeDao.java deleted file mode 100644 index ff68a4065..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/VNFTypeDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.VNFType; - -public interface VNFTypeDao { - List getVNFTypeData(); - List getVNFTypeDataByName(); - void Save(VNFType vnfType); - void delete(VNFType vnfType); - void update(VNFType vnfType); - -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/VSCLActionDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/VSCLActionDao.java deleted file mode 100644 index 3d0245555..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/VSCLActionDao.java +++ /dev/null @@ -1,35 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.VSCLAction; - - - -public interface VSCLActionDao { - List getVSCLActionData(); - List getVsclActionDataByName(); - void Save(VSCLAction vSCLAction); - void delete(VSCLAction vSCLAction); - void update(VSCLAction vSCLAction); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/VarbindDictionaryDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/VarbindDictionaryDao.java deleted file mode 100644 index f3153f6df..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/VarbindDictionaryDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.VarbindDictionary; - -public interface VarbindDictionaryDao { - List getVarbindDictionaryData(); - List getVarbindEntityByName(String value); - List getVarbindDataByName(); - void Save(VarbindDictionary varbindDictionary); - void delete(VarbindDictionary varbindDictionary); - void update(VarbindDictionary varbindDictionary); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ZoneDao.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ZoneDao.java deleted file mode 100644 index df318e167..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/ZoneDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.dao; - -import java.util.List; - -import org.openecomp.policy.rest.jpa.Zone; - -public interface ZoneDao { - List getZoneData(); - List getZoneDataByName(); - void Save(Zone zone); - void delete(Zone zone); - void update(Zone zone); -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/package-info.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/package-info.java index c9f449f4f..84cd76a92 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/package-info.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/dao/package-info.java @@ -18,10 +18,4 @@ * ============LICENSE_END========================================================= */ -/** - * - */ -/** - * - */ package org.openecomp.policy.rest.dao; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ActionBodyEntity.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ActionBodyEntity.java index d12f6b3e1..bda58b607 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ActionBodyEntity.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ActionBodyEntity.java @@ -33,7 +33,6 @@ import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; -import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; @@ -50,13 +49,11 @@ import com.fasterxml.jackson.annotation.JsonBackReference; @NamedQuery(name=" ActionBodyEntity.findAll", query="SELECT e FROM ActionBodyEntity e "), @NamedQuery(name="ActionBodyEntity.deleteAll", query="DELETE FROM ActionBodyEntity WHERE 1=1") }) -//@SequenceGenerator(name="seqActBody", initialValue=1, allocationSize=1) public class ActionBodyEntity implements Serializable { private static final long serialVersionUID = 1L; @Id - //@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="seqActBody") @GeneratedValue(strategy = GenerationType.AUTO) @Column(name="actionBodyId") @JsonBackReference diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ActionList.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ActionList.java index 0176c17be..0fea71a1c 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ActionList.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ActionList.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,8 +33,6 @@ import javax.persistence.OrderBy; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; @Entity @Table(name="actionlist") diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ActionPolicyDict.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ActionPolicyDict.java index fa7d2af95..f6c8965d2 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ActionPolicyDict.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ActionPolicyDict.java @@ -44,12 +44,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.openecomp.policy.rest.XacmlAdminAuthorization; -import org.openecomp.policy.common.logging.eelf.MessageCodes; -import org.openecomp.policy.common.logging.eelf.PolicyLogger; @Entity @Table(name="ActionPolicyDict") -//@NamedQuery(name="ActionPolicyDict.findAll", query="SELECT e FROM ActionPolicyDict e ") @NamedQueries({ @NamedQuery(name="ActionPolicyDict.findAll", query="SELECT e FROM ActionPolicyDict e") }) @@ -144,8 +141,7 @@ public class ActionPolicyDict implements Serializable { this.userModifiedBy =XacmlAdminAuthorization.getUserId();; } catch (Exception e) { logger.error("Exception caused While adding Modified by Role"+e); - // TODO:EELF Cleanup - Remove logger - PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "ActionPolicyDict", "Exception caused While adding Modified by Role"); + //PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "ActionPolicyDict", "Exception caused While adding Modified by Role"); } } public int getId() { diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/AddressGroup.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/AddressGroup.java index 6418d6bc5..1b6430c21 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/AddressGroup.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/AddressGroup.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Attribute.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Attribute.java index e79126ae2..184b4f80b 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Attribute.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Attribute.java @@ -46,13 +46,8 @@ import javax.persistence.Transient; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.openecomp.policy.rest.XacmlAdminAuthorization; -import org.openecomp.policy.rest.jpa.UserInfo; -import com.att.research.xacml.api.Identifier; -import com.att.research.xacml.std.IdentifierImpl; -import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonManagedReference; /** * The persistent class for the Attribute database table. @@ -156,7 +151,7 @@ public class Attribute implements Serializable { this.userModifiedBy = userModifiedBy; } - private static Log logger = LogFactory.getLog(Attribute.class); + private static Log LOGGER = LogFactory.getLog(Attribute.class); public Attribute() { } @@ -194,9 +189,7 @@ public class Attribute implements Serializable { try { this.userModifiedBy = XacmlAdminAuthorization.getUserId(); } catch (Exception e) { - logger.error("Exception caused While adding Modified by Role"+e); - // TODO:EELF Cleanup - Remove logger - //PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "Attribute", "Exception caused While adding Modified by Role"); + LOGGER.error("Exception caused While adding Modified by Role"+e); } } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/BRMSController.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/BRMSController.java new file mode 100644 index 000000000..afa6d94cf --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/BRMSController.java @@ -0,0 +1,154 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP-REST + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.jpa; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQuery; +import javax.persistence.OrderBy; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@Table(name="BRMSController") +@NamedQuery(name="BRMSController.findAll", query="SELECT b from BRMSController b ") +public class BRMSController implements Serializable{ + private static final long serialVersionUID = -8666947569754164177L; + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name="id") + private int id; + + @Column(name="controller_name", nullable=false, length=1024, unique=true) + @OrderBy("asc") + private String controllerName; + + @Column(name="description", nullable=true, length=1024) + private String description; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name="created_date", updatable=false) + private Date createdDate; + + @ManyToOne(optional = false) + @JoinColumn(name="created_by") + private UserInfo userCreatedBy; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name="modified_date", nullable=false) + private Date modifiedDate; + + @ManyToOne(optional = false) + @JoinColumn(name="modified_by") + private UserInfo userModifiedBy; + + @Column(name="controller", nullable=false) + private String controller; + + @PrePersist + public void prePersist() { + Date date = new Date(); + this.createdDate = date; + this.modifiedDate = date; + } + + @PreUpdate + public void preUpdate() { + this.modifiedDate = new Date(); + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public UserInfo getUserCreatedBy() { + return userCreatedBy; + } + + public void setUserCreatedBy(UserInfo userCreatedBy) { + this.userCreatedBy = userCreatedBy; + } + + public Date getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(Date modifiedDate) { + this.modifiedDate = modifiedDate; + } + + public UserInfo getUserModifiedBy() { + return userModifiedBy; + } + + public void setUserModifiedBy(UserInfo userModifiedBy) { + this.userModifiedBy = userModifiedBy; + } + + public String getController() { + return controller; + } + + public void setController(String controller) { + this.controller = controller; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getControllerName() { + return controllerName; + } + + public void setControllerName(String controllerName) { + this.controllerName = controllerName; + } + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/BRMSDependency.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/BRMSDependency.java new file mode 100644 index 000000000..9c4406948 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/BRMSDependency.java @@ -0,0 +1,153 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP-REST + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.jpa; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQuery; +import javax.persistence.OrderBy; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@Table(name="BRMSDependency") +@NamedQuery(name="BRMSDependency.findAll", query="SELECT b from BRMSDependency b ") +public class BRMSDependency implements Serializable{ + private static final long serialVersionUID = -7005622785653160761L; + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name="id") + private int id; + + @Column(name="dependency_name", nullable=false, length=1024, unique=true) + @OrderBy("asc") + private String dependencyName; + + @Column(name="description", nullable=true, length=1024) + private String description; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name="created_date", updatable=false) + private Date createdDate; + + @ManyToOne(optional = false) + @JoinColumn(name="created_by") + private UserInfo userCreatedBy; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name="modified_date", nullable=false) + private Date modifiedDate; + + @ManyToOne(optional = false) + @JoinColumn(name="modified_by") + private UserInfo userModifiedBy; + + @Column(name="dependency", nullable=false) + private String dependency; + + @PrePersist + public void prePersist() { + Date date = new Date(); + this.createdDate = date; + this.modifiedDate = date; + } + + @PreUpdate + public void preUpdate() { + this.modifiedDate = new Date(); + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public UserInfo getUserCreatedBy() { + return userCreatedBy; + } + + public void setUserCreatedBy(UserInfo userCreatedBy) { + this.userCreatedBy = userCreatedBy; + } + + public Date getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(Date modifiedDate) { + this.modifiedDate = modifiedDate; + } + + public UserInfo getUserModifiedBy() { + return userModifiedBy; + } + + public void setUserModifiedBy(UserInfo userModifiedBy) { + this.userModifiedBy = userModifiedBy; + } + + public String getDependency() { + return dependency; + } + + public void setDependency(String dependency) { + this.dependency = dependency; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getDependencyName() { + return dependencyName; + } + + public void setDependencyName(String dependencyName) { + this.dependencyName = dependencyName; + } +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Category.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Category.java index abc06879d..1f4243304 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Category.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Category.java @@ -38,7 +38,6 @@ import com.att.research.xacml.api.Identifier; import com.att.research.xacml.api.XACML3; import com.att.research.xacml.std.IdentifierImpl; import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonIgnore; /** diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ClosedLoopD2Services.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ClosedLoopD2Services.java index 408190ac9..391ed9714 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ClosedLoopD2Services.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ClosedLoopD2Services.java @@ -42,10 +42,9 @@ import javax.persistence.TemporalType; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.openecomp.policy.rest.XacmlAdminAuthorization; - import org.openecomp.policy.common.logging.eelf.MessageCodes; import org.openecomp.policy.common.logging.eelf.PolicyLogger; +import org.openecomp.policy.rest.XacmlAdminAuthorization; @Entity @@ -101,7 +100,7 @@ public class ClosedLoopD2Services implements Serializable{ this.userModifiedBy = userModifiedBy; } - private static Log logger = LogFactory.getLog(ClosedLoopD2Services.class); + private static Log LOGGER = LogFactory.getLog(ClosedLoopD2Services.class); public ClosedLoopD2Services(){ @@ -128,8 +127,7 @@ public class ClosedLoopD2Services implements Serializable{ try { this.userModifiedBy = XacmlAdminAuthorization.getUserId();; } catch (Exception e) { - logger.error("Exception caused While adding Modified by Role"+e); - // TODO:EELF Cleanup - Remove logger + LOGGER.error("Exception caused While adding Modified by Role"+e); PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "ClosedLoopD2Services", "Exception caused While adding Modified by Role"); } } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ClosedLoopSite.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ClosedLoopSite.java index b32091307..fd8b295b9 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ClosedLoopSite.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ClosedLoopSite.java @@ -102,7 +102,7 @@ public class ClosedLoopSite implements Serializable{ this.userModifiedBy = userModifiedBy; } - private static Log logger = LogFactory.getLog(ClosedLoopSite.class); + private static Log LOGGER = LogFactory.getLog(ClosedLoopSite.class); public ClosedLoopSite(){ @@ -129,8 +129,7 @@ public class ClosedLoopSite implements Serializable{ try { this.userModifiedBy = XacmlAdminAuthorization.getUserId();; } catch (Exception e) { - logger.error("Exception caused While adding Modified by Role"+e); - // TODO:EELF Cleanup - Remove logger + LOGGER.error("Exception caused While adding Modified by Role"+e); PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "ClosedLoopSite", "Exception caused While adding Modified by Role"); } } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ClosedLoops.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ClosedLoops.java new file mode 100644 index 000000000..5732832c6 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ClosedLoops.java @@ -0,0 +1,99 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP-REST + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.jpa; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OrderBy; +import javax.persistence.Table; + +@Entity +@Table(name="ClosedLoops") +@NamedQueries({ + @NamedQuery(name="ClosedLoops.findAll", query="SELECT e FROM ClosedLoops e"), + @NamedQuery(name="ClosedLoops.deleteAll", query="DELETE FROM ClosedLoops WHERE 1=1") +}) +public class ClosedLoops implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -7796845092457926842L; + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name="id") + private int id; + + @Column(name="closedLoopControlName", nullable=false, length=255) + @OrderBy("asc") + private String closedLoopControlName; + + @Column(name="alarmConditions", nullable=true, length=255) + private String alarmConditions; + + @Column(name="yaml", nullable=true, length=1028) + private String yaml; + + public ClosedLoops() { + + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getClosedLoopControlName() { + return closedLoopControlName; + } + + public void setClosedLoopControlName(String closedLoopControlName) { + this.closedLoopControlName = closedLoopControlName; + } + + public String getAlarmConditions() { + return alarmConditions; + } + + public void setAlarmConditions(String alarmConditions) { + this.alarmConditions = alarmConditions; + } + + public String getYaml() { + return yaml; + } + + public void setYaml(String yaml) { + this.yaml = yaml; + } + +} \ No newline at end of file diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ConfigurationDataEntity.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ConfigurationDataEntity.java index 71a6d6fb7..bf42a7788 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ConfigurationDataEntity.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ConfigurationDataEntity.java @@ -34,7 +34,6 @@ import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; -import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; @@ -51,13 +50,11 @@ import com.fasterxml.jackson.annotation.JsonBackReference; @NamedQuery(name="ConfigurationDataEntity.findAll", query="SELECT e FROM ConfigurationDataEntity e "), @NamedQuery(name="ConfigurationDataEntity.deleteAll", query="DELETE FROM ConfigurationDataEntity WHERE 1=1") }) -//@SequenceGenerator(name="seqConfig", initialValue=1, allocationSize=1) public class ConfigurationDataEntity implements Serializable { private static final long serialVersionUID = 1L; @Id - //@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="seqConfig") @GeneratedValue(strategy = GenerationType.AUTO) @Column(name="configurationDataId") @JsonBackReference diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DCAEUsers.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DCAEUsers.java index eb0c4cc1b..fdad24419 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DCAEUsers.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DCAEUsers.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DCAEuuid.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DCAEuuid.java index a71921b5e..9e7225fc7 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DCAEuuid.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DCAEuuid.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Datatype.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Datatype.java index b3922f10b..05e4fbc0c 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Datatype.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Datatype.java @@ -39,7 +39,6 @@ import com.att.research.xacml.api.XACML3; import com.att.research.xacml.std.IdentifierImpl; import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonManagedReference; /** diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DecisionSettings.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DecisionSettings.java index 1d90af679..2d3e5b58a 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DecisionSettings.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DecisionSettings.java @@ -39,16 +39,9 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.Transient; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.openecomp.policy.rest.XacmlAdminAuthorization; - -import com.att.research.xacml.api.Identifier; -import com.att.research.xacml.std.IdentifierImpl; -import com.fasterxml.jackson.annotation.JsonManagedReference; - import org.openecomp.policy.common.logging.eelf.MessageCodes; import org.openecomp.policy.common.logging.eelf.PolicyLogger; +import org.openecomp.policy.rest.XacmlAdminAuthorization; @Entity @@ -115,8 +108,7 @@ public class DecisionSettings implements Serializable { public void setUserModifiedBy(UserInfo userModifiedBy) { this.userModifiedBy = userModifiedBy; } - - private static Log logger = LogFactory.getLog(DecisionSettings.class); + public DecisionSettings() { } @@ -139,7 +131,7 @@ public class DecisionSettings implements Serializable { } public String setDecisionSettings(){ - return this.xacmlId = xacmlId; + return this.xacmlId; } @PrePersist public void prePersist() { @@ -154,8 +146,6 @@ public class DecisionSettings implements Serializable { try { this.userModifiedBy = XacmlAdminAuthorization.getUserId();; } catch (Exception e) { - logger.error("Exception caused While adding Modified by Role"+e); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "DecisionSettings", "Exception caused While adding Modified by Role"); } } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DescriptiveScope.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DescriptiveScope.java index 9f751f7c0..d4719cf41 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DescriptiveScope.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/DescriptiveScope.java @@ -99,7 +99,7 @@ public class DescriptiveScope implements Serializable { this.userModifiedBy = userModifiedBy; } - private static Log logger = LogFactory.getLog(DescriptiveScope.class); + private static Log LOGGER = LogFactory.getLog(DescriptiveScope.class); public DescriptiveScope(){ @@ -126,8 +126,7 @@ public class DescriptiveScope implements Serializable { try { this.userModifiedBy =XacmlAdminAuthorization.getUserId();; } catch (Exception e) { - logger.error("Exception caused While adding Modified by Role"+e); - // TODO:EELF Cleanup - Remove logger + LOGGER.error("Exception caused While adding Modified by Role"+e); PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "DescriptiveScope", "Exception caused While adding Modified by Role"); } } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/EcompName.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/EcompName.java index 599e47818..09dcd4738 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/EcompName.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/EcompName.java @@ -39,16 +39,9 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.openecomp.policy.rest.XacmlAdminAuthorization; -import org.openecomp.policy.rest.jpa.UserInfo; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonManagedReference; - import org.openecomp.policy.common.logging.eelf.MessageCodes; import org.openecomp.policy.common.logging.eelf.PolicyLogger; +import org.openecomp.policy.rest.XacmlAdminAuthorization; @Entity @@ -102,8 +95,6 @@ public class EcompName implements Serializable { public void setUserModifiedBy(UserInfo userModifiedBy) { this.userModifiedBy = userModifiedBy; } - - private static Log logger = LogFactory.getLog(EcompName.class); public EcompName() { @@ -130,8 +121,6 @@ public class EcompName implements Serializable { try { this.userModifiedBy =XacmlAdminAuthorization.getUserId(); } catch (Exception e) { - logger.error("Exception caused While adding Modified by Role"+e); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "EcompName", "Exception caused While adding Modified by Role"); } } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FWTag.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FWTag.java new file mode 100644 index 000000000..f10f6662c --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FWTag.java @@ -0,0 +1,180 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP-REST + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.jpa; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQuery; +import javax.persistence.OrderBy; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.openecomp.policy.common.logging.eelf.MessageCodes; +import org.openecomp.policy.common.logging.eelf.PolicyLogger; +import org.openecomp.policy.rest.XacmlAdminAuthorization; + +@Entity +@Table(name = "FWTag") +@NamedQuery(name = "FWTag.findAll", query= "Select p from FWTag p") +public class FWTag implements Serializable { + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "Id") + private int id; + + @Column(name="tagName", nullable=false) + @OrderBy("asc") + private String fwTagName; + + @Column(name="description", nullable=true, length=2048) + private String description; + + @Column(name="tagValues", nullable=true) + @OrderBy("asc") + private String tagValues; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name="created_date", updatable=false) + private Date createdDate; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name="modified_date", nullable=false) + private Date modifiedDate; + + @ManyToOne(optional = false) + @JoinColumn(name="created_by") + private UserInfo userCreatedBy; + + @ManyToOne(optional = false) + @JoinColumn(name="modified_by") + private UserInfo userModifiedBy; + + public UserInfo getUserCreatedBy() { + return userCreatedBy; + } + + public void setUserCreatedBy(UserInfo userCreatedBy) { + this.userCreatedBy = userCreatedBy; + } + + public UserInfo getUserModifiedBy() { + return userModifiedBy; + } + + public void setUserModifiedBy(UserInfo userModifiedBy) { + this.userModifiedBy = userModifiedBy; + } + + private static Log LOGGER = LogFactory.getLog(FWTag.class); + + public FWTag(){ + + } + + public FWTag(String string, String userid) { + this(string); + } + + public FWTag(String domain) { + this.fwTagName = domain; + } + + @PrePersist + public void prePersist() { + Date date = new Date(); + this.createdDate = date; + this.modifiedDate = date; + } + + @PreUpdate + public void preUpdate() { + this.modifiedDate = new Date(); + try { + this.userModifiedBy =XacmlAdminAuthorization.getUserId();; + } catch (Exception e) { + LOGGER.error("Exception caused While adding Modified by Role"+e); + PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "FWTag", "Exception caused While adding Modified by Role"); + } + } + + public int getId() { + return this.id; + } + public void setId(int id) { + this.id = id; + } + + public String getFwTagName() { + return fwTagName; + } + + public void setFwTagName(String fwTagName) { + this.fwTagName = fwTagName; + } + + public String getTagValues() { + return tagValues; + } + + public void setTagValues(String tagValues) { + this.tagValues = tagValues; + } + + + public Date getCreatedDate() { + return this.createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getModifiedDate() { + return this.modifiedDate; + } + + public void setModifiedDate(Date modifiedDate) { + this.modifiedDate = modifiedDate; + } + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FWTagPicker.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FWTagPicker.java new file mode 100644 index 000000000..129ad37df --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FWTagPicker.java @@ -0,0 +1,178 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP-REST + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.openecomp.policy.rest.jpa; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQuery; +import javax.persistence.OrderBy; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.openecomp.policy.common.logging.eelf.MessageCodes; +import org.openecomp.policy.common.logging.eelf.PolicyLogger; +import org.openecomp.policy.rest.XacmlAdminAuthorization; + +@Entity +@Table(name = "FWTagPicker") +@NamedQuery(name = "FWTagPicker.findAll", query= "Select p from FWTagPicker p") +public class FWTagPicker implements Serializable { + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "Id") + private int id; + + @Column(name="tagPickerName", nullable=false) + @OrderBy("asc") + private String tagPickerName; + + @Column(name="description", nullable=true, length=2048) + private String description; + + @Column(name="tags", nullable=true) + @OrderBy("asc") + private String tagValues; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name="created_date", updatable=false) + private Date createdDate; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name="modified_date", nullable=false) + private Date modifiedDate; + + @ManyToOne(optional = false) + @JoinColumn(name="created_by") + private UserInfo userCreatedBy; + + @ManyToOne(optional = false) + @JoinColumn(name="modified_by") + private UserInfo userModifiedBy; + + private static Log logger = LogFactory.getLog(FWTagPicker.class); + + public FWTagPicker(){ + + } + + public FWTagPicker(String string, String userid) { + this(string); + } + + public FWTagPicker(String domain) { + this.tagPickerName = domain; + } + + @PrePersist + public void prePersist() { + Date date = new Date(); + this.createdDate = date; + this.modifiedDate = date; + } + + @PreUpdate + public void preUpdate() { + this.modifiedDate = new Date(); + try { + this.userModifiedBy =XacmlAdminAuthorization.getUserId(); + } catch (Exception e) { + logger.error("Exception caused While adding Modified by Role"+e); + PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "DescriptiveScope", "Exception caused While adding Modified by Role"); + } + } + + public int getId() { + return this.id; + } + public void setId(int id) { + this.id = id; + } + + public String getTagPickerName() { + return tagPickerName; + } + + public void setTagPickerName(String tagPickerName) { + this.tagPickerName = tagPickerName; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getTagValues() { + return tagValues; + } + + public void setTagValues(String tagValues) { + this.tagValues = tagValues; + } + + public Date getCreatedDate() { + return this.createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public Date getModifiedDate() { + return this.modifiedDate; + } + + public void setModifiedDate(Date modifiedDate) { + this.modifiedDate = modifiedDate; + } + + public UserInfo getUserCreatedBy() { + return userCreatedBy; + } + + public void setUserCreatedBy(UserInfo userCreatedBy) { + this.userCreatedBy = userCreatedBy; + } + + public UserInfo getUserModifiedBy() { + return userModifiedBy; + } + + public void setUserModifiedBy(UserInfo userModifiedBy) { + this.userModifiedBy = userModifiedBy; + } + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FirewallDictionaryList.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FirewallDictionaryList.java index 3c47de817..712172acb 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FirewallDictionaryList.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FirewallDictionaryList.java @@ -21,29 +21,15 @@ package org.openecomp.policy.rest.jpa; import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; import javax.persistence.NamedQuery; import javax.persistence.OrderBy; -import javax.persistence.PrePersist; -import javax.persistence.PreUpdate; import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.openecomp.policy.rest.XacmlAdminAuthorization; - -import org.openecomp.policy.common.logging.eelf.MessageCodes; -import org.openecomp.policy.common.logging.eelf.PolicyLogger; @Entity @@ -145,15 +131,10 @@ public class FirewallDictionaryList implements Serializable { this.userModifiedBy = userModifiedBy; }*/ - private static Log logger = LogFactory.getLog(FirewallDictionaryList.class); - public FirewallDictionaryList() { } - private static final Log auditLogger = LogFactory - .getLog("auditLogger"); - public FirewallDictionaryList(String string, String userid) { this(domain); } @@ -175,8 +156,6 @@ public class FirewallDictionaryList implements Serializable { try { this.userModifiedBy =XacmlAdminAuthorization.getUserId();; } catch (Exception e) { - logger.error("Exception caused While adding Modified by Role"+e); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "TermList", "Exception caused While adding Modified by Role"); } auditLogger.debug("Updated Term Name: "+this.parentItemName+" by "+this.userModifiedBy); diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/GroupEntity.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/GroupEntity.java index b3897d0ee..405a5d458 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/GroupEntity.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/GroupEntity.java @@ -35,26 +35,22 @@ import java.io.Serializable; import java.util.Date; import java.util.List; +import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; -import javax.persistence.Index; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; -import javax.persistence.Lob; import javax.persistence.ManyToMany; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; -import javax.persistence.OneToOne; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; -import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import javax.persistence.UniqueConstraint; import javax.persistence.Version; import com.fasterxml.jackson.annotation.JsonManagedReference; @@ -80,7 +76,6 @@ public class GroupEntity implements Serializable { @Id @Column (name="groupKey", nullable=false) - //@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="seqGroup") @GeneratedValue(strategy = GenerationType.AUTO) private long groupKey; @@ -94,9 +89,8 @@ public class GroupEntity implements Serializable { @Column(name="version") private int version; - @ManyToMany - @JoinTable(name="PolicyGroupEntity",joinColumns={@JoinColumn(name="groupKey", referencedColumnName="groupKey")}, - inverseJoinColumns={@JoinColumn(name="policyId",referencedColumnName="policyId")}) + @ManyToMany(cascade = CascadeType.ALL) + @JoinTable(name="PolicyGroupEntity",joinColumns={@JoinColumn(name="groupKey")}, inverseJoinColumns={@JoinColumn(name="policyId")}) @JsonManagedReference private List policies; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/GroupPolicyScopeList.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/GroupPolicyScopeList.java index c57d1475a..a8e052282 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/GroupPolicyScopeList.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/GroupPolicyScopeList.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,8 +33,6 @@ import javax.persistence.OrderBy; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; @Entity diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/GroupServiceList.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/GroupServiceList.java index b5fbd9355..d214e4694 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/GroupServiceList.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/GroupServiceList.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,8 +33,6 @@ import javax.persistence.OrderBy; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; @Entity diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceAttribute.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceAttribute.java new file mode 100644 index 000000000..e30379e1d --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceAttribute.java @@ -0,0 +1,109 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP-REST + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.jpa; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQuery; +import javax.persistence.OrderBy; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; + +@Entity +@Table(name="MicroServiceAttribute") +@NamedQuery(name="MicroServiceAttribute.findAll", query="SELECT e FROM MicroServiceAttribute e ") +public class MicroServiceAttribute implements Serializable { + private static final long serialVersionUID = 1L; + + private static String domain; + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name="id") + private int id; + + @Column(name="name", nullable=false) + @OrderBy("asc") + private String name; + + @Column(name="value") + private String value ; + + @Column(name="modelName") + private String modelName; + + + public MicroServiceAttribute() { + + } + public MicroServiceAttribute(String string, String userid) { + this(domain); + + } + public MicroServiceAttribute(String domain) { + + } + + @PrePersist + public void prePersist() { + + } + @PreUpdate + public void preUpdate() { + } + + + public int getId() { + return this.id; + } + + public void setId(int id) { + this.id = id; + } + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + + } + public String getValue() { + return this.value ; + } + + public void setValue(String value ) { + this.value = value ; + } + public String getModelName() { + return modelName; + } + public void setModelName(String modelName) { + this.modelName = modelName; + } + +} \ No newline at end of file diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceConfigName.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceConfigName.java index 594cacf33..0a1034c77 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceConfigName.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceConfigName.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceLocation.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceLocation.java index 8532f81a1..a72f690ac 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceLocation.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceLocation.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceModels.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceModels.java index ca7460640..c1eb24058 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceModels.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/MicroServiceModels.java @@ -31,7 +31,6 @@ package org.openecomp.policy.rest.jpa; import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; @@ -48,10 +47,6 @@ import javax.persistence.Table; * * @version: 0.1 */ -import javax.persistence.Temporal; -import javax.persistence.TemporalType; - -import org.openecomp.policy.rest.jpa.UserInfo; @Entity @@ -87,6 +82,12 @@ public class MicroServiceModels implements Serializable{ @Column (name="version", nullable=false, length=2000) private String version; + @Column (name="enumValues", nullable=false, length=2000) + private String enumValues; + + @Column (name="annotation", nullable=false, length=2000) + private String annotation; + public String getSub_attributes() { return sub_attributes; } @@ -169,4 +170,20 @@ public class MicroServiceModels implements Serializable{ public void setModelName(String modelName){ this.modelName = modelName; } + + public String getEnumValues() { + return enumValues; + } + + public void setEnumValues(String enumValues) { + this.enumValues = enumValues; + } + + public String getAnnotation() { + return annotation; + } + + public void setAnnotation(String annotation) { + this.annotation = annotation; + } } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ObadviceExpression.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ObadviceExpression.java index 28957fa85..1908b9dc9 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ObadviceExpression.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ObadviceExpression.java @@ -28,14 +28,11 @@ import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; -import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.NamedQuery; import javax.persistence.OneToOne; import javax.persistence.Table; -import org.openecomp.policy.rest.jpa.Attribute; - /** * The persistent class for the ObadviceExpressions database table. diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PEPOptions.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PEPOptions.java index 8b05e8ffc..ed520472c 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PEPOptions.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PEPOptions.java @@ -101,7 +101,7 @@ public class PEPOptions implements Serializable { this.userModifiedBy = userModifiedBy; } - private static Log logger = LogFactory.getLog(PEPOptions.class); + private static Log LOGGER = LogFactory.getLog(PEPOptions.class); public PEPOptions(){ @@ -128,8 +128,7 @@ public class PEPOptions implements Serializable { try { this.userModifiedBy =XacmlAdminAuthorization.getUserId();; } catch (Exception e) { - logger.error("Exception caused While adding Modified by Role"+e); - // TODO:EELF Cleanup - Remove logger + LOGGER.error("Exception caused While adding Modified by Role"+e); PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PEPOptions", "Exception caused While adding Modified by Role"); } } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PIPConfiguration.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PIPConfiguration.java index 8f75bef89..07f1b3bbc 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PIPConfiguration.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PIPConfiguration.java @@ -51,21 +51,16 @@ import javax.persistence.Transient; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - +import org.openecomp.policy.common.logging.eelf.MessageCodes; +import org.openecomp.policy.common.logging.eelf.PolicyLogger; import org.openecomp.policy.xacml.api.XACMLErrorConstants; + import com.att.research.xacml.api.pip.PIPException; import com.att.research.xacml.std.pip.engines.StdConfigurableEngine; -import com.att.research.xacml.std.pip.engines.csv.CSVEngine; -import com.att.research.xacml.std.pip.engines.csv.HyperCSVEngine; -import com.att.research.xacml.std.pip.engines.jdbc.JDBCEngine; -import com.att.research.xacml.std.pip.engines.ldap.LDAPEngine; import com.att.research.xacml.util.XACMLProperties; import com.google.common.base.Joiner; import com.google.common.base.Splitter; -import org.openecomp.policy.common.logging.eelf.MessageCodes; -import org.openecomp.policy.common.logging.eelf.PolicyLogger; - /** * The persistent class for the PIPConfiguration database table. @@ -358,15 +353,12 @@ public class PIPConfiguration implements Serializable { PIPConfiguration configuration; try { String user = "super-admin"; - //TODO - //String user = ((XacmlAdminUI)UI.getCurrent()).getUserid(); configuration = new PIPConfiguration(id, properties, user); configuration.setCreatedBy(user); configuration.setModifiedBy(user); configurations.add(configuration); } catch (PIPException e) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Import failed: " + e.getLocalizedMessage()); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PIPConfiguration", "Import failed"); } } @@ -385,7 +377,6 @@ public class PIPConfiguration implements Serializable { this.id = Integer.parseInt(id); } catch (NumberFormatException e) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Convert id to integer failed: " + id); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PIPConfiguration", "Convert id to integer failed"); } } @@ -397,30 +388,6 @@ public class PIPConfiguration implements Serializable { throw new PIPException("PIP Engine defined without a classname"); } // - // These classes we know for sure require resolvers. - // - //TODO: Commented out due to JPAUtils class & As of now we are not using PIP. So, it will not impact any Errors - /*if (this.classname.equals(JDBCEngine.class.getCanonicalName())) { - this.setRequiresResolvers(true); - this.setPiptype(JPAUtils.getPIPType(PIPType.TYPE_SQL)); - } else if (this.classname.equals(LDAPEngine.class.getCanonicalName())) { - this.setRequiresResolvers(true); - this.setPiptype(JPAUtils.getPIPType(PIPType.TYPE_LDAP)); - } else if (this.classname.equals(HyperCSVEngine.class.getCanonicalName())) { - this.setRequiresResolvers(true); - this.setPiptype(JPAUtils.getPIPType(PIPType.TYPE_HYPERCSV)); - } else if (this.classname.equals(CSVEngine.class.getCanonicalName())) { - this.setRequiresResolvers(true); - this.setPiptype(JPAUtils.getPIPType(PIPType.TYPE_CSV)); - } else { - // - // Assume it does not require resolvers for now, if we encounter - // one then we will change it. The user can always change it via the gui. - // - this.setRequiresResolvers(false); - this.setPiptype(JPAUtils.getPIPType(PIPType.TYPE_CUSTOM)); - }*/ - // // Go through each property // for (Object name : properties.keySet()) { @@ -450,8 +417,6 @@ public class PIPConfiguration implements Serializable { properties.getProperty(name.toString()), properties,"super-admin" ); - //TODO: replace with UserId - //((XacmlAdminUI)UI.getCurrent()).getUserid() for (PIPResolver resolver : resolvers) { this.addPipresolver(resolver); } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PREFIXLIST.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PREFIXLIST.java deleted file mode 100644 index aac04795c..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PREFIXLIST.java +++ /dev/null @@ -1,117 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.jpa; -/* - */ -import java.io.Serializable; -import java.util.Date; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.NamedQuery; -import javax.persistence.OrderBy; -import javax.persistence.PrePersist; -import javax.persistence.PreUpdate; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; - -@Entity -@Table(name="PREFIXLIST") -@NamedQuery(name="PREFIXLIST.findAll", query="SELECT e FROM PREFIXLIST e ") -public class PREFIXLIST implements Serializable { - private static final long serialVersionUID = 1L; - - private static String domain; - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="id") - private int id; - - @Column(name="pl_name", nullable=false) - @OrderBy("asc") - private String prefixListName; - - @Column(name="description", nullable=false) - private String description; - - @Column(name="pl_value", nullable=false) - private String prefixListValue; -/* - @Temporal(TemporalType.TIMESTAMP) - @Column(name="modified_date", nullable=false) - private Date modifiedDate;*/ - - public PREFIXLIST() { - - } - public PREFIXLIST(String string, String userid) { - this(domain); - - } - public PREFIXLIST(String domain) { - - } - - @PrePersist - public void prePersist() { - - } - @PreUpdate - public void preUpdate() { - } - public String getPrefixListName() { - return this.prefixListName; - } - - public void setPrefixListName(String prefixListName) { - this.prefixListName = prefixListName; - - } - - public String getDescription() { - return this.description; - } - - public void setDescription(String description) { - this.description = description; - - } - public int getId() { - return this.id; - } - - public void setId(int id) { - this.id = id; - } - public String getPrefixListValue() { - return this.prefixListValue; - } - - public void setPrefixListValue(String prefixListValue) { - this.prefixListValue = prefixListValue; - } - -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PdpEntity.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PdpEntity.java index 191dfde60..c7d666056 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PdpEntity.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PdpEntity.java @@ -29,21 +29,15 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; -import javax.persistence.Index; import javax.persistence.JoinColumn; -import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; -import javax.persistence.OneToOne; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; -import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import javax.persistence.UniqueConstraint; -import javax.persistence.Version; /* * The Entity class to persist a policy object and its configuration data diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyEntity.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyEntity.java index 80869c225..7b938e461 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyEntity.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyEntity.java @@ -29,7 +29,6 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; -import javax.persistence.Index; import javax.persistence.JoinColumn; import javax.persistence.Lob; import javax.persistence.NamedQueries; @@ -37,11 +36,9 @@ import javax.persistence.NamedQuery; import javax.persistence.OneToOne; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; -import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import javax.persistence.UniqueConstraint; import javax.persistence.Version; import com.fasterxml.jackson.annotation.JsonBackReference; @@ -56,13 +53,7 @@ import com.fasterxml.jackson.annotation.JsonManagedReference; */ @Entity //Add a non-unique index and a constraint that says the combo of policyName and scopeId must be unique -@Table(name="PolicyEntity", indexes = {@Index(name="scope", columnList="scope", unique=false), - @Index(name="policyName", columnList="policyName", unique=false)}, - uniqueConstraints=@UniqueConstraint(columnNames={"policyName", "scope"})) - -//Using a sequence generator because the value is available as soon as the -//the object is persisted. That is, you don't have to flush/commit to the DB. -//@SequenceGenerator(name="seqPolicy", initialValue=1, allocationSize=1) +@Table(name="PolicyEntity") @NamedQueries({ @NamedQuery(name="PolicyEntity.findAll", query="SELECT e FROM PolicyEntity e "), @@ -76,7 +67,6 @@ public class PolicyEntity implements Serializable { private static final long serialVersionUID = 1L; @Id - //@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="seqPolicy") @GeneratedValue(strategy = GenerationType.AUTO) @Column (name="policyId") @JsonBackReference @@ -102,12 +92,12 @@ public class PolicyEntity implements Serializable { private String policyData = "NoData"; @OneToOne(optional=true, orphanRemoval=true) - @JoinColumn(name="configurationDataId", referencedColumnName="configurationDataId") + @JoinColumn(name="configurationDataId") @JsonManagedReference private ConfigurationDataEntity configurationDataEntity; @OneToOne(optional=true, orphanRemoval=true) - @JoinColumn(name="actionBodyId", referencedColumnName="actionBodyId") + @JoinColumn(name="actionBodyId") @JsonManagedReference private ActionBodyEntity actionBodyEntity; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyRoles.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyRoles.java index 71df02b99..ede5d1020 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyRoles.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyRoles.java @@ -56,14 +56,14 @@ public class PolicyRoles implements Serializable { @ManyToOne @JoinColumn(name="loginid") @OrderBy("asc") - private UserInfo loginid; + private UserInfo loginId; public UserInfo getLoginId() { - return loginid; + return loginId; } - public void setLoginId(UserInfo loginid) { - this.loginid = loginid; + public void setLoginId(UserInfo loginId) { + this.loginId = loginId; } @Column(name="scope", nullable=true, length=45) diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeClosedLoop.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeClosedLoop.java index 484851d7b..8315ed070 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeClosedLoop.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeClosedLoop.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeResource.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeResource.java index e126c4118..76eb40d3e 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeResource.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeResource.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeService.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeService.java index cc8c11383..820616988 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeService.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeService.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeType.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeType.java index d4ade7fe9..65fe6e5f7 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeType.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScopeType.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScore.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScore.java index cae9cfc6a..3cd84eb2d 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScore.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyScore.java @@ -20,7 +20,6 @@ package org.openecomp.policy.rest.jpa; import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; @@ -30,11 +29,7 @@ import javax.persistence.Id; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.OrderBy; -import javax.persistence.PrePersist; -import javax.persistence.PreUpdate; import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; @Entity diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyVersion.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyVersion.java index 73d39ad8e..4355693f3 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyVersion.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyVersion.java @@ -44,7 +44,8 @@ import javax.persistence.TemporalType; @NamedQueries({ @NamedQuery(name="PolicyVersion.findAll", query="SELECT p FROM PolicyVersion p"), @NamedQuery(name="PolicyVersion.deleteAll", query="DELETE FROM PolicyVersion WHERE 1=1"), - @NamedQuery(name="PolicyVersion.findByPolicyName", query="Select p from PolicyVersion p where p.policyName=:pname") + @NamedQuery(name="PolicyVersion.findByPolicyName", query="Select p from PolicyVersion p where p.policyName=:pname"), + @NamedQuery(name="PolicyVersion.findAllCount", query="SELECT COUNT(p) FROM PolicyVersion p") }) public class PolicyVersion implements Serializable { private static final long serialVersionUID = 1L; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PortList.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PortList.java index 88ce58afc..7bc4cf46a 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PortList.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PortList.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,8 +33,6 @@ import javax.persistence.OrderBy; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; @Entity @Table(name="portlist") diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PrefixList.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PrefixList.java new file mode 100644 index 000000000..e94afd4f1 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PrefixList.java @@ -0,0 +1,114 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP-REST + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.jpa; +/* + */ +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQuery; +import javax.persistence.OrderBy; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; + +@Entity +@Table(name="PrefixList") +@NamedQuery(name="PrefixList.findAll", query="SELECT e FROM PrefixList e ") +public class PrefixList implements Serializable { + private static final long serialVersionUID = 1L; + + private static String domain; + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name="id") + private int id; + + @Column(name="pl_name", nullable=false) + @OrderBy("asc") + private String prefixListName; + + @Column(name="description", nullable=false) + private String description; + + @Column(name="pl_value", nullable=false) + private String prefixListValue; +/* + @Temporal(TemporalType.TIMESTAMP) + @Column(name="modified_date", nullable=false) + private Date modifiedDate;*/ + + public PrefixList() { + + } + public PrefixList(String string, String userid) { + this(domain); + + } + public PrefixList(String domain) { + + } + + @PrePersist + public void prePersist() { + + } + @PreUpdate + public void preUpdate() { + } + public String getPrefixListName() { + return this.prefixListName; + } + + public void setPrefixListName(String prefixListName) { + this.prefixListName = prefixListName; + + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + + } + public int getId() { + return this.id; + } + + public void setId(int id) { + this.id = id; + } + public String getPrefixListValue() { + return this.prefixListValue; + } + + public void setPrefixListValue(String prefixListValue) { + this.prefixListValue = prefixListValue; + } + +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ProtocolList.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ProtocolList.java index a450c2551..d7cba8ffe 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ProtocolList.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ProtocolList.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,8 +33,6 @@ import javax.persistence.OrderBy; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; @Entity @Table(name="protocollist") diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/RemoteCatalogValues.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/RemoteCatalogValues.java index c906c79cb..b2b4df75b 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/RemoteCatalogValues.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/RemoteCatalogValues.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/RiskType.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/RiskType.java index da18c744e..077138e1f 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/RiskType.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/RiskType.java @@ -41,14 +41,9 @@ import javax.persistence.TemporalType; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.openecomp.policy.rest.XacmlAdminAuthorization; -import org.openecomp.policy.rest.jpa.UserInfo; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonManagedReference; - import org.openecomp.policy.common.logging.eelf.MessageCodes; import org.openecomp.policy.common.logging.eelf.PolicyLogger; +import org.openecomp.policy.rest.XacmlAdminAuthorization; @Entity @@ -103,7 +98,7 @@ public class RiskType implements Serializable { this.userModifiedBy = userModifiedBy; } - private static Log logger = LogFactory.getLog(RiskType.class); + private static Log LOGGER = LogFactory.getLog(RiskType.class); public RiskType() { @@ -130,8 +125,7 @@ public class RiskType implements Serializable { try { this.userModifiedBy =XacmlAdminAuthorization.getUserId(); } catch (Exception e) { - logger.error("Exception caused While adding Modified by Role"+e); - // TODO:EELF Cleanup - Remove logger + LOGGER.error("Exception caused While adding Modified by Role"+e); PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "RiskType", "Exception caused While adding Modified by Role"); } } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/SecurityZone.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/SecurityZone.java index 2fbd4486d..5de032f8f 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/SecurityZone.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/SecurityZone.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,8 +33,6 @@ import javax.persistence.OrderBy; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; @Entity @Table(name="securityzone") diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ServiceList.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ServiceList.java index 9a72916b1..b3e473b1a 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ServiceList.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/ServiceList.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,8 +33,6 @@ import javax.persistence.OrderBy; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; @Entity @Table(name="servicegroup") diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/SystemLogDB.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/SystemLogDB.java index a86857aee..6fa91ee03 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/SystemLogDB.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/SystemLogDB.java @@ -32,25 +32,16 @@ package org.openecomp.policy.rest.jpa; import java.io.Serializable; import java.util.Date; -import java.util.HashSet; -import java.util.Set; -import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.NamedQuery; -import javax.persistence.OneToMany; -import javax.persistence.PrePersist; -import javax.persistence.PreUpdate; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import javax.persistence.Transient; - -import com.att.research.xacml.api.Identifier; /** * The persistent class for the system log database table. @@ -93,7 +84,6 @@ public class SystemLogDB implements Serializable { public SystemLogDB(int id, String system, String description, String remote, String type, String logtype) { - // TODO Auto-generated constructor stub this.id = id; this.system = system; this.description = description; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/TermList.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/TermList.java index ce94fb8d8..38bbf793a 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/TermList.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/TermList.java @@ -125,7 +125,7 @@ public class TermList implements Serializable { this.userModifiedBy = userModifiedBy; } - private static Log logger = LogFactory.getLog(TermList.class); + private static Log LOGGER = LogFactory.getLog(TermList.class); public TermList() { @@ -155,8 +155,7 @@ public class TermList implements Serializable { try { this.userModifiedBy =XacmlAdminAuthorization.getUserId();; } catch (Exception e) { - logger.error("Exception caused While adding Modified by Role"+e); - // TODO:EELF Cleanup - Remove logger + LOGGER.error("Exception caused While adding Modified by Role"+e); PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "TermList", "Exception caused While adding Modified by Role"); } auditLogger.debug("Updated Term Name: "+this.termName+" by "+this.userModifiedBy); diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/UserInfo.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/UserInfo.java index 6f5982aa8..9dd771e6c 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/UserInfo.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/UserInfo.java @@ -40,7 +40,7 @@ public class UserInfo implements Serializable { private static final long serialVersionUID = 1L; @Id - @Column(name="loginId", nullable=false, length=45) + @Column(name="loginid", nullable=false, length=45) private String userLoginId; @Column(name = "name", nullable = false, unique = true) diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VMType.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VMType.java index a1adcd447..e7ae197fc 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VMType.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VMType.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VNFType.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VNFType.java index a2c19da31..693e27553 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VNFType.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VNFType.java @@ -99,7 +99,7 @@ public class VNFType implements Serializable { this.userModifiedBy = userModifiedBy; } - private static Log logger = LogFactory.getLog(VNFType.class); + private static Log LOGGER = LogFactory.getLog(VNFType.class); public VNFType() { @@ -134,8 +134,7 @@ public class VNFType implements Serializable { try { this.userModifiedBy =XacmlAdminAuthorization.getUserId();; } catch (Exception e) { - logger.error("Exception caused While adding Modified by Role"+e); - // TODO:EELF Cleanup - Remove logger + LOGGER.error("Exception caused While adding Modified by Role"+e); PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "VNFType", "Exception caused While adding Modified by Role"); } } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VSCLAction.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VSCLAction.java index 39d671f1d..7f42650a3 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VSCLAction.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VSCLAction.java @@ -98,7 +98,7 @@ public class VSCLAction implements Serializable { this.userModifiedBy = userModifiedBy; } - private static Log logger = LogFactory.getLog(VSCLAction.class); + private static Log LOGGER = LogFactory.getLog(VSCLAction.class); public VSCLAction() { @@ -125,8 +125,7 @@ public class VSCLAction implements Serializable { try { this.userModifiedBy =XacmlAdminAuthorization.getUserId();; } catch (Exception e) { - logger.error("Exception caused While adding Modified by Role"+e); - // TODO:EELF Cleanup - Remove logger + LOGGER.error("Exception caused While adding Modified by Role"+e); PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "VSCLAction", "Exception caused While adding Modified by Role"); } } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VarbindDictionary.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VarbindDictionary.java index 05e5710d7..1bb56a067 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VarbindDictionary.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/VarbindDictionary.java @@ -100,7 +100,7 @@ public class VarbindDictionary implements Serializable{ this.userModifiedBy = userModifiedBy; } - private static Log logger = LogFactory.getLog(VarbindDictionary.class); + private static Log LOGGER = LogFactory.getLog(VarbindDictionary.class); public VarbindDictionary() { @@ -127,8 +127,7 @@ public class VarbindDictionary implements Serializable{ try { this.userModifiedBy =XacmlAdminAuthorization.getUserId();; } catch (Exception e) { - logger.error("Exception caused While adding Modified by Role"+e); - // TODO:EELF Cleanup - Remove logger + LOGGER.error("Exception caused While adding Modified by Role"+e); PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "VarbindDictionary", "Exception caused While adding Modified by Role"); } } diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Zone.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Zone.java index e1db124c3..30e02e06d 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Zone.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/Zone.java @@ -22,7 +22,6 @@ package org.openecomp.policy.rest.jpa; /* */ import java.io.Serializable; -import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,8 +33,6 @@ import javax.persistence.OrderBy; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; @Entity @Table(name="zone") diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/package-info.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/package-info.java index d5b935077..4e77ba9e7 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/package-info.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/package-info.java @@ -18,10 +18,4 @@ * ============LICENSE_END========================================================= */ -/** - * - */ -/** - * - */ package org.openecomp.policy.rest.jpa; diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSAttributeObject.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSAttributeObject.java index 45b5aefb8..c912374ef 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSAttributeObject.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSAttributeObject.java @@ -21,7 +21,6 @@ package org.openecomp.policy.rest.util; import java.util.HashMap; -import java.util.List; import java.util.Map; public class MSAttributeObject { @@ -31,8 +30,9 @@ public class MSAttributeObject { private HashMap refAttribute = new HashMap(); private HashMap subClass = new HashMap(); private String dependency; - private List enumType; - + private HashMap enumType = new HashMap(); + private HashMap matchingSet = new HashMap(); + private boolean policyTempalate; public Map getRefAttribute() { return refAttribute; @@ -52,10 +52,10 @@ public class MSAttributeObject { public void setAttribute(HashMap attribute) { this.attribute = attribute; } - public List getEnumType() { + public HashMap getEnumType() { return enumType; } - public void setEnumType(List enumType) { + public void setEnumType(HashMap enumType) { this.enumType = enumType; } public void addAttribute(String key, String value){ @@ -85,4 +85,25 @@ public class MSAttributeObject { public void setDependency(String dependency) { this.dependency = dependency; } -} + public void addSingleEnum(String key, String value){ + this.enumType.put(key, value); + } + public HashMap getMatchingSet() { + return matchingSet; + } + public void setMatchingSet(HashMap matchingSet) { + this.matchingSet = matchingSet; + } + public void addMatchingSet(String key, String value){ + this.matchingSet.put(key, value); + } + public void addMatchingSet(HashMap matchingSet){ + this.matchingSet.putAll(matchingSet); + } + public boolean isPolicyTempalate() { + return policyTempalate; + } + public void setPolicyTempalate(boolean policyTempalate) { + this.policyTempalate = policyTempalate; + } +} \ No newline at end of file diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSModelUtils.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSModelUtils.java new file mode 100644 index 000000000..7276a19f8 --- /dev/null +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSModelUtils.java @@ -0,0 +1,701 @@ +/*- + * ============LICENSE_START======================================================= + * ECOMP-REST + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.policy.rest.util; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.EMap; +import org.eclipse.emf.common.util.Enumerator; +import org.eclipse.emf.common.util.TreeIterator; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EAnnotation; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EEnumLiteral; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.impl.EAttributeImpl; +import org.eclipse.emf.ecore.impl.EEnumImpl; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import org.json.JSONObject; +import org.openecomp.policy.rest.XACMLRestProperties; + +import com.att.research.xacml.util.XACMLProperties; +import com.google.gson.Gson; + + +public class MSModelUtils { + + private static final Log logger = LogFactory.getLog(MSModelUtils.class); + + private HashMap classMap = new HashMap(); + private HashMap enumMap = new HashMap(); + private HashMap matchingClass = new HashMap(); + private String configuration = "configuration"; + private String dictionary = "dictionary"; + private String ecomp = ""; + private String policy = ""; + private String eProxyURI = "eProxyURI:"; + + public MSModelUtils(String ecomp, String policy){ + this.ecomp = ecomp; + this.policy = policy; + } + + private enum ANNOTATION_TYPE{ + MATCHING, VALIDATION, DICTIONARY + }; + + public enum MODEL_TYPE { + XMI + }; + + + public HashMap processEpackage(String file, MODEL_TYPE model){ + if (model == MODEL_TYPE.XMI ){ + processXMIEpackage(file); + } + return classMap; + + } + + private void processXMIEpackage(String xmiFile){ + EPackage root = getEpackage(xmiFile); + TreeIterator treeItr = root.eAllContents(); + String className = null; + String returnValue = null; + + // Pulling out dependency from file + while (treeItr.hasNext()) { + EObject obj = (EObject) treeItr.next(); + if (obj instanceof EClassifier) { + EClassifier eClassifier = (EClassifier) obj; + className = eClassifier.getName(); + + if (obj instanceof EEnum) { + enumMap.putAll(getEEnum(obj)); + }else if (obj instanceof EClass) { + String temp = getDependencyList(eClassifier, className).toString(); + returnValue = StringUtils.replaceEach(temp, new String[]{"[", "]"}, new String[]{"", ""}); + getAttributes(className, returnValue, root); + } + } + } + + if (!enumMap.isEmpty()){ + addEnumClassMap(); + } + if (!matchingClass.isEmpty()){ + CheckForMatchingClass(); + } + } + + private void CheckForMatchingClass() { + HashMap tempAttribute = new HashMap(); + + for (Entry set : matchingClass.entrySet()){ + String key = set.getKey(); + if (classMap.containsKey(key)){ + Map listAttributes = classMap.get(key).getAttribute(); + Map listRef = classMap.get(key).getRefAttribute(); + for ( Entry eSet : listAttributes.entrySet()){ + String key2 = eSet.getKey(); + tempAttribute.put(key2, "matching-true"); + } + for ( Entry eSet : listRef.entrySet()){ + String key3 = eSet.getKey(); + tempAttribute.put(key3, "matching-true"); + } + + } + UpdateMatching(tempAttribute, key); + } + + } + + + + private void UpdateMatching(HashMap tempAttribute, String key) { + Map newClass = null; + + newClass = classMap; + + for (Entry updateClass : newClass.entrySet()){ + HashMap valueMap = updateClass.getValue().getMatchingSet(); + String keymap = updateClass.getKey(); + if (valueMap.containsKey(key)){ + HashMap modifyMap = classMap.get(keymap).getMatchingSet(); + modifyMap.remove(key); + modifyMap.putAll(tempAttribute); + classMap.get(keymap).setMatchingSet(modifyMap); + } + + } + } + + private void addEnumClassMap() { + for (Entry value :classMap.entrySet()){ + value.getValue().setEnumType(enumMap); + } + } + + private EPackage getEpackage(String xmiFile) { + ResourceSet resSet = new ResourceSetImpl(); + Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE; + Map m = reg.getExtensionToFactoryMap(); + m.put("xmi", new XMIResourceFactoryImpl()); + Resource resource = resSet.getResource(URI.createFileURI(xmiFile), true); + try { + resource.load(Collections.EMPTY_MAP); + } catch (IOException e) { + logger.error("Error loading Encore Resource for new Model"); + } + + EPackage root = (EPackage) resource.getContents().get(0); + + return root; + } + + private HashMap getEEnum(EObject obj) { + List valueList = new ArrayList<>(); + HashMap returnMap = new HashMap(); + EEnum eenum = (EEnum)obj; + + String name = eenum.getName(); + for (EEnumLiteral eEnumLiteral : eenum.getELiterals()) + { + Enumerator instance = eEnumLiteral.getInstance(); + String value = instance.getLiteral(); + valueList.add(value); + } + returnMap.put(name, valueList.toString()); + return returnMap; + } + + public void getAttributes(String className, String dependency, EPackage root) { + List dpendList = null; + if (dependency!=null){ + dpendList = new ArrayList(Arrays.asList(dependency.split(","))); + } + MSAttributeObject msAttributeObject = new MSAttributeObject(); + msAttributeObject.setClassName(className); + String extendClass = getSubTypes(root, className); + HashMap returnRefList = getRefAttributeList(root, className, extendClass); + HashMap returnAttributeList = getAttributeList(root, className, extendClass); + HashMap returnSubList = getSubAttributeList(root, className, extendClass); + HashMap returnAnnotation = getAnnotation(root, className, extendClass); + msAttributeObject.setAttribute(returnAttributeList); + msAttributeObject.setRefAttribute(returnRefList); + msAttributeObject.setSubClass(returnSubList); + msAttributeObject.setDependency(dpendList.toString()); + msAttributeObject.addMatchingSet(returnAnnotation); + msAttributeObject.setPolicyTempalate(isPolicyTemplate(root, className)); + + this.classMap.put(className, msAttributeObject); + } + + private HashMap getAnnotation(EPackage root, String className, String extendClass) { + TreeIterator treeItr = root.eAllContents(); + boolean requiredAttribute = false; + boolean requiredMatchAttribute = false; + HashMap annotationSet = new HashMap(); + String matching = null; + String range = null; + String dictionary = null; + + // Pulling out dependency from file + while (treeItr.hasNext()) { + EObject obj = treeItr.next(); + if (obj instanceof EClassifier) { + requiredAttribute = isRequiredAttribute(obj, className ); + requiredMatchAttribute = isRequiredAttribute(obj, extendClass ); + } + + if (requiredAttribute){ + if (obj instanceof EStructuralFeature) { + EStructuralFeature eStrucClassifier = (EStructuralFeature) obj; + if (eStrucClassifier.getEAnnotations().size() != 0) { + matching = annotationValue(eStrucClassifier, ANNOTATION_TYPE.MATCHING, policy); + if (matching!=null){ + annotationSet.put(eStrucClassifier.getName(), matching); + } + range = annotationValue(eStrucClassifier, ANNOTATION_TYPE.VALIDATION, policy); + if (range!=null){ + annotationSet.put(eStrucClassifier.getName(), range); + } + dictionary = annotationValue(eStrucClassifier, ANNOTATION_TYPE.DICTIONARY, policy); + if (dictionary!=null){ + annotationSet.put(eStrucClassifier.getName(), dictionary); + } + } + } + } else if (requiredMatchAttribute){ + if (obj instanceof EStructuralFeature) { + EStructuralFeature eStrucClassifier = (EStructuralFeature) obj; + if (eStrucClassifier.getEAnnotations().size() != 0) { + matching = annotationValue(eStrucClassifier, ANNOTATION_TYPE.MATCHING, policy); + if (matching!=null){ + if (obj instanceof EReference){ + EClass refType = ((EReference) obj).getEReferenceType(); + annotationSet.put(refType.getName(), matching); + matchingClass.put(refType.getName(), matching); + }else{ + annotationSet.put(eStrucClassifier.getName(), matching); + } + } + } + } + } + } + return annotationSet; + } + + private HashMap getSubAttributeList(EPackage root, String className , String superClass) { + TreeIterator treeItr = root.eAllContents(); + boolean requiredAttribute = false; + HashMap subAttribute = new HashMap(); + int rollingCount = 0; + int processClass = 0; + boolean annotation = false; + + // Pulling out dependency from file + while (treeItr.hasNext() && rollingCount < 2) { + + EObject obj = treeItr.next(); + if (obj instanceof EClassifier) { + if (isRequiredAttribute(obj, className ) || isRequiredAttribute(obj, superClass )){ + requiredAttribute = true; + }else { + requiredAttribute = false; + } + if (requiredAttribute){ + processClass++; + } + rollingCount = rollingCount+processClass; + } + + if (requiredAttribute) { + if (obj instanceof EStructuralFeature) { + EStructuralFeature eStrucClassifier = (EStructuralFeature) obj; + if (eStrucClassifier.getEAnnotations().size() != 0) { + annotation = annotationTest(eStrucClassifier, configuration, ecomp); + if (annotation && obj instanceof EReference) { + EClass refType = ((EReference) obj).getEReferenceType(); + if(!refType.toString().contains(eProxyURI)){ + subAttribute.put(eStrucClassifier.getName(), refType.getName()); + } + } + } + } + } + } + return subAttribute; + } + + public String checkDefultValue(String defultValue) { + if (defultValue!=null){ + return ":defaultValue-"+ defultValue; + } + return ":defaultValue-NA"; + + } + + public String checkRequiredPattern(int upper, int lower) { + + String pattern = XACMLProperties.getProperty(XACMLRestProperties.PROP_XCORE_REQUIRED_PATTERN); + + if (pattern!=null){ + if (upper == Integer.parseInt(pattern.split(",")[1]) && lower==Integer.parseInt(pattern.split(",")[0])){ + return ":required-true"; + } + } + + return ":required-false"; + } + + public JSONObject buildJavaObject(HashMap map, String attributeType){ + + JSONObject returnValue = new JSONObject(map); + + return returnValue; + + } + + public HashMap getRefAttributeList(EPackage root, String className, String superClass){ + + TreeIterator treeItr = root.eAllContents(); + boolean requiredAttribute = false; + HashMap refAttribute = new HashMap(); + int rollingCount = 0; + int processClass = 0; + boolean annotation = false; + // Pulling out dependency from file + while (treeItr.hasNext()) { + EObject obj = treeItr.next(); + if (obj instanceof EClassifier) { + if (isRequiredAttribute(obj, className ) || isRequiredAttribute(obj, superClass )){ + requiredAttribute = true; + }else { + requiredAttribute = false; + } + if (requiredAttribute){ + processClass++; + } + rollingCount = rollingCount+processClass; + } + + if (requiredAttribute) { + if (obj instanceof EStructuralFeature) { + EStructuralFeature eStrucClassifier = (EStructuralFeature) obj; + if (eStrucClassifier.getEAnnotations().size() != 0) { + annotation = annotationTest(eStrucClassifier, configuration, ecomp); + if ( annotation && obj instanceof EReference) { + EClass refType = ((EReference) obj).getEReferenceType(); + if(refType.toString().contains(eProxyURI)){ + String one = refType.toString().split(eProxyURI)[1]; + String refValue = StringUtils.replaceEach(one.split("#")[1], new String[]{"//", ")"}, new String[]{"", ""}); + refAttribute.put(eStrucClassifier.getName(), refValue); + } else { + String array = arrayCheck(((EStructuralFeature) obj).getUpperBound()); + refAttribute.put(eStrucClassifier.getName(), refType.getName() + array); + } + } else if (annotation && obj instanceof EAttributeImpl){ + EClassifier refType = ((EAttributeImpl) obj).getEType(); + if (refType instanceof EEnumImpl){ + String array = arrayCheck(((EStructuralFeature) obj).getUpperBound()); + refAttribute.put(eStrucClassifier.getName(), refType.getName() + array); } + } + } + } + } + } + return refAttribute; + } + + private boolean annotationTest(EStructuralFeature eStrucClassifier, String annotation, String type) { + String annotationType = null; + EAnnotation eAnnotation = null; + String ecompType = null; + String ecompValue = null; + + EList value = eStrucClassifier.getEAnnotations(); + + for (int i = 0; i < value.size(); i++){ + annotationType = value.get(i).getSource(); + eAnnotation = eStrucClassifier.getEAnnotations().get(i); + ecompType = eAnnotation.getDetails().get(0).getValue(); + ecompValue = eAnnotation.getDetails().get(0).getKey(); + if (annotationType.contains(type) && ecompType.contains(annotation)){ + return true; + } else if (annotationType.contains(type) && ecompValue.contains(annotation)){ + return true; + } + } + + return false; + } + + + private String annotationValue(EStructuralFeature eStrucClassifier, ANNOTATION_TYPE annotation, String type) { + String annotationType = null; + EAnnotation eAnnotation = null; + String ecompType = null; + String ecompValue = null; + + EList value = eStrucClassifier.getEAnnotations(); + + for (int i = 0; i < value.size(); i++){ + annotationType = value.get(i).getSource(); + eAnnotation = eStrucClassifier.getEAnnotations().get(i); + ecompType = eAnnotation.getDetails().get(0).getKey(); + if (annotationType.contains(type) && ecompType.compareToIgnoreCase(annotation.toString())==0){ + ecompValue = eAnnotation.getDetails().get(0).getValue(); + if (annotation == ANNOTATION_TYPE.VALIDATION){ + return ecompValue; + } else { + return ecompType + "-" + ecompValue; + } + } + } + + return ecompValue; + } + public boolean isRequiredAttribute(EObject obj, String className){ + EClassifier eClassifier = (EClassifier) obj; + String workingClass = eClassifier.getName(); + workingClass.trim(); + if (workingClass.equalsIgnoreCase(className)){ + return true; + } + + return false; + } + + private boolean isPolicyTemplate(EPackage root, String className){ + + for (EClassifier classifier : root.getEClassifiers()){ + if (classifier instanceof EClass) { + EClass eClass = (EClass)classifier; + if (eClass.getName().contentEquals(className)){ + EList value = eClass.getEAnnotations(); + for (EAnnotation workingValue : value){ + EMap keyMap = workingValue.getDetails(); + if (keyMap.containsKey("policyTemplate")){ + return true; + } + } + } + } + } + return false; + } + private String getSubTypes(EPackage root, String className) { + String returnSubTypes = null; + for (EClassifier classifier : root.getEClassifiers()){ + if (classifier instanceof EClass) { + EClass eClass = (EClass)classifier; + + for (EClass eSuperType : eClass.getEAllSuperTypes()) + { + if (eClass.getName().contentEquals(className)){ + returnSubTypes = eSuperType.getName(); + } + } + } + } + return returnSubTypes; + } + + public HashMap getAttributeList(EPackage root, String className, String superClass){ + + TreeIterator treeItr = root.eAllContents(); + boolean requiredAttribute = false; + HashMap refAttribute = new HashMap(); + boolean annotation = false; + boolean dictionaryTest = false; + String defaultValue = null; + String eType = null; + + // Pulling out dependency from file + while (treeItr.hasNext()) { + EObject obj = treeItr.next(); + if (obj instanceof EClassifier) { + if (isRequiredAttribute(obj, className ) || isRequiredAttribute(obj, superClass )){ + requiredAttribute = true; + }else { + requiredAttribute = false; + } + + } + + if (requiredAttribute){ + if (obj instanceof EStructuralFeature) { + EStructuralFeature eStrucClassifier = (EStructuralFeature) obj; + if (eStrucClassifier.getEAnnotations().size() != 0) { + annotation = annotationTest(eStrucClassifier, configuration, ecomp); + dictionaryTest = annotationTest(eStrucClassifier, dictionary, policy); + EClassifier refType = ((EStructuralFeature) obj).getEType(); + if (annotation && !(obj instanceof EReference) && !(refType instanceof EEnumImpl)) { + String name = eStrucClassifier.getName(); + if (dictionaryTest){ + eType = annotationValue(eStrucClassifier, ANNOTATION_TYPE.DICTIONARY, policy); + }else { + eType = eStrucClassifier.getEType().getInstanceClassName(); + } + defaultValue = checkDefultValue(((EStructuralFeature) obj).getDefaultValueLiteral()); + + String array = arrayCheck(((EStructuralFeature) obj).getUpperBound()); + String required = checkRequiredPattern(((EStructuralFeature) obj).getUpperBound(), ((EStructuralFeature) obj).getLowerBound()); + String attributeValue = eType + defaultValue + required + array; + refAttribute.put(name, attributeValue); + } + } + } + } + } + return refAttribute; + + } + + public String arrayCheck(int upperBound) { + + if (upperBound == -1){ + return ":MANY-true"; + } + + return ":MANY-false"; + } + + public List getDependencyList(EClassifier eClassifier, String className){ + List returnValue = new ArrayList<>();; + EList somelist = ((EClass) eClassifier).getEAllSuperTypes(); + if (somelist.isEmpty()){ + return returnValue; + } + for(EClass depend: somelist){ + if (depend.toString().contains(eProxyURI)){ + String one = depend.toString().split(eProxyURI)[1]; + String value = StringUtils.replaceEach(one.split("#")[1], new String[]{"//", ")"}, new String[]{"", ""}); + returnValue.add(value); + } + } + + return returnValue; + } + + public Map buildSubList(HashMap subClassAttributes, HashMap classMap, String className){ + Map missingValues = new HashMap(); + Map workingMap = new HashMap(); + boolean enumType; + + for ( Entry map : classMap.get(className).getRefAttribute().entrySet()){ + String value = map.getValue().split(":")[0]; + if (value!=null){ + classMap.get(className).getEnumType(); + enumType = classMap.get(className).getEnumType().containsKey(value); + if (!enumType){ + workingMap = classMap.get(value).getRefAttribute(); + for ( Entry subMab : workingMap.entrySet()){ + String value2 = subMab.getValue().split(":")[0]; + if (!subClassAttributes.containsValue(value2)){ + missingValues.put(subMab.getKey(), subMab.getValue()); + } + } + + } + } + } + + return missingValues; + } + + public Map> recursiveReference(HashMap classMap, String className){ + + Map> returnObject = new HashMap>(); + HashMap returnClass = getRefclass(classMap, className); + returnObject.put(className, returnClass); + for (Entry reAttribute :returnClass.entrySet()){ + if (reAttribute.getValue().split(":")[1].contains("MANY")){ + if (classMap.get(reAttribute.getValue().split(":")[0]) != null){ + returnObject.putAll(recursiveReference(classMap, reAttribute.getValue().split(":")[0])); + } + } + + } + + return returnObject; + + } + + public String createJson(HashMap subClassAttributes, HashMap classMap, String className) { + boolean enumType; + Map> myObject = new HashMap>(); + for ( Entry map : classMap.get(className).getRefAttribute().entrySet()){ + String value = map.getValue().split(":")[0]; + if (value!=null){ + enumType = classMap.get(className).getEnumType().containsKey(value); + if (!enumType){ + if (map.getValue().split(":")[1].contains("MANY")){ + Map> testRecursive = recursiveReference(classMap, map.getValue().split(":")[0] ); + myObject.putAll(testRecursive); + } + } + } + } + + Gson gson = new Gson(); + String json = gson.toJson(myObject); + + return json; + } + + public HashMap getRefclass(HashMap classMap, String className){ + HashMap missingValues = new HashMap(); + + if (classMap.get(className).getAttribute()!=null || !classMap.get(className).getAttribute().isEmpty()){ + missingValues.putAll(classMap.get(className).getAttribute()); + } + + if (classMap.get(className).getRefAttribute()!=null || !classMap.get(className).getRefAttribute().isEmpty()){ + missingValues.putAll(classMap.get(className).getRefAttribute()); + } + + return missingValues; + } + + public String createSubAttributes(ArrayList dependency, HashMap classMap, String modelName) { + + HashMap workingMap = new HashMap(); + MSAttributeObject tempObject = new MSAttributeObject(); + if (dependency!=null){ + if (dependency.size()==0){ + return "{}"; + } + dependency.add(modelName); + for (String element: dependency){ + tempObject = classMap.get(element); + if (tempObject!=null){ + workingMap.putAll(classMap.get(element).getSubClass()); + } + } + } + + String returnValue = createJson(workingMap, classMap, modelName); + return returnValue; + } + + public ArrayList getFullDependencyList(ArrayList dependency, HashMap classMap) { + ArrayList returnList = new ArrayList(); + ArrayList workingList = new ArrayList(); + returnList.addAll(dependency); + for (String element : dependency ){ + if (classMap.containsKey(element)){ + MSAttributeObject value = classMap.get(element); + String rawValue = StringUtils.replaceEach(value.getDependency(), new String[]{"[", "]"}, new String[]{"", ""}); + workingList = new ArrayList(Arrays.asList(rawValue.split(","))); + for(String depend : workingList){ + if (!returnList.contains(depend) && !depend.isEmpty()){ + returnList.add(depend.trim()); + } + } + } + } + + return returnList; + } +} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSModelUtitils.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSModelUtitils.java deleted file mode 100644 index dd015be68..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSModelUtitils.java +++ /dev/null @@ -1,450 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.rest.util; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.TreeIterator; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; - -import org.json.JSONObject; -import org.openecomp.policy.rest.XACMLRestProperties; - -import com.att.research.xacml.util.XACMLProperties; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; - - -public class MSModelUtitils { - - private static final Log logger = LogFactory.getLog(MSModelUtitils.class); - - private HashMap classMap = new HashMap(); - - public HashMap processEpackage(String xmiFile){ - EPackage root = getEpackage(xmiFile); - TreeIterator treeItr = root.eAllContents(); - String className = null; - String returnValue = null; - - // Pulling out dependency from file - while (treeItr.hasNext()) { - EObject obj = (EObject) treeItr.next(); - if (obj instanceof EClassifier) { - EClassifier eClassifier = (EClassifier) obj; - className = eClassifier.getName(); - - if (obj instanceof EEnum) { - // getEEnum(); - returnValue = null; - }else if (obj instanceof EClass) { - String temp = getDependencyList(eClassifier, className).toString(); - returnValue = StringUtils.replaceEach(temp, new String[]{"[", "]"}, new String[]{"", ""}); - getAttributes(className, returnValue, root); - } - } - } - return classMap; - } - - private EPackage getEpackage(String xmiFile) { - ResourceSet resSet = new ResourceSetImpl(); - Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE; - Map m = reg.getExtensionToFactoryMap(); - m.put("xmi", new XMIResourceFactoryImpl()); - Resource resource = resSet.getResource(URI.createFileURI(xmiFile), true); - try { - resource.load(Collections.EMPTY_MAP); - } catch (IOException e) { - logger.error("Error loading Encore Resource for new Model"); - } - - EPackage root = (EPackage) resource.getContents().get(0); - - return root; - } - - private void getEEnum() { - - } - - public void getAttributes(String className, String dependency, EPackage root) { - List dpendList = null; - if (dependency!=null){ - dpendList = new ArrayList(Arrays.asList(dependency.split(","))); - } - MSAttributeObject msAttributeObject = new MSAttributeObject(); - msAttributeObject.setClassName(className); - HashMap returnRefList = getRefAttributeList(root, className); - HashMap returnAttributeList = getAttributeList(root, className); - HashMap returnSubList = getSubAttributeList(root, className); - msAttributeObject.setAttribute(returnAttributeList); - msAttributeObject.setRefAttribute(returnRefList); - msAttributeObject.setSubClass(returnSubList); - msAttributeObject.setDependency(dpendList.toString()); - this.classMap.put(className, msAttributeObject); - } - - private HashMap getSubAttributeList(EPackage root, String className) { - //EPackage root = (EPackage) resource.getContents().get(0); - TreeIterator treeItr = root.eAllContents(); - boolean requiredAttribute = false; - HashMap subAttribute = new HashMap(); - int rollingCount = 0; - int processClass = 0; - boolean annotation = false; - - // Pulling out dependency from file - while (treeItr.hasNext() && rollingCount < 2) { - - EObject obj = treeItr.next(); - if (obj instanceof EClassifier) { - requiredAttribute = isRequiredAttribute(obj, className); - if (requiredAttribute){ - processClass++; - } - rollingCount = rollingCount+processClass; - } - - if (requiredAttribute) { - if (obj instanceof EStructuralFeature) { - EStructuralFeature eStrucClassifier = (EStructuralFeature) obj; - if (eStrucClassifier.getEAnnotations().size() != 0) { - annotation = testAnnotation(eStrucClassifier); - if (annotation && obj instanceof EReference) { - EClass refType = ((EReference) obj).getEReferenceType(); - // String array = arrayCheck(((EStructuralFeature) obj).getUpperBound()); - if(!refType.toString().contains("eProxyURI:")){ - subAttribute.put(eStrucClassifier.getName(), refType.getName()); - } - } - } - } - } - } - return subAttribute; - } - - public String checkDefultValue(String defultValue) { - if (defultValue!=null){ - return ":defaultValue-"+ defultValue; - } - return ":defaultValue-NA"; - - } - - public String checkRequiredPattern(int upper, int lower) { - String pattern = XACMLProperties.getProperty(XACMLRestProperties.PROP_XCORE_REQUIRED_PATTERN); - - if (pattern!=null){ - if (upper == Integer.parseInt(pattern.split(",")[1]) && lower==Integer.parseInt(pattern.split(",")[0])){ - return ":required-true"; - } - } - - return ":required-false"; - } - - public JSONObject buildJavaObject(HashMap map, String attributeType){ - - JSONObject returnValue = new JSONObject(map); - - return returnValue; - - } - - public HashMap getRefAttributeList(EPackage root, String className){ - - TreeIterator treeItr = root.eAllContents(); - boolean requiredAttribute = false; - HashMap refAttribute = new HashMap(); - int rollingCount = 0; - int processClass = 0; - boolean annotation = false; - - // Pulling out dependency from file - while (treeItr.hasNext()) { - EObject obj = treeItr.next(); - if (obj instanceof EClassifier) { - requiredAttribute = isRequiredAttribute(obj, className); - if (requiredAttribute){ - processClass++; - } - rollingCount = rollingCount+processClass; - } - - if (requiredAttribute) { - if (obj instanceof EStructuralFeature) { - EStructuralFeature eStrucClassifier = (EStructuralFeature) obj; - if (eStrucClassifier.getEAnnotations().size() != 0) { - annotation = testAnnotation(eStrucClassifier); - if ( annotation && obj instanceof EReference) { - EClass refType = ((EReference) obj).getEReferenceType(); - if(refType.toString().contains("eProxyURI:")){ - String one = refType.toString().split("eProxyURI:")[1]; - String refValue = StringUtils.replaceEach(one.split("#")[1], new String[]{"//", ")"}, new String[]{"", ""}); - refAttribute.put(eStrucClassifier.getName(), refValue); - } else { - String array = arrayCheck(((EStructuralFeature) obj).getUpperBound()); - if (array.contains("false")){ - array = ""; - } - refAttribute.put(eStrucClassifier.getName(), refType.getName() + array); - } - } - } - } - } - } - return refAttribute; - } - - private boolean testAnnotation(EStructuralFeature eStrucClassifier) { - String annotationType = null; - EAnnotation eAnnotation = null; - String ecompType = null; - - EList value = eStrucClassifier.getEAnnotations(); - - for (int i = 0; i < value.size(); i++){ - annotationType = value.get(i).getSource(); - eAnnotation = eStrucClassifier.getEAnnotations().get(i); - ecompType = eAnnotation.getDetails().get(0).getValue(); - if (annotationType.contains("http://localhost.com") && ecompType.contains("configuration")){ - return true; - } - } - - return false; - } - - public boolean isRequiredAttribute(EObject obj, String className){ - EClassifier eClassifier = (EClassifier) obj; - String workingClass = eClassifier.getName(); - workingClass.trim(); - if (workingClass.equalsIgnoreCase(className)){ - return true; - } - - return false; - } - - public HashMap getAttributeList(EPackage root, String className){ - - TreeIterator treeItr = root.eAllContents(); - boolean reference = false; - boolean requiredAttribute = false; - HashMap refAttribute = new HashMap(); - String workingClass = null; - boolean annotation = false; - - // Pulling out dependency from file - while (treeItr.hasNext()) { - reference = false; - EObject obj = treeItr.next(); - if (obj instanceof EClassifier) { - requiredAttribute = isRequiredAttribute(obj, className ); - } - - if (requiredAttribute){ - if (obj instanceof EStructuralFeature) { - EStructuralFeature eStrucClassifier = (EStructuralFeature) obj; - if (eStrucClassifier.getEAnnotations().size() != 0) { - annotation = testAnnotation(eStrucClassifier); - if (annotation && !(obj instanceof EReference)) { - String name = eStrucClassifier.getName(); - String defaultValue = checkDefultValue(((EStructuralFeature) obj).getDefaultValueLiteral()); - String eType = eStrucClassifier.getEType().getInstanceClassName(); - String array = arrayCheck(((EStructuralFeature) obj).getUpperBound()); - String required = checkRequiredPattern(((EStructuralFeature) obj).getUpperBound(), ((EStructuralFeature) obj).getLowerBound()); - String attributeValue = eType + defaultValue + required + array; - refAttribute.put(name, attributeValue); - } - } - } - } - } - return refAttribute; - - } - - public String arrayCheck(int upperBound) { - - if (upperBound == -1){ - return ":MANY-true"; - } - - return ":MANY-false"; - } - - public List getDependencyList(EClassifier eClassifier, String className){ - List returnValue = new ArrayList<>();; - EList somelist = ((EClass) eClassifier).getEAllSuperTypes(); - if (somelist.isEmpty()){ - return returnValue; - } - for(EClass depend: somelist){ - if (depend.toString().contains("eProxyURI:")){ - String one = depend.toString().split("eProxyURI:")[1]; - String value = StringUtils.replaceEach(one.split("#")[1], new String[]{"//", ")"}, new String[]{"", ""}); - returnValue.add(value); - } - } - - return returnValue; - } - - public String createJson(HashMap subClassAttributes, HashMap classMap, String className) { - String json = ""; - JSONObject jsonObj; - - jsonObj = new JSONObject(); - - Map missingValues = new HashMap(); - Map workingMap = new HashMap(); - - for ( Entry map : classMap.get(className).getRefAttribute().entrySet()){ - String value = map.getValue().split(":")[0]; - if (value!=null){ - workingMap = classMap.get(value).getRefAttribute(); - for ( Entry subMab : workingMap.entrySet()){ - String value2 = subMab.getValue().split(":")[0]; - if (!subClassAttributes.containsValue(value2)){ - missingValues.put(subMab.getKey(), subMab.getValue()); - classMap.get(value).addAttribute(subMab.getKey(), subMab.getValue()); - } - } - - } - } - - if (!missingValues.isEmpty()){ - for (Entry addValue : missingValues.entrySet()){ - subClassAttributes.put(addValue.getKey(), addValue.getValue().split(":")[0]); - } - } - - for ( Map.Entry map : subClassAttributes.entrySet()){ - jsonObj.put(map.getValue().split(":")[0], classMap.get(map.getValue().split(":")[0]).getAttribute()); - } - - if (logger.isDebugEnabled()) { - logger.debug("Json value: " + jsonObj); - } - - return jsonObj.toString(); - } - - public String createSubAttributes(ArrayList dependency, HashMap classMap, String modelName) { - - HashMap workingMap = new HashMap(); - MSAttributeObject tempObject = new MSAttributeObject(); - HashMap refAttribute = new HashMap(); - HashMap workingSubMap = new HashMap(); - Map tempPefAttribute = null; - LinkedList linkedList = new LinkedList(); - String addedValue = null; - - boolean addingValues = false; - - if (dependency!=null){ - if (dependency.size()==0){ - return "{}"; - } - dependency.add(modelName); - for (String element: dependency){ - tempObject = classMap.get(element); - if (tempObject!=null){ - workingMap.putAll(classMap.get(element).getSubClass()); - // workingSubMap = CheckForSecondSubClass(classMap.get(element).getSubClass(), classMap); - // if (workingSubMap!=null){ - // workingMap.putAll(workingSubMap); - // } - } - } - } - - String returnValue = createJson(workingMap, classMap, modelName); - return returnValue; - } - - private HashMap CheckForSecondSubClass(HashMap subClass, HashMap mainMap) { - MSAttributeObject tempObject = new MSAttributeObject(); - HashMap subClassValue = new HashMap(); - - for (Entry classSet : subClass.entrySet()){ - String key = classSet.getKey(); - String value = classSet.getValue(); - tempObject = mainMap.get(value); - subClassValue = tempObject.getSubClass(); - if (subClassValue!=null){ - return subClassValue; - } - } - return null; - - } - - public ArrayList getFullDependencyList(ArrayList dependency, HashMap classMap) { - ArrayList returnList = new ArrayList(); - ArrayList workingList = new ArrayList(); - int i = 0; - MSAttributeObject newDepend = null; - returnList.addAll(dependency); - for (String element : dependency ){ - if (classMap.containsKey(element)){ - MSAttributeObject value = classMap.get(element); - String rawValue = StringUtils.replaceEach(value.getDependency(), new String[]{"[", "]"}, new String[]{"", ""}); - workingList = new ArrayList(Arrays.asList(rawValue.split(","))); - for(String depend : workingList){ - if (!returnList.contains(depend) && !depend.isEmpty()){ - returnList.add(depend.trim()); - } - } - } - } - - return returnList; - } -} diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/ModelObject.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/ModelObject.java deleted file mode 100644 index bc7fa9f2d..000000000 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/ModelObject.java +++ /dev/null @@ -1,157 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP-REST - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - - -package org.openecomp.policy.rest.util; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class ModelObject { - private String name; - private String parent; - private List attibutes = new ArrayList(); - private List arrays = new ArrayList(); - private List integers = new ArrayList(); - private List subObjects = new ArrayList(); - private HashMap> subObjectList = new HashMap>(); - private HashMap attribute = new HashMap(); - private Map> arrayTextList = new HashMap>(); - private Map textFieldLayout = new HashMap(); - - private boolean many = false; - - public Map> getArrayTextList() { - return arrayTextList; - } - public void setArrayTextList(Map> arrayTextList) { - this.arrayTextList = arrayTextList; - } - public void addArrayTextList(String name, TextField textField ){ - LinkedList list = new LinkedList(); - if (getArrayTextList().get(name) != null){ - list = getArrayTextList().get(name); - } - - list.push(textField); - this.arrayTextList.put(name, list); - } - public void removeLastTextList(String name){ - LinkedList list = getArrayTextList().get(name); - - list.pop(); - this.arrayTextList.put(name, list); - } - public HashMap getAttribute() { - return attribute; - } - public void setAttribute(HashMap attribute) { - this.attribute = attribute; - } - public void addAttribute(String name, TextField textField){ - this.attribute.put(name, textField); - } - public List getAttibutes() { - return attibutes; - } - public void setAttibutes(List attibutes) { - this.attibutes = attibutes; - } - public List getArrays() { - return arrays; - } - public void setArrays(List arrays) { - this.arrays = arrays; - } - public List getIntegers() { - return integers; - } - public void setIntegers(List integers) { - this.integers = integers; - } - public List getSubObjects() { - return subObjects; - } - public void setSubObjects(List subObjects) { - this.subObjects = subObjects; - } - public void addSubObject(ModelObject subObjects ){ - this.subObjects.add(subObjects); - } - public void addAttributes(String attibutes){ - this.attibutes.add(attibutes); - } - public void addArrays(String arrays){ - this.arrays.add(arrays); - } - public void addIntegers(Integer integers){ - this.integers.add(integers); - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public boolean isMany() { - return many; - } - public void setMany(boolean many) { - this.many = many; - } - public String getParent() { - return parent; - } - public void setParent(String parent) { - this.parent = parent; - } - public HashMap> getSubObjectList() { - return subObjectList; - } - public void setSubObjectList(HashMap> subObjectList) { - this.subObjectList = subObjectList; - } - public void addSubObjectList(String name, ModelObject object) { - LinkedList list = new LinkedList(); - if (subObjectList.get(name) != null){ - list = subObjectList.get(name); - } - - list.push(object); - - this.subObjectList.put(name, list); - } - public Map getTextFieldLayout() { - return textFieldLayout; - } - public void setTextFieldLayout(Map textFieldLayout) { - this.textFieldLayout = textFieldLayout; - } - public void addTextFieldLayout(String name, VerticalLayout vLayout){ - this.textFieldLayout.put(name, vLayout); - } - -} -*/ diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/Webapps.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/Webapps.java index c2f4ff2c6..ef1eecf27 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/Webapps.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/Webapps.java @@ -38,7 +38,7 @@ import org.openecomp.policy.common.logging.eelf.PolicyLogger; public class Webapps { private static String actionHome = null; private static String configHome = null; - private static Log logger = LogFactory.getLog(Webapps.class); + private static Log LOGGER = LogFactory.getLog(Webapps.class); private Webapps() { } @@ -66,8 +66,7 @@ public class Webapps { Path webappsPath = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_WEBAPPS)); //Sanity Check if (webappsPath == null) { - logger.error("Invalid Webapps Path Location property : " + XACMLRestProperties.PROP_PAP_WEBAPPS); - // TODO:EELF Cleanup - Remove logger + LOGGER.error("Invalid Webapps Path Location property : " + XACMLRestProperties.PROP_PAP_WEBAPPS); PolicyLogger.error("Invalid Webapps Path Location property : " + XACMLRestProperties.PROP_PAP_WEBAPPS); throw new Exception("Invalid Webapps Path Location property : " + XACMLRestProperties.PROP_PAP_WEBAPPS); } @@ -88,9 +87,8 @@ public class Webapps { try { Files.createDirectories(webappsPathConfig); } catch (IOException e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to create config directory: " + LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to create config directory: " + webappsPathConfig.toAbsolutePath().toString(), e); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "Webapps", "Failed to create config directory"); } } @@ -99,9 +97,8 @@ public class Webapps { try { Files.createDirectories(webappsPathAction); } catch (IOException e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to create config directory: " + LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to create config directory: " + webappsPathAction.toAbsolutePath().toString(), e); - // TODO:EELF Cleanup - Remove logger PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "Webapps", "Failed to create config directory"); } } diff --git a/ECOMP-REST/src/test/java/org/openecomp/policy/rest/XACMLRestTest.java b/ECOMP-REST/src/test/java/org/openecomp/policy/rest/XACMLRestTest.java index 0d9355ad5..c49231b6a 100644 --- a/ECOMP-REST/src/test/java/org/openecomp/policy/rest/XACMLRestTest.java +++ b/ECOMP-REST/src/test/java/org/openecomp/policy/rest/XACMLRestTest.java @@ -20,7 +20,7 @@ package org.openecomp.policy.rest; -import java.io.IOException; +/*import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Collections; @@ -73,7 +73,6 @@ public class XACMLRestTest extends TestCase{ try { Mockito.when(httpServletResponse.getOutputStream()).thenReturn(mockOutput); } catch (IOException e) { - // TODO Auto-generated catch block fail(); } @@ -99,10 +98,10 @@ public class XACMLRestTest extends TestCase{ try { assertTrue(true); } catch (Exception e) { - // TODO Auto-generated catch block fail(); } } } +*/ \ No newline at end of file -- cgit 1.2.3-korg