Code refactoring 41/31841/1
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Thu, 15 Feb 2018 15:04:12 +0000 (16:04 +0100)
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Thu, 15 Feb 2018 15:04:12 +0000 (16:04 +0100)
Code refactoring, mainly Classes/Methods name renaming

Issue-ID: CLAMP-85
Change-Id: I12bd190576e324ed33f057dc1a4ad32c16fcb6c2
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
49 files changed:
pom.xml
src/main/java/org/onap/clamp/clds/Application.java
src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
src/main/java/org/onap/clamp/clds/client/HolmesPolicyDelegate.java
src/main/java/org/onap/clamp/clds/client/HolmesPolicyDeleteDelegate.java
src/main/java/org/onap/clamp/clds/client/OperationalPolicyDelegate.java
src/main/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegate.java
src/main/java/org/onap/clamp/clds/client/SdcSendReqDelegate.java
src/main/java/org/onap/clamp/clds/client/TcaPolicyDelegate.java
src/main/java/org/onap/clamp/clds/client/TcaPolicyDeleteDelegate.java
src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyReq.java
src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java
src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java
src/main/java/org/onap/clamp/clds/client/req/sdc/SdcRequests.java [moved from src/main/java/org/onap/clamp/clds/client/req/sdc/SdcReq.java with 75% similarity]
src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java
src/main/java/org/onap/clamp/clds/config/CldsReferenceProperties.java [moved from src/main/java/org/onap/clamp/clds/model/refprop/RefProp.java with 97% similarity]
src/main/java/org/onap/clamp/clds/model/properties/AbstractModelElement.java [moved from src/main/java/org/onap/clamp/clds/model/prop/AbstractModelElement.java with 98% similarity]
src/main/java/org/onap/clamp/clds/model/properties/Global.java [moved from src/main/java/org/onap/clamp/clds/model/prop/Global.java with 97% similarity]
src/main/java/org/onap/clamp/clds/model/properties/Holmes.java [moved from src/main/java/org/onap/clamp/clds/model/prop/Holmes.java with 95% similarity]
src/main/java/org/onap/clamp/clds/model/properties/ModelBpmn.java [moved from src/main/java/org/onap/clamp/clds/model/prop/ModelBpmn.java with 98% similarity]
src/main/java/org/onap/clamp/clds/model/properties/ModelBpmnEntry.java [moved from src/main/java/org/onap/clamp/clds/model/prop/ModelBpmnEntry.java with 96% similarity]
src/main/java/org/onap/clamp/clds/model/properties/ModelProperties.java [moved from src/main/java/org/onap/clamp/clds/model/prop/ModelProperties.java with 99% similarity]
src/main/java/org/onap/clamp/clds/model/properties/Policy.java [moved from src/main/java/org/onap/clamp/clds/model/prop/Policy.java with 96% similarity]
src/main/java/org/onap/clamp/clds/model/properties/PolicyChain.java [moved from src/main/java/org/onap/clamp/clds/model/prop/PolicyChain.java with 98% similarity]
src/main/java/org/onap/clamp/clds/model/properties/PolicyItem.java [moved from src/main/java/org/onap/clamp/clds/model/prop/PolicyItem.java with 98% similarity]
src/main/java/org/onap/clamp/clds/model/properties/ResourceGroup.java [moved from src/main/java/org/onap/clamp/clds/model/prop/ResourceGroup.java with 97% similarity]
src/main/java/org/onap/clamp/clds/model/properties/ServiceConfiguration.java [moved from src/main/java/org/onap/clamp/clds/model/prop/ServiceConfiguration.java with 98% similarity]
src/main/java/org/onap/clamp/clds/model/properties/Tca.java [moved from src/main/java/org/onap/clamp/clds/model/prop/Tca.java with 95% similarity]
src/main/java/org/onap/clamp/clds/model/properties/TcaItem.java [moved from src/main/java/org/onap/clamp/clds/model/prop/TcaItem.java with 97% similarity]
src/main/java/org/onap/clamp/clds/model/properties/TcaThreshold.java [moved from src/main/java/org/onap/clamp/clds/model/prop/TcaThreshold.java with 96% similarity]
src/main/java/org/onap/clamp/clds/model/sdc/SdcArtifact.java [moved from src/main/java/org/onap/clamp/clds/model/CldsSdcArtifact.java with 96% similarity]
src/main/java/org/onap/clamp/clds/model/sdc/SdcResource.java [moved from src/main/java/org/onap/clamp/clds/model/CldsSdcResource.java with 87% similarity]
src/main/java/org/onap/clamp/clds/model/sdc/SdcResourceBasicInfo.java [moved from src/main/java/org/onap/clamp/clds/model/CldsSdcResourceBasicInfo.java with 94% similarity]
src/main/java/org/onap/clamp/clds/model/sdc/SdcServiceDetail.java [moved from src/main/java/org/onap/clamp/clds/model/CldsSdcServiceDetail.java with 90% similarity]
src/main/java/org/onap/clamp/clds/model/sdc/SdcServiceInfo.java [moved from src/main/java/org/onap/clamp/clds/model/CldsSdcServiceInfo.java with 95% similarity]
src/main/java/org/onap/clamp/clds/service/CldsService.java
src/test/java/org/onap/clamp/clds/AbstractItCase.java
src/test/java/org/onap/clamp/clds/it/CldsReferencePropertiesItCase.java [moved from src/test/java/org/onap/clamp/clds/it/RefPropItCase.java with 95% similarity]
src/test/java/org/onap/clamp/clds/it/HolmesPolicyDelegateItCase.java
src/test/java/org/onap/clamp/clds/it/OperationPolicyReqItCase.java
src/test/java/org/onap/clamp/clds/it/PolicyClientItCase.java
src/test/java/org/onap/clamp/clds/it/SdcCatalogServicesItCase.java
src/test/java/org/onap/clamp/clds/it/SdcReqItCase.java
src/test/java/org/onap/clamp/clds/it/TcaRequestFormatterItCase.java
src/test/java/org/onap/clamp/clds/model/prop/CustomModelElement.java
src/test/java/org/onap/clamp/clds/model/prop/CustomModelElementTest.java
src/test/java/org/onap/clamp/clds/model/prop/ModelPropertiesTest.java
src/test/resources/http-cache/start_http_cache.sh

diff --git a/pom.xml b/pom.xml
index b0890a5..3a482dd 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                                                                                <groupId>org.mariadb.jdbc</groupId>
                                                                                <artifactId>mariadb-java-client</artifactId>
                                                                </exclusion>
+                                                               <exclusion>
+                                                                               <groupId>com.att.nsa</groupId>
+                                                                               <artifactId>dmaapClient</artifactId>
+                                                               </exclusion>
                                                </exclusions>
                                </dependency>
                                <dependency>
index 281a87c..9d057b5 100644 (file)
@@ -28,8 +28,8 @@ import com.att.eelf.configuration.EELFManager;
 
 import org.apache.camel.component.servlet.CamelHttpTransportServlet;
 import org.apache.catalina.connector.Connector;
-import org.onap.clamp.clds.model.prop.Holmes;
-import org.onap.clamp.clds.model.prop.ModelProperties;
+import org.onap.clamp.clds.model.properties.Holmes;
+import org.onap.clamp.clds.model.properties.ModelProperties;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.actuate.autoconfigure.ManagementWebSecurityAutoConfiguration;
index 6053a0d..3c8649c 100644 (file)
@@ -31,8 +31,8 @@ import java.util.Date;
 \r
 import org.json.simple.JSONObject;\r
 import org.json.simple.parser.JSONParser;\r
+import org.onap.clamp.clds.config.CldsReferenceProperties;\r
 import org.onap.clamp.clds.exception.DcaeDeploymentException;\r
-import org.onap.clamp.clds.model.refprop.RefProp;\r
 import org.onap.clamp.clds.util.LoggingUtils;\r
 import org.springframework.beans.factory.annotation.Autowired;\r
 import org.springframework.stereotype.Component;\r
@@ -47,7 +47,7 @@ public class DcaeDispatcherServices {
     protected static final EELFLogger logger = EELFManager.getInstance().getLogger(DcaeDispatcherServices.class);\r
     protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();\r
     @Autowired\r
-    private RefProp refProp;\r
+    private CldsReferenceProperties refProp;\r
     private static final String STATUS_URL_LOG = "Status URL extracted: ";\r
     private static final String DCAE_URL_PREFIX = "/dcae-deployments/";\r
     private static final String DCAE_URL_PROPERTY_NAME = "DCAE_DISPATCHER_URL";\r
index 4dfe089..1abd889 100644 (file)
@@ -41,13 +41,13 @@ import org.json.simple.JSONArray;
 import org.json.simple.JSONObject;\r
 import org.json.simple.parser.JSONParser;\r
 import org.json.simple.parser.ParseException;\r
+import org.onap.clamp.clds.config.CldsReferenceProperties;\r
 import org.onap.clamp.clds.dao.CldsDao;\r
 import org.onap.clamp.clds.model.CldsEvent;\r
 import org.onap.clamp.clds.model.CldsModel;\r
 import org.onap.clamp.clds.model.DcaeEvent;\r
-import org.onap.clamp.clds.model.prop.Global;\r
-import org.onap.clamp.clds.model.prop.ModelProperties;\r
-import org.onap.clamp.clds.model.refprop.RefProp;\r
+import org.onap.clamp.clds.model.properties.Global;\r
+import org.onap.clamp.clds.model.properties.ModelProperties;\r
 import org.onap.clamp.clds.util.LoggingUtils;\r
 import org.springframework.beans.factory.annotation.Autowired;\r
 import org.springframework.stereotype.Component;\r
@@ -63,7 +63,7 @@ public class DcaeInventoryServices {
     protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();\r
     private static final String DCAE_INVENTORY_URL = "DCAE_INVENTORY_URL";\r
     @Autowired\r
-    private RefProp refProp;\r
+    private CldsReferenceProperties refProp;\r
     @Autowired\r
     private CldsDao cldsDao;\r
 \r
index 3465598..4e165e1 100644 (file)
@@ -31,9 +31,9 @@ import java.util.UUID;
 import org.apache.camel.Exchange;
 import org.apache.camel.Handler;
 import org.onap.clamp.clds.client.req.policy.PolicyClient;
-import org.onap.clamp.clds.model.prop.Holmes;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.model.refprop.RefProp;
+import org.onap.clamp.clds.config.CldsReferenceProperties;
+import org.onap.clamp.clds.model.properties.Holmes;
+import org.onap.clamp.clds.model.properties.ModelProperties;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -48,7 +48,7 @@ public class HolmesPolicyDelegate {
     @Autowired
     private PolicyClient policyClient;
     @Autowired
-    private RefProp refProp;
+    private CldsReferenceProperties refProp;
 
     /**
      * Perform activity. Send Holmes info to policy api.
index 28da148..9075ea6 100644 (file)
@@ -29,8 +29,8 @@ import com.att.eelf.configuration.EELFManager;
 import org.apache.camel.Exchange;
 import org.apache.camel.Handler;
 import org.onap.clamp.clds.client.req.policy.PolicyClient;
-import org.onap.clamp.clds.model.prop.Holmes;
-import org.onap.clamp.clds.model.prop.ModelProperties;
+import org.onap.clamp.clds.model.properties.Holmes;
+import org.onap.clamp.clds.model.properties.ModelProperties;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
index 77d7680..ec83db9 100644 (file)
@@ -33,10 +33,10 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Handler;
 import org.onap.clamp.clds.client.req.policy.OperationalPolicyReq;
 import org.onap.clamp.clds.client.req.policy.PolicyClient;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.model.prop.Policy;
-import org.onap.clamp.clds.model.prop.PolicyChain;
-import org.onap.clamp.clds.model.refprop.RefProp;
+import org.onap.clamp.clds.config.CldsReferenceProperties;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.model.properties.Policy;
+import org.onap.clamp.clds.model.properties.PolicyChain;
 import org.onap.clamp.clds.util.LoggingUtils;
 import org.onap.policy.api.AttributeType;
 import org.onap.policy.controlloop.policy.builder.BuilderException;
@@ -61,7 +61,7 @@ public class OperationalPolicyDelegate {
      * Automatically injected by Spring, define in CldsConfiguration as a bean.
      */
     @Autowired
-    private RefProp refProp;
+    private CldsReferenceProperties refProp;
 
     /**
      * Perform activity. Send Operational Policy info to policy api.
index 4dd2040..862d68a 100644 (file)
@@ -29,9 +29,9 @@ import com.att.eelf.configuration.EELFManager;
 import org.apache.camel.Exchange;
 import org.apache.camel.Handler;
 import org.onap.clamp.clds.client.req.policy.PolicyClient;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.model.prop.Policy;
-import org.onap.clamp.clds.model.prop.PolicyChain;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.model.properties.Policy;
+import org.onap.clamp.clds.model.properties.PolicyChain;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
index e21bfce..438ea47 100644 (file)
@@ -34,11 +34,11 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Handler;
 import org.apache.commons.codec.DecoderException;
 import org.onap.clamp.clds.client.req.sdc.SdcCatalogServices;
-import org.onap.clamp.clds.client.req.sdc.SdcReq;
+import org.onap.clamp.clds.client.req.sdc.SdcRequests;
+import org.onap.clamp.clds.config.CldsReferenceProperties;
 import org.onap.clamp.clds.model.DcaeEvent;
-import org.onap.clamp.clds.model.prop.Global;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.model.refprop.RefProp;
+import org.onap.clamp.clds.model.properties.Global;
+import org.onap.clamp.clds.model.properties.ModelProperties;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -53,9 +53,9 @@ public class SdcSendReqDelegate {
     @Autowired
     private SdcCatalogServices sdcCatalogServices;
     @Autowired
-    private SdcReq sdcReq;
+    private SdcRequests sdcReq;
     @Autowired
-    private RefProp refProp;
+    private CldsReferenceProperties refProp;
 
     /**
      * Perform activity. Send to sdc proxy.
@@ -72,7 +72,6 @@ public class SdcSendReqDelegate {
     @Handler
     public void execute(Exchange camelExchange) throws GeneralSecurityException, DecoderException, IOException {
         String controlName = (String) camelExchange.getProperty("controlName");
-        String baseUrl = refProp.getStringValue("sdc.serviceUrl");
         String artifactLabel = sdcReq
                 .normalizeResourceInstanceName(refProp.getStringValue("sdc.artifactLabel") + "-" + controlName);
         String locationArtifactLabel = sdcReq
@@ -98,7 +97,7 @@ public class SdcSendReqDelegate {
                 String serviceInvariantUUID = globalProps.getService();
                 camelExchange.setProperty("serviceInvariantUUID", serviceInvariantUUID);
             }
-            List<String> sdcReqUrlsList = sdcReq.getSdcReqUrlsList(prop, baseUrl);
+            List<String> sdcReqUrlsList = sdcReq.getSdcReqUrlsList(prop);
             String sdcLocationsPayload = sdcReq.formatSdcLocationsReq(prop, artifactName);
             String locationArtifactName = (String) camelExchange.getProperty("controlName") + "-location.json";
             String formattedSdcLocationReq = sdcReq.formatSdcReq(sdcLocationsPayload, locationArtifactName,
index 2657a03..55fe2c5 100644 (file)
@@ -32,9 +32,9 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Handler;
 import org.onap.clamp.clds.client.req.policy.PolicyClient;
 import org.onap.clamp.clds.client.req.tca.TcaRequestFormatter;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.model.prop.Tca;
-import org.onap.clamp.clds.model.refprop.RefProp;
+import org.onap.clamp.clds.config.CldsReferenceProperties;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.model.properties.Tca;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -47,7 +47,7 @@ public class TcaPolicyDelegate {
     protected static final EELFLogger logger = EELFManager.getInstance().getLogger(TcaPolicyDelegate.class);
     protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
     @Autowired
-    private RefProp refProp;
+    private CldsReferenceProperties refProp;
     @Autowired
     private PolicyClient policyClient;
 
index c2aa303..c38d300 100644 (file)
@@ -29,8 +29,8 @@ import com.att.eelf.configuration.EELFManager;
 import org.apache.camel.Exchange;
 import org.apache.camel.Handler;
 import org.onap.clamp.clds.client.req.policy.PolicyClient;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.model.prop.Tca;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.model.properties.Tca;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
index 8753a9f..434da4b 100644 (file)
@@ -39,12 +39,12 @@ import java.util.Map;
 
 import javax.ws.rs.BadRequestException;
 
-import org.onap.clamp.clds.model.prop.Global;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.model.prop.PolicyChain;
-import org.onap.clamp.clds.model.prop.PolicyItem;
-import org.onap.clamp.clds.model.prop.Tca;
-import org.onap.clamp.clds.model.refprop.RefProp;
+import org.onap.clamp.clds.config.CldsReferenceProperties;
+import org.onap.clamp.clds.model.properties.Global;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.model.properties.PolicyChain;
+import org.onap.clamp.clds.model.properties.PolicyItem;
+import org.onap.clamp.clds.model.properties.Tca;
 import org.onap.policy.api.AttributeType;
 import org.onap.policy.controlloop.policy.OperationsAccumulateParams;
 import org.onap.policy.controlloop.policy.Policy;
@@ -80,7 +80,7 @@ public class OperationalPolicyReq {
      * @throws BuilderException
      * @throws UnsupportedEncodingException
      */
-    public static Map<AttributeType, Map<String, String>> formatAttributes(RefProp refProp, ModelProperties prop,
+    public static Map<AttributeType, Map<String, String>> formatAttributes(CldsReferenceProperties refProp, ModelProperties prop,
             String modelElementId, PolicyChain policyChain) throws BuilderException, UnsupportedEncodingException {
         Global global = prop.getGlobal();
         prop.setCurrentModelElementId(modelElementId);
@@ -163,7 +163,7 @@ public class OperationalPolicyReq {
      * @throws BuilderException
      * @throws UnsupportedEncodingException
      */
-    protected static String formatOpenLoopYaml(RefProp refProp, ModelProperties prop, String modelElementId,
+    protected static String formatOpenLoopYaml(CldsReferenceProperties refProp, ModelProperties prop, String modelElementId,
             PolicyChain policyChain) throws BuilderException, UnsupportedEncodingException {
         // get property objects
         Global global = prop.getGlobal();
@@ -193,7 +193,7 @@ public class OperationalPolicyReq {
      * @throws BuilderException
      * @throws UnsupportedEncodingException
      */
-    protected static String formatYaml(RefProp refProp, ModelProperties prop, String modelElementId,
+    protected static String formatYaml(CldsReferenceProperties refProp, ModelProperties prop, String modelElementId,
             PolicyChain policyChain) throws BuilderException, UnsupportedEncodingException {
         // get property objects
         Global global = prop.getGlobal();
@@ -251,7 +251,7 @@ public class OperationalPolicyReq {
      * @throws BuilderException
      * @throws UnsupportedEncodingException
      */
-    protected static String formateNodeBYaml(RefProp refProp, ModelProperties prop, String modelElementId,
+    protected static String formateNodeBYaml(CldsReferenceProperties refProp, ModelProperties prop, String modelElementId,
             PolicyChain policyChain) throws BuilderException, UnsupportedEncodingException {
         // get property objects
         Global global = prop.getGlobal();
@@ -329,7 +329,7 @@ public class OperationalPolicyReq {
      * @param inOrigList
      * @return
      */
-    private static List<PolicyItem> addAOTSActorRecipe(RefProp refProp, String service, List<PolicyItem> inOrigList) {
+    private static List<PolicyItem> addAOTSActorRecipe(CldsReferenceProperties refProp, String service, List<PolicyItem> inOrigList) {
         List<PolicyItem> outList = new ArrayList<>();
         try {
             PolicyItem policyItem = inOrigList.get(0);
index 0460033..ee78b45 100644 (file)
@@ -37,9 +37,9 @@ import java.util.UUID;
 
 import javax.ws.rs.BadRequestException;
 
+import org.onap.clamp.clds.config.CldsReferenceProperties;
 import org.onap.clamp.clds.exception.policy.PolicyClientException;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.model.refprop.RefProp;
+import org.onap.clamp.clds.model.properties.ModelProperties;
 import org.onap.clamp.clds.util.LoggingUtils;
 import org.onap.policy.api.AttributeType;
 import org.onap.policy.api.ConfigRequestParameters;
@@ -76,7 +76,7 @@ public class PolicyClient {
     @Autowired
     protected ApplicationContext appContext;
     @Autowired
-    protected RefProp refProp;
+    protected CldsReferenceProperties refProp;
 
     /**
      * Perform BRMS policy type.
index 45dbf81..299ec1e 100644 (file)
@@ -58,20 +58,20 @@ import org.apache.commons.csv.CSVRecord;
 import org.apache.commons.io.IOUtils;\r
 import org.apache.commons.lang3.StringUtils;\r
 import org.apache.http.HttpHeaders;\r
+import org.onap.clamp.clds.config.CldsReferenceProperties;\r
 import org.onap.clamp.clds.exception.SdcCommunicationException;\r
 import org.onap.clamp.clds.model.CldsAlarmCondition;\r
-import org.onap.clamp.clds.model.CldsSdcArtifact;\r
-import org.onap.clamp.clds.model.CldsSdcResource;\r
-import org.onap.clamp.clds.model.CldsSdcResourceBasicInfo;\r
-import org.onap.clamp.clds.model.CldsSdcServiceDetail;\r
-import org.onap.clamp.clds.model.CldsSdcServiceInfo;\r
 import org.onap.clamp.clds.model.CldsServiceData;\r
 import org.onap.clamp.clds.model.CldsVfData;\r
 import org.onap.clamp.clds.model.CldsVfKPIData;\r
 import org.onap.clamp.clds.model.CldsVfcData;\r
-import org.onap.clamp.clds.model.prop.Global;\r
-import org.onap.clamp.clds.model.prop.ModelProperties;\r
-import org.onap.clamp.clds.model.refprop.RefProp;\r
+import org.onap.clamp.clds.model.properties.Global;\r
+import org.onap.clamp.clds.model.properties.ModelProperties;\r
+import org.onap.clamp.clds.model.sdc.SdcArtifact;\r
+import org.onap.clamp.clds.model.sdc.SdcResource;\r
+import org.onap.clamp.clds.model.sdc.SdcResourceBasicInfo;\r
+import org.onap.clamp.clds.model.sdc.SdcServiceDetail;\r
+import org.onap.clamp.clds.model.sdc.SdcServiceInfo;\r
 import org.onap.clamp.clds.util.CryptoUtils;\r
 import org.onap.clamp.clds.util.LoggingUtils;\r
 import org.springframework.beans.factory.annotation.Autowired;\r
@@ -93,7 +93,7 @@ public class SdcCatalogServices {
     private static final String SDC_INSTANCE_ID_CLAMP = "CLAMP-Tool";\r
     private static final String RESOURCE_URL_PREFIX = "resources";\r
     @Autowired\r
-    private RefProp refProp;\r
+    private CldsReferenceProperties refProp;\r
 \r
     /**\r
      * Return SDC id and pw as a HTTP Basic Auth string (for example: Basic\r
@@ -165,8 +165,8 @@ public class SdcCatalogServices {
      *            A list of CldsSdcServiceInfo\r
      * @return A list of CldsSdcServiceInfo without duplicate service UUID\r
      */\r
-    public List<CldsSdcServiceInfo> removeDuplicateServices(List<CldsSdcServiceInfo> rawCldsSdcServiceList) {\r
-        List<CldsSdcServiceInfo> cldsSdcServiceInfoList = null;\r
+    public List<SdcServiceInfo> removeDuplicateServices(List<SdcServiceInfo> rawCldsSdcServiceList) {\r
+        List<SdcServiceInfo> cldsSdcServiceInfoList = null;\r
         if (rawCldsSdcServiceList != null && !rawCldsSdcServiceList.isEmpty()) {\r
             // sort list\r
             Collections.sort(rawCldsSdcServiceList);\r
@@ -176,7 +176,7 @@ public class SdcCatalogServices {
             for (int i = 1; i < rawCldsSdcServiceList.size(); i++) {\r
                 // compare name with previous - if not equal, then keep the\r
                 // previous (it's the last with that name)\r
-                CldsSdcServiceInfo prev = rawCldsSdcServiceList.get(i - 1);\r
+                SdcServiceInfo prev = rawCldsSdcServiceList.get(i - 1);\r
                 if (!rawCldsSdcServiceList.get(i).getName().equals(prev.getName())) {\r
                     cldsSdcServiceInfoList.add(prev);\r
                 }\r
@@ -193,8 +193,8 @@ public class SdcCatalogServices {
      * @param rawCldsSdcResourceList\r
      * @return List of CldsSdcResource\r
      */\r
-    public List<CldsSdcResource> removeDuplicateSdcResourceInstances(List<CldsSdcResource> rawCldsSdcResourceList) {\r
-        List<CldsSdcResource> cldsSdcResourceList = null;\r
+    public List<SdcResource> removeDuplicateSdcResourceInstances(List<SdcResource> rawCldsSdcResourceList) {\r
+        List<SdcResource> cldsSdcResourceList = null;\r
         if (rawCldsSdcResourceList != null && !rawCldsSdcResourceList.isEmpty()) {\r
             // sort list\r
             Collections.sort(rawCldsSdcResourceList);\r
@@ -204,7 +204,7 @@ public class SdcCatalogServices {
             for (int i = 1; i < rawCldsSdcResourceList.size(); i++) {\r
                 // compare name with previous - if not equal, then keep the\r
                 // previous (it's the last with that name)\r
-                CldsSdcResource prev = rawCldsSdcResourceList.get(i - 1);\r
+                SdcResource prev = rawCldsSdcResourceList.get(i - 1);\r
                 if (!rawCldsSdcResourceList.get(i).getResourceInstanceName().equals(prev.getResourceInstanceName())) {\r
                     cldsSdcResourceList.add(prev);\r
                 }\r
@@ -221,9 +221,9 @@ public class SdcCatalogServices {
      * @param rawCldsSdcResourceListBasicList\r
      * @return List of CldsSdcResourceBasicInfo\r
      */\r
-    public List<CldsSdcResourceBasicInfo> removeDuplicateSdcResourceBasicInfo(\r
-            List<CldsSdcResourceBasicInfo> rawCldsSdcResourceListBasicList) {\r
-        List<CldsSdcResourceBasicInfo> cldsSdcResourceBasicInfoList = null;\r
+    public List<SdcResourceBasicInfo> removeDuplicateSdcResourceBasicInfo(\r
+            List<SdcResourceBasicInfo> rawCldsSdcResourceListBasicList) {\r
+        List<SdcResourceBasicInfo> cldsSdcResourceBasicInfoList = null;\r
         if (rawCldsSdcResourceListBasicList != null && !rawCldsSdcResourceListBasicList.isEmpty()) {\r
             // sort list\r
             Collections.sort(rawCldsSdcResourceListBasicList);\r
@@ -233,7 +233,7 @@ public class SdcCatalogServices {
             for (int i = 1; i < rawCldsSdcResourceListBasicList.size(); i++) {\r
                 // compare name with previous - if not equal, then keep the\r
                 // previous (it's the last with that name)\r
-                CldsSdcResourceBasicInfo prev = rawCldsSdcResourceListBasicList.get(i - 1);\r
+                SdcResourceBasicInfo prev = rawCldsSdcResourceListBasicList.get(i - 1);\r
                 if (!rawCldsSdcResourceListBasicList.get(i).getName().equals(prev.getName())) {\r
                     cldsSdcResourceBasicInfoList.add(prev);\r
                 }\r
@@ -260,10 +260,10 @@ public class SdcCatalogServices {
             throws GeneralSecurityException, DecoderException {\r
         String serviceUuid = "";\r
         String responseStr = getSdcServicesInformation(null);\r
-        List<CldsSdcServiceInfo> rawCldsSdcServicesList = getCldsSdcServicesListFromJson(responseStr);\r
-        List<CldsSdcServiceInfo> cldsSdcServicesList = removeDuplicateServices(rawCldsSdcServicesList);\r
+        List<SdcServiceInfo> rawCldsSdcServicesList = getCldsSdcServicesListFromJson(responseStr);\r
+        List<SdcServiceInfo> cldsSdcServicesList = removeDuplicateServices(rawCldsSdcServicesList);\r
         if (cldsSdcServicesList != null && !cldsSdcServicesList.isEmpty()) {\r
-            for (CldsSdcServiceInfo currCldsSdcServiceInfo : cldsSdcServicesList) {\r
+            for (SdcServiceInfo currCldsSdcServiceInfo : cldsSdcServicesList) {\r
                 if (currCldsSdcServiceInfo != null && currCldsSdcServiceInfo.getInvariantUUID() != null\r
                         && currCldsSdcServiceInfo.getInvariantUUID().equalsIgnoreCase(invariantId)) {\r
                     serviceUuid = currCldsSdcServiceInfo.getUuid();\r
@@ -282,14 +282,14 @@ public class SdcCatalogServices {
      * @return The list of CldsSdcServiceInfo, if there is a failure it return\r
      *         an empty list\r
      */\r
-    private List<CldsSdcServiceInfo> getCldsSdcServicesListFromJson(String jsonStr) {\r
+    private List<SdcServiceInfo> getCldsSdcServicesListFromJson(String jsonStr) {\r
         ObjectMapper objectMapper = new ObjectMapper();\r
         if (StringUtils.isBlank(jsonStr)) {\r
             return new ArrayList<>();\r
         }\r
         try {\r
             return objectMapper.readValue(jsonStr,\r
-                    objectMapper.getTypeFactory().constructCollectionType(List.class, CldsSdcServiceInfo.class));\r
+                    objectMapper.getTypeFactory().constructCollectionType(List.class, SdcServiceInfo.class));\r
         } catch (IOException e) {\r
             logger.error("Error when attempting to decode the JSON containing CldsSdcServiceInfo", e);\r
             return new ArrayList<>();\r
@@ -304,14 +304,14 @@ public class SdcCatalogServices {
      * @return The list of CldsSdcResourceBasicInfo, an empty list in case of\r
      *         issues\r
      */\r
-    private List<CldsSdcResourceBasicInfo> getAllSdcResourcesListFromJson(String jsonStr) {\r
+    private List<SdcResourceBasicInfo> getAllSdcResourcesListFromJson(String jsonStr) {\r
         ObjectMapper objectMapper = new ObjectMapper();\r
         if (StringUtils.isBlank(jsonStr)) {\r
             return new ArrayList<>();\r
         }\r
         try {\r
             return objectMapper.readValue(jsonStr,\r
-                    objectMapper.getTypeFactory().constructCollectionType(List.class, CldsSdcResourceBasicInfo.class));\r
+                    objectMapper.getTypeFactory().constructCollectionType(List.class, SdcResourceBasicInfo.class));\r
         } catch (IOException e) {\r
             logger.error("Exception occurred when attempting to decode the list of CldsSdcResourceBasicInfo JSON", e);\r
             return new ArrayList<>();\r
@@ -324,10 +324,10 @@ public class SdcCatalogServices {
      * @param jsonStr\r
      * @return\r
      */\r
-    public CldsSdcServiceDetail getCldsSdcServiceDetailFromJson(String jsonStr) {\r
+    public SdcServiceDetail decodeCldsSdcServiceDetailFromJson(String jsonStr) {\r
         ObjectMapper objectMapper = new ObjectMapper();\r
         try {\r
-            return objectMapper.readValue(jsonStr, CldsSdcServiceDetail.class);\r
+            return objectMapper.readValue(jsonStr, SdcServiceDetail.class);\r
         } catch (IOException e) {\r
             logger.error("Exception when attempting to decode the CldsSdcServiceDetail JSON", e);\r
             return null;\r
@@ -472,9 +472,9 @@ public class SdcCatalogServices {
         ObjectMapper objectMapper = new ObjectMapper();\r
         CldsServiceData cldsServiceData = new CldsServiceData();\r
         if (responseStr != null) {\r
-            CldsSdcServiceDetail cldsSdcServiceDetail;\r
+            SdcServiceDetail cldsSdcServiceDetail;\r
             try {\r
-                cldsSdcServiceDetail = objectMapper.readValue(responseStr, CldsSdcServiceDetail.class);\r
+                cldsSdcServiceDetail = objectMapper.readValue(responseStr, SdcServiceDetail.class);\r
             } catch (IOException e) {\r
                 logger.error("Exception when decoding the CldsServiceData JSON from SDC", e);\r
                 throw new SdcCommunicationException("Exception when decoding the CldsServiceData JSON from SDC", e);\r
@@ -484,11 +484,11 @@ public class SdcCatalogServices {
             if (cldsSdcServiceDetail != null && cldsSdcServiceDetail.getResources() != null) {\r
                 cldsServiceData.setServiceUUID(cldsSdcServiceDetail.getUuid());\r
                 cldsServiceData.setServiceInvariantUUID(cldsSdcServiceDetail.getInvariantUUID());\r
-                List<CldsSdcResource> cldsSdcResourceList = removeDuplicateSdcResourceInstances(\r
+                List<SdcResource> cldsSdcResourceList = removeDuplicateSdcResourceInstances(\r
                         cldsSdcServiceDetail.getResources());\r
                 if (cldsSdcResourceList != null && !cldsSdcResourceList.isEmpty()) {\r
                     List<CldsVfData> cldsVfDataList = new ArrayList<>();\r
-                    for (CldsSdcResource currCldsSdcResource : cldsSdcResourceList) {\r
+                    for (SdcResource currCldsSdcResource : cldsSdcResourceList) {\r
                         if (currCldsSdcResource != null && currCldsSdcResource.getResoucreType() != null\r
                                 && "VF".equalsIgnoreCase(currCldsSdcResource.getResoucreType())) {\r
                             CldsVfData currCldsVfData = new CldsVfData();\r
@@ -511,9 +511,8 @@ public class SdcCatalogServices {
             throws GeneralSecurityException {\r
         // todo : refact this..\r
         if (cldsVfDataList != null && !cldsVfDataList.isEmpty()) {\r
-            List<CldsSdcResourceBasicInfo> allVfResources = getAllSdcVForVfcResourcesBasedOnResourceType(\r
-                    RESOURCE_VF_TYPE);\r
-            List<CldsSdcResourceBasicInfo> allVfcResources = getAllSdcVForVfcResourcesBasedOnResourceType(\r
+            List<SdcResourceBasicInfo> allVfResources = getAllSdcVForVfcResourcesBasedOnResourceType(RESOURCE_VF_TYPE);\r
+            List<SdcResourceBasicInfo> allVfcResources = getAllSdcVForVfcResourcesBasedOnResourceType(\r
                     RESOURCE_VFC_TYPE);\r
             allVfcResources.addAll(getAllSdcVForVfcResourcesBasedOnResourceType(RESOURCE_CVFC_TYPE));\r
             for (CldsVfData currCldsVfData : cldsVfDataList) {\r
@@ -1128,18 +1127,18 @@ public class SdcCatalogServices {
      *            The artifact name that will be searched\r
      * @return The artifact UUID found\r
      */\r
-    public String getArtifactIdIfArtifactAlreadyExists(CldsSdcServiceDetail cldsSdcServiceDetail, String artifactName) {\r
+    public String getArtifactIdIfArtifactAlreadyExists(SdcServiceDetail cldsSdcServiceDetail, String artifactName) {\r
         String artifactUuid = null;\r
         boolean artifactExists = false;\r
         if (cldsSdcServiceDetail != null && cldsSdcServiceDetail.getResources() != null\r
                 && !cldsSdcServiceDetail.getResources().isEmpty()) {\r
-            for (CldsSdcResource currCldsSdcResource : cldsSdcServiceDetail.getResources()) {\r
+            for (SdcResource currCldsSdcResource : cldsSdcServiceDetail.getResources()) {\r
                 if (artifactExists) {\r
                     break;\r
                 }\r
                 if (currCldsSdcResource != null && currCldsSdcResource.getArtifacts() != null\r
                         && !currCldsSdcResource.getArtifacts().isEmpty()) {\r
-                    for (CldsSdcArtifact currCldsSdcArtifact : currCldsSdcResource.getArtifacts()) {\r
+                    for (SdcArtifact currCldsSdcArtifact : currCldsSdcResource.getArtifacts()) {\r
                         if (currCldsSdcArtifact != null && currCldsSdcArtifact.getArtifactName() != null\r
                                 && currCldsSdcArtifact.getArtifactName().equalsIgnoreCase(artifactName)) {\r
                             artifactUuid = currCldsSdcArtifact.getArtifactUUID();\r
@@ -1154,7 +1153,7 @@ public class SdcCatalogServices {
     }\r
 \r
     // To get all sdc VF/VFC Resources basic info.\r
-    private List<CldsSdcResourceBasicInfo> getAllSdcVForVfcResourcesBasedOnResourceType(String resourceType) {\r
+    private List<SdcResourceBasicInfo> getAllSdcVForVfcResourcesBasedOnResourceType(String resourceType) {\r
         String catalogUrl = refProp.getStringValue(SDC_CATALOG_URL_PROPERTY_NAME);\r
         String resourceUrl = catalogUrl + "resources?resourceType=" + resourceType;\r
         String allSdcVfcResources = getCldsServicesOrResourcesBasedOnURL(resourceUrl);\r
@@ -1162,10 +1161,10 @@ public class SdcCatalogServices {
     }\r
 \r
     private String getResourceUuidFromResourceInvariantUuid(String resourceInvariantUuid,\r
-            List<CldsSdcResourceBasicInfo> resourceInfoList) {\r
+            List<SdcResourceBasicInfo> resourceInfoList) {\r
         String resourceUuid = null;\r
         if (resourceInfoList != null && !resourceInfoList.isEmpty()) {\r
-            for (CldsSdcResourceBasicInfo currResource : resourceInfoList) {\r
+            for (SdcResourceBasicInfo currResource : resourceInfoList) {\r
                 if (currResource != null && currResource.getInvariantUUID() != null && currResource.getUuid() != null\r
                         && currResource.getInvariantUUID().equalsIgnoreCase(resourceInvariantUuid)) {\r
                     resourceUuid = currResource.getUuid();\r
@@ -1220,7 +1219,7 @@ public class SdcCatalogServices {
                     String originalServiceUuid = getServiceUuidFromServiceInvariantId(serviceInvariantUuid);\r
                     logger.info("ServiceUUID used before upload in url:" + originalServiceUuid);\r
                     String sdcServicesInformation = getSdcServicesInformation(originalServiceUuid);\r
-                    CldsSdcServiceDetail cldsSdcServiceDetail = getCldsSdcServiceDetailFromJson(sdcServicesInformation);\r
+                    SdcServiceDetail cldsSdcServiceDetail = decodeCldsSdcServiceDetailFromJson(sdcServicesInformation);\r
                     String uploadedArtifactUuid = getArtifactIdIfArtifactAlreadyExists(cldsSdcServiceDetail,\r
                             artifactName);\r
                     // Upload artifacts to sdc\r
@@ -1233,7 +1232,7 @@ public class SdcCatalogServices {
                     }\r
                     logger.info("ServiceUUID used after upload in ulr:" + updatedServiceUuid);\r
                     sdcServicesInformation = getSdcServicesInformation(updatedServiceUuid);\r
-                    cldsSdcServiceDetail = getCldsSdcServiceDetailFromJson(sdcServicesInformation);\r
+                    cldsSdcServiceDetail = decodeCldsSdcServiceDetailFromJson(sdcServicesInformation);\r
                     uploadedArtifactUuid = getArtifactIdIfArtifactAlreadyExists(cldsSdcServiceDetail,\r
                             locationArtifactName);\r
                     // To send location information also to sdc\r
@@ -41,12 +41,12 @@ import java.util.Map.Entry;
 
 import org.apache.commons.codec.DecoderException;
 import org.onap.clamp.clds.client.req.tca.TcaRequestFormatter;
-import org.onap.clamp.clds.model.CldsSdcResource;
-import org.onap.clamp.clds.model.CldsSdcServiceDetail;
-import org.onap.clamp.clds.model.prop.Global;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.model.prop.Tca;
-import org.onap.clamp.clds.model.refprop.RefProp;
+import org.onap.clamp.clds.config.CldsReferenceProperties;
+import org.onap.clamp.clds.model.properties.Global;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.model.properties.Tca;
+import org.onap.clamp.clds.model.sdc.SdcResource;
+import org.onap.clamp.clds.model.sdc.SdcServiceDetail;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -54,14 +54,14 @@ import org.springframework.stereotype.Component;
  * Construct a Sdc request given CLDS objects.
  */
 @Component
-public class SdcReq {
+public class SdcRequests {
 
-    protected static final EELFLogger logger = EELFManager.getInstance().getLogger(SdcReq.class);
+    protected static final EELFLogger logger = EELFManager.getInstance().getLogger(SdcRequests.class);
     protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
     @Autowired
     private SdcCatalogServices sdcCatalogServices;
     @Autowired
-    protected RefProp refProp;
+    protected CldsReferenceProperties refProp;
 
     /**
      * Format the Blueprint from a Yaml
@@ -132,48 +132,48 @@ public class SdcReq {
                 + "} \n";
     }
 
+    private List<String> filterVfResourceList(String serviceUuid, List<SdcResource> sdcResourcesList,
+            List<String> cldsResourceVfList) {
+        List<String> urlList = new ArrayList<>();
+        for (SdcResource cldsSdcResource : sdcResourcesList) {
+            if (cldsSdcResource != null && cldsSdcResource.getResoucreType() != null
+                    && cldsSdcResource.getResoucreType().equalsIgnoreCase("VF")
+                    && cldsResourceVfList.contains(cldsSdcResource.getResourceInvariantUUID())) {
+                String normalizedResourceInstanceName = normalizeResourceInstanceName(
+                        cldsSdcResource.getResourceInstanceName());
+                String svcUrl = createUrlForResource(normalizedResourceInstanceName, serviceUuid);
+                urlList.add(svcUrl);
+            }
+        }
+        return urlList;
+    }
+
+    private String createUrlForResource(String normalizedResourceInstanceName, String serviceUuid) {
+        return refProp.getStringValue("sdc.serviceUrl") + "/" + serviceUuid + "/resourceInstances/"
+                + normalizedResourceInstanceName + "/artifacts";
+    }
+
     /**
      * To get List of urls for all vfresources
      *
      * @param prop
      *            The model properties JSON describing the closed loop flow
-     * @param baseUrl
-     *            The URL to trigger
      * @return A list of Service URL
      * @throws GeneralSecurityException
      *             In case of issues when decrypting the password
      * @throws DecoderException
      *             In case of issues when decoding the Hex String
      */
-    public List<String> getSdcReqUrlsList(ModelProperties prop, String baseUrl)
-            throws GeneralSecurityException, DecoderException {
+    public List<String> getSdcReqUrlsList(ModelProperties prop) throws GeneralSecurityException, DecoderException {
         List<String> urlList = new ArrayList<>();
         Global globalProps = prop.getGlobal();
-        if (globalProps != null && globalProps.getService() != null) {
-            String serviceInvariantUUID = globalProps.getService();
-            List<String> resourceVfList = globalProps.getResourceVf();
-            String serviceUUID = sdcCatalogServices.getServiceUuidFromServiceInvariantId(serviceInvariantUUID);
-            CldsSdcServiceDetail cldsSdcServiceDetail = sdcCatalogServices
-                    .getCldsSdcServiceDetailFromJson(sdcCatalogServices.getSdcServicesInformation(serviceUUID));
-            if (cldsSdcServiceDetail != null && resourceVfList != null) {
-                List<CldsSdcResource> cldsSdcResourcesList = cldsSdcServiceDetail.getResources();
-                if (cldsSdcResourcesList != null && !cldsSdcResourcesList.isEmpty()) {
-                    for (CldsSdcResource cldsSdcResource : cldsSdcResourcesList) {
-                        if (cldsSdcResource != null && cldsSdcResource.getResoucreType() != null
-                                && cldsSdcResource.getResoucreType().equalsIgnoreCase("VF")
-                                && resourceVfList.contains(cldsSdcResource.getResourceInvariantUUID())) {
-                            String normalizedResourceInstanceName = normalizeResourceInstanceName(
-                                    cldsSdcResource.getResourceInstanceName());
-                            String svcUrl = baseUrl + "/" + serviceUUID + "/resourceInstances/"
-                                    + normalizedResourceInstanceName + "/artifacts";
-                            urlList.add(svcUrl);
-                        } else {
-                            logger.warn("The VF Resource invariant UUID (" + cldsSdcResource.getResourceInvariantUUID()
-                                    + ") has not been found in the Service (Invariant ID:" + serviceInvariantUUID
-                                    + ")VF resource list");
-                        }
-                    }
-                }
+        if (globalProps != null && globalProps.getService() != null && globalProps.getResourceVf() != null) {
+            String serviceUuid = sdcCatalogServices.getServiceUuidFromServiceInvariantId(globalProps.getService());
+            SdcServiceDetail sdcServiceDetail = sdcCatalogServices
+                    .decodeCldsSdcServiceDetailFromJson(sdcCatalogServices.getSdcServicesInformation(serviceUuid));
+            if (sdcServiceDetail != null) {
+                urlList = filterVfResourceList(serviceUuid, sdcServiceDetail.getResources(),
+                        globalProps.getResourceVf());
             }
         } else {
             logger.warn("GlobalProperties json is empty, skipping getSdcReqUrlsList and returning empty list");
index f13f422..73355a7 100644 (file)
@@ -32,12 +32,12 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
 import java.io.IOException;
 import java.util.Map;
 
+import org.onap.clamp.clds.config.CldsReferenceProperties;
 import org.onap.clamp.clds.exception.TcaRequestFormatterException;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.model.prop.Tca;
-import org.onap.clamp.clds.model.prop.TcaItem;
-import org.onap.clamp.clds.model.prop.TcaThreshold;
-import org.onap.clamp.clds.model.refprop.RefProp;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.model.properties.Tca;
+import org.onap.clamp.clds.model.properties.TcaItem;
+import org.onap.clamp.clds.model.properties.TcaThreshold;
 import org.yaml.snakeyaml.Yaml;
 
 /**
@@ -64,7 +64,7 @@ public class TcaRequestFormatter {
      *            The Model Prop created from BPMN JSON and BPMN properties JSON
      * @return The Json string containing that should be sent to policy
      */
-    public static String createPolicyJson(RefProp refProp, ModelProperties modelProperties) {
+    public static String createPolicyJson(CldsReferenceProperties refProp, ModelProperties modelProperties) {
         try {
             String service = modelProperties.getGlobal().getService();
             Tca tca = modelProperties.getType(Tca.class);
@@ -103,7 +103,7 @@ public class TcaRequestFormatter {
      *            modelProperties.setCurrentModelElementId will be used
      * @return The Json node containing what should be sent to policy
      */
-    public static JsonNode createPolicyContent(RefProp refProp, ModelProperties modelProperties, String service,
+    public static JsonNode createPolicyContent(CldsReferenceProperties refProp, ModelProperties modelProperties, String service,
             String policyName, Tca tca) {
         try {
             String serviceToUse = service;
@@ -153,7 +153,7 @@ public class TcaRequestFormatter {
      *            The Model Properties created from BPMN JSON and BPMN
      *            properties JSON
      */
-    private static void addThresholds(RefProp refProp, String service, ObjectNode appendToNode, TcaItem tcaItem,
+    private static void addThresholds(CldsReferenceProperties refProp, String service, ObjectNode appendToNode, TcaItem tcaItem,
             ModelProperties modelProperties) {
         ArrayNode tcaNodes = appendToNode.withArray("thresholds");
         ObjectNode tcaNode;
@@ -185,7 +185,7 @@ public class TcaRequestFormatter {
      *            The yaml string received from the UI
      * @return The updated YAML as a string
      */
-    public static String updatedBlueprintWithConfiguration(RefProp refProp, ModelProperties modelProperties,
+    public static String updatedBlueprintWithConfiguration(CldsReferenceProperties refProp, ModelProperties modelProperties,
             String yamlValue) {
         String jsonPolicy = ((ObjectNode) createPolicyContent(refProp, modelProperties, null, null, null)).toString();
         logger.info("Yaml that will be updated:" + yamlValue);
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.refprop;
+package org.onap.clamp.clds.config;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -41,7 +41,7 @@ import org.springframework.stereotype.Component;
  * Holds reference properties.
  */
 @Component
-public class RefProp {
+public class CldsReferenceProperties {
 
     @Autowired
     private ApplicationContext appContext;
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.prop;
+package org.onap.clamp.clds.model.properties;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.prop;
+package org.onap.clamp.clds.model.properties;
 
 import java.util.List;
 
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.prop;
+package org.onap.clamp.clds.model.properties;
 
 import com.fasterxml.jackson.databind.JsonNode;
 
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.prop;
+package org.onap.clamp.clds.model.properties;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.prop;
+package org.onap.clamp.clds.model.properties;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.prop;
+package org.onap.clamp.clds.model.properties;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.prop;
+package org.onap.clamp.clds.model.properties;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.prop;
+package org.onap.clamp.clds.model.properties;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.prop;
+package org.onap.clamp.clds.model.properties;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.prop;
+package org.onap.clamp.clds.model.properties;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.prop;
+package org.onap.clamp.clds.model.properties;
 
 import java.util.HashMap;
 import java.util.Iterator;
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.prop;
+package org.onap.clamp.clds.model.properties;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.prop;
+package org.onap.clamp.clds.model.properties;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model.prop;
+package org.onap.clamp.clds.model.properties;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model;
+package org.onap.clamp.clds.model.sdc;
 
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 
 @JsonIgnoreProperties(ignoreUnknown = true)
-public class CldsSdcArtifact {
+public class SdcArtifact {
 
     private String artifactName;
     private String artifactType;
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model;
+package org.onap.clamp.clds.model.sdc;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
@@ -31,18 +31,18 @@ import java.math.BigDecimal;
 import java.util.List;
 
 @JsonIgnoreProperties(ignoreUnknown = true)
-public class CldsSdcResource implements Comparable<CldsSdcResource> {
+public class SdcResource implements Comparable<SdcResource> {
 
-    protected static final EELFLogger logger        = EELFManager.getInstance().getLogger(CldsSdcResource.class);
+    protected static final EELFLogger logger        = EELFManager.getInstance().getLogger(SdcResource.class);
     protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
 
     private String                    resourceInstanceName;
     private String                    resourceName;
-    private String                    resourceInvariantUuid;
+    private String                    resourceInvariantUUID;
     private String                    resourceVersion;
     private String                    resoucreType;
     private String                    resourceUuid;
-    private List<CldsSdcArtifact>     artifacts;
+    private List<SdcArtifact>     artifacts;
 
     public String getResourceInstanceName() {
         return resourceInstanceName;
@@ -61,11 +61,11 @@ public class CldsSdcResource implements Comparable<CldsSdcResource> {
     }
 
     public String getResourceInvariantUUID() {
-        return resourceInvariantUuid;
+        return resourceInvariantUUID;
     }
 
-    public void setResourceInvariantUUID(String resourceInvariantUUID) {
-        this.resourceInvariantUuid = resourceInvariantUUID;
+    public void setResourceInvariantUUID(String resourceInvUuid) {
+        this.resourceInvariantUUID = resourceInvUuid;
     }
 
     public String getResourceVersion() {
@@ -92,16 +92,16 @@ public class CldsSdcResource implements Comparable<CldsSdcResource> {
         this.resourceUuid = resourceUUID;
     }
 
-    public List<CldsSdcArtifact> getArtifacts() {
+    public List<SdcArtifact> getArtifacts() {
         return artifacts;
     }
 
-    public void setArtifacts(List<CldsSdcArtifact> artifacts) {
+    public void setArtifacts(List<SdcArtifact> artifacts) {
         this.artifacts = artifacts;
     }
 
     @Override
-    public int compareTo(CldsSdcResource in) {
+    public int compareTo(SdcResource in) {
         // Compares this object with the specified object for order.
         // Returns a negative integer, zero, or a positive integer as this
         // object is less than, equal to, or greater than the specified object.
@@ -134,7 +134,7 @@ public class CldsSdcResource implements Comparable<CldsSdcResource> {
             return false;
         if (getClass() != obj.getClass())
             return false;
-        CldsSdcResource other = (CldsSdcResource) obj;
+        SdcResource other = (SdcResource) obj;
         if (resourceInstanceName == null) {
             if (other.resourceInstanceName != null)
                 return false;
@@ -21,7 +21,7 @@
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model;
+package org.onap.clamp.clds.model.sdc;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
@@ -30,10 +30,10 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import java.math.BigDecimal;
 
 @JsonIgnoreProperties(ignoreUnknown = true)
-public class CldsSdcResourceBasicInfo implements Comparable<CldsSdcResourceBasicInfo> {
+public class SdcResourceBasicInfo implements Comparable<SdcResourceBasicInfo> {
 
     protected static final EELFLogger logger        = EELFManager.getInstance()
-            .getLogger(CldsSdcResourceBasicInfo.class);
+            .getLogger(SdcResourceBasicInfo.class);
     protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
 
     private String                    uuid;
@@ -48,7 +48,7 @@ public class CldsSdcResourceBasicInfo implements Comparable<CldsSdcResourceBasic
     private String                    lastUpdaterUserId;
 
     @Override
-    public int compareTo(CldsSdcResourceBasicInfo in) {
+    public int compareTo(SdcResourceBasicInfo in) {
         // Compares this object with the specified object for order.
         // Returns a negative integer, zero, or a positive integer as this
         // object is less than, equal to, or greater than the specified object.
@@ -80,7 +80,7 @@ public class CldsSdcResourceBasicInfo implements Comparable<CldsSdcResourceBasic
             return false;
         if (getClass() != obj.getClass())
             return false;
-        CldsSdcResourceBasicInfo other = (CldsSdcResourceBasicInfo) obj;
+        SdcResourceBasicInfo other = (SdcResourceBasicInfo) obj;
         if (name == null) {
             if (other.name != null)
                 return false;
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model;
+package org.onap.clamp.clds.model.sdc;
 
 import java.util.List;
 
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 
 @JsonIgnoreProperties(ignoreUnknown = true)
-public class CldsSdcServiceDetail {
+public class SdcServiceDetail {
 
     private String                uuid;
     private String                invariantUUID;
@@ -40,8 +40,8 @@ public class CldsSdcServiceDetail {
     private String                lastUpdaterUserId;
     private String                distributionStatus;
     private String                lastUpdaterFullName;
-    private List<CldsSdcResource> resources;
-    private List<CldsSdcArtifact> artifacts;
+    private List<SdcResource> resources;
+    private List<SdcArtifact> artifacts;
 
     public String getUuid() {
         return uuid;
@@ -123,19 +123,19 @@ public class CldsSdcServiceDetail {
         this.lastUpdaterFullName = lastUpdaterFullName;
     }
 
-    public List<CldsSdcResource> getResources() {
+    public List<SdcResource> getResources() {
         return resources;
     }
 
-    public void setResources(List<CldsSdcResource> resources) {
+    public void setResources(List<SdcResource> resources) {
         this.resources = resources;
     }
 
-    public List<CldsSdcArtifact> getArtifacts() {
+    public List<SdcArtifact> getArtifacts() {
         return artifacts;
     }
 
-    public void setArtifacts(List<CldsSdcArtifact> artifacts) {
+    public void setArtifacts(List<SdcArtifact> artifacts) {
         this.artifacts = artifacts;
     }
 
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
-package org.onap.clamp.clds.model;
+package org.onap.clamp.clds.model.sdc;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 
 import java.math.BigDecimal;
 
-public class CldsSdcServiceInfo implements Comparable<CldsSdcServiceInfo> {
+public class SdcServiceInfo implements Comparable<SdcServiceInfo> {
 
-    protected static final EELFLogger logger      = EELFManager.getInstance().getLogger(CldsSdcServiceInfo.class);
+    protected static final EELFLogger logger      = EELFManager.getInstance().getLogger(SdcServiceInfo.class);
     protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
 
     private String                    uuid;
@@ -119,7 +119,7 @@ public class CldsSdcServiceInfo implements Comparable<CldsSdcServiceInfo> {
      * Compare using name and then version. Version is converted to a decimal.
      */
     @Override
-    public int compareTo(CldsSdcServiceInfo in) {
+    public int compareTo(SdcServiceInfo in) {
         // Compares this object with the specified object for order.
         // Returns a negative integer, zero, or a positive integer as this
         // object is less than, equal to, or greater than the specified object.
@@ -152,7 +152,7 @@ public class CldsSdcServiceInfo implements Comparable<CldsSdcServiceInfo> {
             return false;
         if (getClass() != obj.getClass())
             return false;
-        CldsSdcServiceInfo other = (CldsSdcServiceInfo) obj;
+        SdcServiceInfo other = (SdcServiceInfo) obj;
         if (name == null) {
             if (other.name != null)
                 return false;
index a139de1..14e6562 100644 (file)
@@ -64,6 +64,7 @@ import org.onap.clamp.clds.camel.CamelProxy;
 import org.onap.clamp.clds.client.DcaeDispatcherServices;
 import org.onap.clamp.clds.client.DcaeInventoryServices;
 import org.onap.clamp.clds.client.req.sdc.SdcCatalogServices;
+import org.onap.clamp.clds.config.CldsReferenceProperties;
 import org.onap.clamp.clds.dao.CldsDao;
 import org.onap.clamp.clds.exception.CldsConfigException;
 import org.onap.clamp.clds.exception.SdcCommunicationException;
@@ -75,16 +76,15 @@ import org.onap.clamp.clds.model.CldsHealthCheck;
 import org.onap.clamp.clds.model.CldsInfo;
 import org.onap.clamp.clds.model.CldsModel;
 import org.onap.clamp.clds.model.CldsModelProp;
-import org.onap.clamp.clds.model.CldsSdcResource;
-import org.onap.clamp.clds.model.CldsSdcServiceDetail;
-import org.onap.clamp.clds.model.CldsSdcServiceInfo;
 import org.onap.clamp.clds.model.CldsServiceData;
 import org.onap.clamp.clds.model.CldsTemplate;
 import org.onap.clamp.clds.model.DcaeEvent;
 import org.onap.clamp.clds.model.ValueItem;
-import org.onap.clamp.clds.model.prop.AbstractModelElement;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.model.refprop.RefProp;
+import org.onap.clamp.clds.model.properties.AbstractModelElement;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.model.sdc.SdcResource;
+import org.onap.clamp.clds.model.sdc.SdcServiceDetail;
+import org.onap.clamp.clds.model.sdc.SdcServiceInfo;
 import org.onap.clamp.clds.transform.XslTransformer;
 import org.onap.clamp.clds.util.LoggingUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -142,7 +142,7 @@ public class CldsService extends SecureServiceBase {
     @Autowired
     private XslTransformer cldsBpmnTransformer;
     @Autowired
-    private RefProp refProp;
+    private CldsReferenceProperties refProp;
     @Autowired
     private SdcCatalogServices sdcCatalogServices;
     @Autowired
@@ -680,14 +680,14 @@ public class CldsService extends SecureServiceBase {
             return "";
         }
         ObjectMapper objectMapper = new ObjectMapper();
-        List<CldsSdcServiceInfo> rawList = objectMapper.readValue(responseStr,
-                objectMapper.getTypeFactory().constructCollectionType(List.class, CldsSdcServiceInfo.class));
+        List<SdcServiceInfo> rawList = objectMapper.readValue(responseStr,
+                objectMapper.getTypeFactory().constructCollectionType(List.class, SdcServiceInfo.class));
         ObjectNode invariantIdServiceNode = objectMapper.createObjectNode();
         ObjectNode serviceNode = objectMapper.createObjectNode();
         logger.info("value of cldsserviceiNfolist: {}", rawList);
         if (rawList != null && !rawList.isEmpty()) {
-            List<CldsSdcServiceInfo> cldsSdcServiceInfoList = sdcCatalogServices.removeDuplicateServices(rawList);
-            for (CldsSdcServiceInfo currCldsSdcServiceInfo : cldsSdcServiceInfoList) {
+            List<SdcServiceInfo> cldsSdcServiceInfoList = sdcCatalogServices.removeDuplicateServices(rawList);
+            for (SdcServiceInfo currCldsSdcServiceInfo : cldsSdcServiceInfoList) {
                 if (currCldsSdcServiceInfo != null) {
                     invariantIdServiceNode.put(currCldsSdcServiceInfo.getInvariantUUID(),
                             currCldsSdcServiceInfo.getName());
@@ -700,7 +700,7 @@ public class CldsService extends SecureServiceBase {
 
     private String createPropertiesObjectByUUID(String globalProps, String cldsResponseStr) throws IOException {
         ObjectMapper mapper = new ObjectMapper();
-        CldsSdcServiceDetail cldsSdcServiceDetail = mapper.readValue(cldsResponseStr, CldsSdcServiceDetail.class);
+        SdcServiceDetail cldsSdcServiceDetail = mapper.readValue(cldsResponseStr, SdcServiceDetail.class);
         ObjectNode globalPropsJson = null;
         if (cldsSdcServiceDetail != null && cldsSdcServiceDetail.getUuid() != null) {
             /**
@@ -745,18 +745,18 @@ public class CldsService extends SecureServiceBase {
     }
 
     private void createVfObjectNode(ObjectNode vfObjectNode2, ObjectMapper mapper,
-            List<CldsSdcResource> rawCldsSdcResourceList) {
+            List<SdcResource> rawCldsSdcResourceList) {
         ObjectNode vfNode = mapper.createObjectNode();
         vfNode.put("", "");
         // To remove repeated resource instance name from
         // resourceInstanceList
-        List<CldsSdcResource> cldsSdcResourceList = sdcCatalogServices
+        List<SdcResource> cldsSdcResourceList = sdcCatalogServices
                 .removeDuplicateSdcResourceInstances(rawCldsSdcResourceList);
         /**
          * Creating vf resource node using cldsSdcResource Object
          */
         if (cldsSdcResourceList != null && !cldsSdcResourceList.isEmpty()) {
-            for (CldsSdcResource cldsSdcResource : cldsSdcResourceList) {
+            for (SdcResource cldsSdcResource : cldsSdcResourceList) {
                 if (cldsSdcResource != null && "VF".equalsIgnoreCase(cldsSdcResource.getResoucreType())) {
                     vfNode.put(cldsSdcResource.getResourceUUID(), cldsSdcResource.getResourceName());
                 }
@@ -792,7 +792,7 @@ public class CldsService extends SecureServiceBase {
         vfObjectNode2.putPOJO("alarmCondition", alarmStringJsonNode);
     }
 
-    private ObjectNode createByVFCObjectNode(ObjectMapper mapper, List<CldsSdcResource> cldsSdcResourceList) {
+    private ObjectNode createByVFCObjectNode(ObjectMapper mapper, List<SdcResource> cldsSdcResourceList) {
         ObjectNode emptyObjectNode = mapper.createObjectNode();
         ObjectNode emptyvfcobjectNode = mapper.createObjectNode();
         ObjectNode vfCObjectNode = mapper.createObjectNode();
@@ -800,7 +800,7 @@ public class CldsService extends SecureServiceBase {
         ObjectNode subVfCObjectNode = mapper.createObjectNode();
         subVfCObjectNode.putPOJO("vfc", emptyObjectNode);
         if (cldsSdcResourceList != null && !cldsSdcResourceList.isEmpty()) {
-            for (CldsSdcResource cldsSdcResource : cldsSdcResourceList) {
+            for (SdcResource cldsSdcResource : cldsSdcResourceList) {
                 if (cldsSdcResource != null && "VF".equalsIgnoreCase(cldsSdcResource.getResoucreType())) {
                     vfCObjectNode.putPOJO(cldsSdcResource.getResourceUUID(), subVfCObjectNode);
                 }
index 2903248..7e29088 100644 (file)
@@ -25,7 +25,7 @@ package org.onap.clamp.clds;
 
 import org.junit.BeforeClass;
 import org.onap.clamp.clds.client.req.policy.PolicyClient;
-import org.onap.clamp.clds.model.refprop.RefProp;
+import org.onap.clamp.clds.config.CldsReferenceProperties;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.test.context.ActiveProfiles;
 
@@ -33,7 +33,7 @@ import org.springframework.test.context.ActiveProfiles;
 public abstract class AbstractItCase {
 
     @Autowired
-    protected RefProp refProp;
+    protected CldsReferenceProperties refProp;
     @Autowired
     protected PolicyClient policyClient;
 
@@ -41,9 +41,9 @@ import org.springframework.test.context.junit4.SpringRunner;
  */
 @RunWith(SpringRunner.class)
 @SpringBootTest
-public class RefPropItCase extends AbstractItCase {
+public class CldsReferencePropertiesItCase extends AbstractItCase {
 
-    protected static final EELFLogger logger = EELFManager.getInstance().getLogger(RefPropItCase.class);
+    protected static final EELFLogger logger = EELFManager.getInstance().getLogger(CldsReferencePropertiesItCase.class);
 
     /**
      * Test getting prop value as a JSON Node / template.
index 6f5c24d..c530a05 100644 (file)
@@ -31,8 +31,8 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.onap.clamp.clds.AbstractItCase;
 import org.onap.clamp.clds.client.HolmesPolicyDelegate;
-import org.onap.clamp.clds.model.prop.Holmes;
-import org.onap.clamp.clds.model.prop.ModelProperties;
+import org.onap.clamp.clds.model.properties.Holmes;
+import org.onap.clamp.clds.model.properties.ModelProperties;
 import org.onap.clamp.clds.util.ResourceFileUtil;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
index 9013e0c..873b019 100644 (file)
@@ -38,9 +38,9 @@ import org.junit.runner.RunWith;
 import org.onap.clamp.clds.AbstractItCase;
 import org.onap.clamp.clds.client.req.policy.OperationalPolicyReq;
 import org.onap.clamp.clds.model.CldsEvent;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.model.prop.Policy;
-import org.onap.clamp.clds.model.prop.PolicyChain;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.model.properties.Policy;
+import org.onap.clamp.clds.model.properties.PolicyChain;
 import org.onap.clamp.clds.util.ResourceFileUtil;
 import org.onap.policy.api.AttributeType;
 import org.onap.policy.controlloop.policy.builder.BuilderException;
index 71bd2d5..0e8a217 100644 (file)
@@ -37,10 +37,10 @@ import org.onap.clamp.clds.AbstractItCase;
 import org.onap.clamp.clds.client.req.policy.OperationalPolicyReq;
 import org.onap.clamp.clds.client.req.tca.TcaRequestFormatter;
 import org.onap.clamp.clds.model.CldsEvent;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.model.prop.Policy;
-import org.onap.clamp.clds.model.prop.PolicyChain;
-import org.onap.clamp.clds.model.prop.Tca;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.model.properties.Policy;
+import org.onap.clamp.clds.model.properties.PolicyChain;
+import org.onap.clamp.clds.model.properties.Tca;
 import org.onap.clamp.clds.util.ResourceFileUtil;
 import org.onap.policy.api.AttributeType;
 import org.springframework.boot.test.context.SpringBootTest;
index 548212e..7f96221 100644 (file)
@@ -35,10 +35,10 @@ import org.mockito.Mockito;
 import org.onap.clamp.clds.AbstractItCase;
 import org.onap.clamp.clds.client.req.sdc.SdcCatalogServices;
 import org.onap.clamp.clds.model.CldsAlarmCondition;
-import org.onap.clamp.clds.model.CldsSdcResource;
-import org.onap.clamp.clds.model.CldsSdcResourceBasicInfo;
-import org.onap.clamp.clds.model.CldsSdcServiceInfo;
 import org.onap.clamp.clds.model.CldsServiceData;
+import org.onap.clamp.clds.model.sdc.SdcResource;
+import org.onap.clamp.clds.model.sdc.SdcResourceBasicInfo;
+import org.onap.clamp.clds.model.sdc.SdcServiceInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
@@ -55,33 +55,33 @@ public class SdcCatalogServicesItCase extends AbstractItCase {
 
     @Test
     public void removeDuplicateServicesTest() {
-        CldsSdcServiceInfo service1a = new CldsSdcServiceInfo();
+        SdcServiceInfo service1a = new SdcServiceInfo();
         service1a.setName("service1");
         service1a.setVersion("1.0");
         service1a.setInvariantUUID("invariantUUID1.0");
-        List<CldsSdcServiceInfo> rawCldsSdcServiceList = new LinkedList<>();
+        List<SdcServiceInfo> rawCldsSdcServiceList = new LinkedList<>();
         rawCldsSdcServiceList.add(service1a);
         rawCldsSdcServiceList.add(service1a);
-        CldsSdcServiceInfo service1b = new CldsSdcServiceInfo();
+        SdcServiceInfo service1b = new SdcServiceInfo();
         service1b.setName("service1");
         service1b.setVersion("1.1");
         service1b.setInvariantUUID("invariantUUID1.1");
         rawCldsSdcServiceList.add(service1b);
-        CldsSdcServiceInfo service1c = new CldsSdcServiceInfo();
+        SdcServiceInfo service1c = new SdcServiceInfo();
         service1c.setName("service1");
         service1c.setVersion("1.2");
         service1c.setInvariantUUID("invariantUUID1.2");
         rawCldsSdcServiceList.add(service1c);
-        CldsSdcServiceInfo service2 = new CldsSdcServiceInfo();
+        SdcServiceInfo service2 = new SdcServiceInfo();
         service2.setName("service2");
         service2.setVersion("1.0");
         service2.setInvariantUUID("invariantUUID2.0");
         rawCldsSdcServiceList.add(service2);
         SdcCatalogServices catalogServices = new SdcCatalogServices();
-        List<CldsSdcServiceInfo> resultList = catalogServices.removeDuplicateServices(rawCldsSdcServiceList);
+        List<SdcServiceInfo> resultList = catalogServices.removeDuplicateServices(rawCldsSdcServiceList);
         assertTrue(resultList.size() == 2);
-        CldsSdcServiceInfo res1;
-        CldsSdcServiceInfo res2;
+        SdcServiceInfo res1;
+        SdcServiceInfo res2;
         if ("service1".equals(resultList.get(0).getName())) {
             res1 = resultList.get(0);
             res2 = resultList.get(1);
@@ -97,27 +97,27 @@ public class SdcCatalogServicesItCase extends AbstractItCase {
 
     @Test
     public void removeDuplicateSdcResourceInstancesTest() {
-        List<CldsSdcResource> rawCldsSdcResourceList = new LinkedList<>();
-        CldsSdcResource sdcResource1a = new CldsSdcResource();
+        List<SdcResource> rawCldsSdcResourceList = new LinkedList<>();
+        SdcResource sdcResource1a = new SdcResource();
         sdcResource1a.setResourceInstanceName("resource1");
         sdcResource1a.setResourceVersion("1.0");
         rawCldsSdcResourceList.add(sdcResource1a);
-        CldsSdcResource sdcResource1b = new CldsSdcResource();
+        SdcResource sdcResource1b = new SdcResource();
         sdcResource1b.setResourceInstanceName("resource1");
         sdcResource1b.setResourceVersion("1.1");
         rawCldsSdcResourceList.add(sdcResource1b);
-        CldsSdcResource sdcResource1c = new CldsSdcResource();
+        SdcResource sdcResource1c = new SdcResource();
         sdcResource1c.setResourceInstanceName("resource1");
         sdcResource1c.setResourceVersion("1.2");
         rawCldsSdcResourceList.add(sdcResource1c);
-        CldsSdcResource sdcResource2 = new CldsSdcResource();
+        SdcResource sdcResource2 = new SdcResource();
         sdcResource2.setResourceInstanceName("resource2");
         sdcResource2.setResourceVersion("1.0");
         rawCldsSdcResourceList.add(sdcResource2);
         SdcCatalogServices catalogServices = new SdcCatalogServices();
-        List<CldsSdcResource> resultList = catalogServices.removeDuplicateSdcResourceInstances(rawCldsSdcResourceList);
-        CldsSdcResource res1;
-        CldsSdcResource res2;
+        List<SdcResource> resultList = catalogServices.removeDuplicateSdcResourceInstances(rawCldsSdcResourceList);
+        SdcResource res1;
+        SdcResource res2;
         if ("resource1".equals(resultList.get(0).getResourceInstanceName())) {
             res1 = resultList.get(0);
             res2 = resultList.get(1);
@@ -133,28 +133,28 @@ public class SdcCatalogServicesItCase extends AbstractItCase {
 
     @Test
     public void removeDuplicateSdcResourceBasicInfoTest() {
-        List<CldsSdcResourceBasicInfo> rawCldsSdcResourceList = new LinkedList<>();
-        CldsSdcResourceBasicInfo sdcResource1a = new CldsSdcResourceBasicInfo();
+        List<SdcResourceBasicInfo> rawCldsSdcResourceList = new LinkedList<>();
+        SdcResourceBasicInfo sdcResource1a = new SdcResourceBasicInfo();
         sdcResource1a.setName("resource1");
         sdcResource1a.setVersion("1.0");
         rawCldsSdcResourceList.add(sdcResource1a);
-        CldsSdcResourceBasicInfo sdcResource1b = new CldsSdcResourceBasicInfo();
+        SdcResourceBasicInfo sdcResource1b = new SdcResourceBasicInfo();
         sdcResource1b.setName("resource1");
         sdcResource1b.setVersion("1.1");
         rawCldsSdcResourceList.add(sdcResource1b);
-        CldsSdcResourceBasicInfo sdcResource1c = new CldsSdcResourceBasicInfo();
+        SdcResourceBasicInfo sdcResource1c = new SdcResourceBasicInfo();
         sdcResource1c.setName("resource1");
         sdcResource1c.setVersion("1.2");
         rawCldsSdcResourceList.add(sdcResource1c);
-        CldsSdcResourceBasicInfo sdcResource2 = new CldsSdcResourceBasicInfo();
+        SdcResourceBasicInfo sdcResource2 = new SdcResourceBasicInfo();
         sdcResource2.setName("resource2");
         sdcResource2.setVersion("1.0");
         rawCldsSdcResourceList.add(sdcResource2);
         SdcCatalogServices catalogServices = new SdcCatalogServices();
-        List<CldsSdcResourceBasicInfo> resultList = catalogServices
+        List<SdcResourceBasicInfo> resultList = catalogServices
                 .removeDuplicateSdcResourceBasicInfo(rawCldsSdcResourceList);
-        CldsSdcResourceBasicInfo res1;
-        CldsSdcResourceBasicInfo res2;
+        SdcResourceBasicInfo res1;
+        SdcResourceBasicInfo res2;
         if ("resource1".equals(resultList.get(0).getName())) {
             res1 = resultList.get(0);
             res2 = resultList.get(1);
index afff9dd..2efc528 100644 (file)
@@ -36,9 +36,9 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.onap.clamp.clds.AbstractItCase;
-import org.onap.clamp.clds.client.req.sdc.SdcReq;
+import org.onap.clamp.clds.client.req.sdc.SdcRequests;
 import org.onap.clamp.clds.model.CldsEvent;
-import org.onap.clamp.clds.model.prop.ModelProperties;
+import org.onap.clamp.clds.model.properties.ModelProperties;
 import org.onap.clamp.clds.util.ResourceFileUtil;
 import org.skyscreamer.jsonassert.JSONAssert;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -50,7 +50,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 public class SdcReqItCase extends AbstractItCase {
 
     @Autowired
-    private SdcReq sdcReq;
+    private SdcRequests sdcReq;
     private String modelBpmnProp;
     private String modelBpmn;
     private String modelName;
@@ -98,7 +98,7 @@ public class SdcReqItCase extends AbstractItCase {
 
     @Test
     public void getSdcReqUrlsListTest() throws GeneralSecurityException, DecoderException {
-        List<String> listUrls = sdcReq.getSdcReqUrlsList(modelProperties, refProp.getStringValue("sdc.serviceUrl"));
+        List<String> listUrls = sdcReq.getSdcReqUrlsList(modelProperties);
         assertNotNull(listUrls);
         assertTrue(listUrls.size() == 1);
         assertTrue(listUrls.get(0).contains(
index 419bfde..c290a38 100644 (file)
@@ -35,7 +35,7 @@ import org.junit.runner.RunWith;
 import org.onap.clamp.clds.AbstractItCase;
 import org.onap.clamp.clds.client.req.tca.TcaRequestFormatter;
 import org.onap.clamp.clds.model.CldsEvent;
-import org.onap.clamp.clds.model.prop.ModelProperties;
+import org.onap.clamp.clds.model.properties.ModelProperties;
 import org.onap.clamp.clds.util.ResourceFileUtil;
 import org.skyscreamer.jsonassert.JSONAssert;
 import org.springframework.boot.test.context.SpringBootTest;
index 138d727..d3694ae 100644 (file)
@@ -25,6 +25,10 @@ package org.onap.clamp.clds.model.prop;
 \r
 import com.fasterxml.jackson.databind.JsonNode;\r
 \r
+import org.onap.clamp.clds.model.properties.AbstractModelElement;\r
+import org.onap.clamp.clds.model.properties.ModelBpmn;\r
+import org.onap.clamp.clds.model.properties.ModelProperties;\r
+\r
 /**\r
  * A CustomModelElement to test the capability to add new elements on the fly.\r
  */\r
index 46c70e5..851556a 100644 (file)
@@ -27,6 +27,7 @@ import java.io.IOException;
 \r
 import org.junit.Assert;\r
 import org.junit.Test;\r
+import org.onap.clamp.clds.model.properties.ModelProperties;\r
 import org.onap.clamp.clds.util.ResourceFileUtil;\r
 \r
 public class CustomModelElementTest {\r
index 7bb11a9..a7ab94c 100644 (file)
@@ -32,6 +32,10 @@ import java.io.IOException;
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.clamp.clds.model.CldsModel;
+import org.onap.clamp.clds.model.properties.Holmes;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.model.properties.Policy;
+import org.onap.clamp.clds.model.properties.Tca;
 import org.onap.clamp.clds.util.ResourceFileUtil;
 
 /**
index 591fd50..f318256 100755 (executable)
@@ -34,4 +34,4 @@ fi
 echo 'Installing requests packages for Python'
 pip install requests
 echo 'Executing the Http proxy in Cache mode only'
-python sdc_proxy.py --port 8080 --root /usr/src/http-cache-app/data-cache
\ No newline at end of file
+python sdc_proxy.py --port 2080 --root /usr/src/http-cache-app/data-cache