summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-02-15 16:04:12 +0100
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-02-15 16:04:12 +0100
commit57867d108c2f4db22379f5148c9dbab85a29662f (patch)
treedb477b92a01a2e5e307199acc78617b5e1a79a53 /src/main/java
parent3ba340378a42d0090273f358deaaa1a269008f83 (diff)
Code refactoring
Code refactoring, mainly Classes/Methods name renaming Issue-ID: CLAMP-85 Change-Id: I12bd190576e324ed33f057dc1a4ad32c16fcb6c2 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/clamp/clds/Application.java4
-rw-r--r--src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java4
-rw-r--r--src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java8
-rw-r--r--src/main/java/org/onap/clamp/clds/client/HolmesPolicyDelegate.java8
-rw-r--r--src/main/java/org/onap/clamp/clds/client/HolmesPolicyDeleteDelegate.java4
-rw-r--r--src/main/java/org/onap/clamp/clds/client/OperationalPolicyDelegate.java10
-rw-r--r--src/main/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegate.java6
-rw-r--r--src/main/java/org/onap/clamp/clds/client/SdcSendReqDelegate.java15
-rw-r--r--src/main/java/org/onap/clamp/clds/client/TcaPolicyDelegate.java8
-rw-r--r--src/main/java/org/onap/clamp/clds/client/TcaPolicyDeleteDelegate.java4
-rw-r--r--src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyReq.java22
-rw-r--r--src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java6
-rw-r--r--src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java85
-rw-r--r--src/main/java/org/onap/clamp/clds/client/req/sdc/SdcRequests.java (renamed from src/main/java/org/onap/clamp/clds/client/req/sdc/SdcReq.java)76
-rw-r--r--src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java18
-rw-r--r--src/main/java/org/onap/clamp/clds/config/CldsReferenceProperties.java (renamed from src/main/java/org/onap/clamp/clds/model/refprop/RefProp.java)4
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/AbstractModelElement.java (renamed from src/main/java/org/onap/clamp/clds/model/prop/AbstractModelElement.java)4
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/Global.java (renamed from src/main/java/org/onap/clamp/clds/model/prop/Global.java)4
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/Holmes.java (renamed from src/main/java/org/onap/clamp/clds/model/prop/Holmes.java)4
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/ModelBpmn.java (renamed from src/main/java/org/onap/clamp/clds/model/prop/ModelBpmn.java)4
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/ModelBpmnEntry.java (renamed from src/main/java/org/onap/clamp/clds/model/prop/ModelBpmnEntry.java)4
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/ModelProperties.java (renamed from src/main/java/org/onap/clamp/clds/model/prop/ModelProperties.java)2
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/Policy.java (renamed from src/main/java/org/onap/clamp/clds/model/prop/Policy.java)4
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/PolicyChain.java (renamed from src/main/java/org/onap/clamp/clds/model/prop/PolicyChain.java)2
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/PolicyItem.java (renamed from src/main/java/org/onap/clamp/clds/model/prop/PolicyItem.java)4
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/ResourceGroup.java (renamed from src/main/java/org/onap/clamp/clds/model/prop/ResourceGroup.java)4
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/ServiceConfiguration.java (renamed from src/main/java/org/onap/clamp/clds/model/prop/ServiceConfiguration.java)4
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/Tca.java (renamed from src/main/java/org/onap/clamp/clds/model/prop/Tca.java)4
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/TcaItem.java (renamed from src/main/java/org/onap/clamp/clds/model/prop/TcaItem.java)4
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/TcaThreshold.java (renamed from src/main/java/org/onap/clamp/clds/model/prop/TcaThreshold.java)4
-rw-r--r--src/main/java/org/onap/clamp/clds/model/sdc/SdcArtifact.java (renamed from src/main/java/org/onap/clamp/clds/model/CldsSdcArtifact.java)6
-rw-r--r--src/main/java/org/onap/clamp/clds/model/sdc/SdcResource.java (renamed from src/main/java/org/onap/clamp/clds/model/CldsSdcResource.java)26
-rw-r--r--src/main/java/org/onap/clamp/clds/model/sdc/SdcResourceBasicInfo.java (renamed from src/main/java/org/onap/clamp/clds/model/CldsSdcResourceBasicInfo.java)10
-rw-r--r--src/main/java/org/onap/clamp/clds/model/sdc/SdcServiceDetail.java (renamed from src/main/java/org/onap/clamp/clds/model/CldsSdcServiceDetail.java)16
-rw-r--r--src/main/java/org/onap/clamp/clds/model/sdc/SdcServiceInfo.java (renamed from src/main/java/org/onap/clamp/clds/model/CldsSdcServiceInfo.java)10
-rw-r--r--src/main/java/org/onap/clamp/clds/service/CldsService.java34
36 files changed, 217 insertions, 219 deletions
diff --git a/src/main/java/org/onap/clamp/clds/Application.java b/src/main/java/org/onap/clamp/clds/Application.java
index 281a87ca..9d057b58 100644
--- a/src/main/java/org/onap/clamp/clds/Application.java
+++ b/src/main/java/org/onap/clamp/clds/Application.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java b/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
index 6053a0de..3c8649cd 100644
--- a/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
+++ b/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
@@ -31,8 +31,8 @@ import java.util.Date;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
+import org.onap.clamp.clds.config.CldsReferenceProperties;
import org.onap.clamp.clds.exception.DcaeDeploymentException;
-import org.onap.clamp.clds.model.refprop.RefProp;
import org.onap.clamp.clds.util.LoggingUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -47,7 +47,7 @@ public class DcaeDispatcherServices {
protected static final EELFLogger logger = EELFManager.getInstance().getLogger(DcaeDispatcherServices.class);
protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
@Autowired
- private RefProp refProp;
+ private CldsReferenceProperties refProp;
private static final String STATUS_URL_LOG = "Status URL extracted: ";
private static final String DCAE_URL_PREFIX = "/dcae-deployments/";
private static final String DCAE_URL_PROPERTY_NAME = "DCAE_DISPATCHER_URL";
diff --git a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java b/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
index 4dfe089f..1abd8898 100644
--- a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
+++ b/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
@@ -41,13 +41,13 @@ import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
+import org.onap.clamp.clds.config.CldsReferenceProperties;
import org.onap.clamp.clds.dao.CldsDao;
import org.onap.clamp.clds.model.CldsEvent;
import org.onap.clamp.clds.model.CldsModel;
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.onap.clamp.clds.util.LoggingUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -63,7 +63,7 @@ public class DcaeInventoryServices {
protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
private static final String DCAE_INVENTORY_URL = "DCAE_INVENTORY_URL";
@Autowired
- private RefProp refProp;
+ private CldsReferenceProperties refProp;
@Autowired
private CldsDao cldsDao;
diff --git a/src/main/java/org/onap/clamp/clds/client/HolmesPolicyDelegate.java b/src/main/java/org/onap/clamp/clds/client/HolmesPolicyDelegate.java
index 34655986..4e165e14 100644
--- a/src/main/java/org/onap/clamp/clds/client/HolmesPolicyDelegate.java
+++ b/src/main/java/org/onap/clamp/clds/client/HolmesPolicyDelegate.java
@@ -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.
diff --git a/src/main/java/org/onap/clamp/clds/client/HolmesPolicyDeleteDelegate.java b/src/main/java/org/onap/clamp/clds/client/HolmesPolicyDeleteDelegate.java
index 28da1485..9075ea62 100644
--- a/src/main/java/org/onap/clamp/clds/client/HolmesPolicyDeleteDelegate.java
+++ b/src/main/java/org/onap/clamp/clds/client/HolmesPolicyDeleteDelegate.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDelegate.java b/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDelegate.java
index 77d7680b..ec83db9d 100644
--- a/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDelegate.java
+++ b/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDelegate.java
@@ -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.
diff --git a/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegate.java b/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegate.java
index 4dd20408..862d68a7 100644
--- a/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegate.java
+++ b/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegate.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/client/SdcSendReqDelegate.java b/src/main/java/org/onap/clamp/clds/client/SdcSendReqDelegate.java
index e21bfce4..438ea472 100644
--- a/src/main/java/org/onap/clamp/clds/client/SdcSendReqDelegate.java
+++ b/src/main/java/org/onap/clamp/clds/client/SdcSendReqDelegate.java
@@ -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,
diff --git a/src/main/java/org/onap/clamp/clds/client/TcaPolicyDelegate.java b/src/main/java/org/onap/clamp/clds/client/TcaPolicyDelegate.java
index 2657a03f..55fe2c57 100644
--- a/src/main/java/org/onap/clamp/clds/client/TcaPolicyDelegate.java
+++ b/src/main/java/org/onap/clamp/clds/client/TcaPolicyDelegate.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/client/TcaPolicyDeleteDelegate.java b/src/main/java/org/onap/clamp/clds/client/TcaPolicyDeleteDelegate.java
index c2aa303a..c38d3007 100644
--- a/src/main/java/org/onap/clamp/clds/client/TcaPolicyDeleteDelegate.java
+++ b/src/main/java/org/onap/clamp/clds/client/TcaPolicyDeleteDelegate.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyReq.java b/src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyReq.java
index 8753a9fd..434da4b6 100644
--- a/src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyReq.java
+++ b/src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyReq.java
@@ -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);
diff --git a/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java b/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java
index 04600330..ee78b45f 100644
--- a/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java
+++ b/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java
@@ -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.
diff --git a/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java b/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java
index 45dbf81f..299ec1e9 100644
--- a/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java
+++ b/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java
@@ -58,20 +58,20 @@ import org.apache.commons.csv.CSVRecord;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpHeaders;
+import org.onap.clamp.clds.config.CldsReferenceProperties;
import org.onap.clamp.clds.exception.SdcCommunicationException;
import org.onap.clamp.clds.model.CldsAlarmCondition;
-import org.onap.clamp.clds.model.CldsSdcArtifact;
-import org.onap.clamp.clds.model.CldsSdcResource;
-import org.onap.clamp.clds.model.CldsSdcResourceBasicInfo;
-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.CldsVfData;
import org.onap.clamp.clds.model.CldsVfKPIData;
import org.onap.clamp.clds.model.CldsVfcData;
-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.onap.clamp.clds.model.sdc.SdcArtifact;
+import org.onap.clamp.clds.model.sdc.SdcResource;
+import org.onap.clamp.clds.model.sdc.SdcResourceBasicInfo;
+import org.onap.clamp.clds.model.sdc.SdcServiceDetail;
+import org.onap.clamp.clds.model.sdc.SdcServiceInfo;
import org.onap.clamp.clds.util.CryptoUtils;
import org.onap.clamp.clds.util.LoggingUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -93,7 +93,7 @@ public class SdcCatalogServices {
private static final String SDC_INSTANCE_ID_CLAMP = "CLAMP-Tool";
private static final String RESOURCE_URL_PREFIX = "resources";
@Autowired
- private RefProp refProp;
+ private CldsReferenceProperties refProp;
/**
* Return SDC id and pw as a HTTP Basic Auth string (for example: Basic
@@ -165,8 +165,8 @@ public class SdcCatalogServices {
* A list of CldsSdcServiceInfo
* @return A list of CldsSdcServiceInfo without duplicate service UUID
*/
- public List<CldsSdcServiceInfo> removeDuplicateServices(List<CldsSdcServiceInfo> rawCldsSdcServiceList) {
- List<CldsSdcServiceInfo> cldsSdcServiceInfoList = null;
+ public List<SdcServiceInfo> removeDuplicateServices(List<SdcServiceInfo> rawCldsSdcServiceList) {
+ List<SdcServiceInfo> cldsSdcServiceInfoList = null;
if (rawCldsSdcServiceList != null && !rawCldsSdcServiceList.isEmpty()) {
// sort list
Collections.sort(rawCldsSdcServiceList);
@@ -176,7 +176,7 @@ public class SdcCatalogServices {
for (int i = 1; i < rawCldsSdcServiceList.size(); i++) {
// compare name with previous - if not equal, then keep the
// previous (it's the last with that name)
- CldsSdcServiceInfo prev = rawCldsSdcServiceList.get(i - 1);
+ SdcServiceInfo prev = rawCldsSdcServiceList.get(i - 1);
if (!rawCldsSdcServiceList.get(i).getName().equals(prev.getName())) {
cldsSdcServiceInfoList.add(prev);
}
@@ -193,8 +193,8 @@ public class SdcCatalogServices {
* @param rawCldsSdcResourceList
* @return List of CldsSdcResource
*/
- public List<CldsSdcResource> removeDuplicateSdcResourceInstances(List<CldsSdcResource> rawCldsSdcResourceList) {
- List<CldsSdcResource> cldsSdcResourceList = null;
+ public List<SdcResource> removeDuplicateSdcResourceInstances(List<SdcResource> rawCldsSdcResourceList) {
+ List<SdcResource> cldsSdcResourceList = null;
if (rawCldsSdcResourceList != null && !rawCldsSdcResourceList.isEmpty()) {
// sort list
Collections.sort(rawCldsSdcResourceList);
@@ -204,7 +204,7 @@ public class SdcCatalogServices {
for (int i = 1; i < rawCldsSdcResourceList.size(); i++) {
// compare name with previous - if not equal, then keep the
// previous (it's the last with that name)
- CldsSdcResource prev = rawCldsSdcResourceList.get(i - 1);
+ SdcResource prev = rawCldsSdcResourceList.get(i - 1);
if (!rawCldsSdcResourceList.get(i).getResourceInstanceName().equals(prev.getResourceInstanceName())) {
cldsSdcResourceList.add(prev);
}
@@ -221,9 +221,9 @@ public class SdcCatalogServices {
* @param rawCldsSdcResourceListBasicList
* @return List of CldsSdcResourceBasicInfo
*/
- public List<CldsSdcResourceBasicInfo> removeDuplicateSdcResourceBasicInfo(
- List<CldsSdcResourceBasicInfo> rawCldsSdcResourceListBasicList) {
- List<CldsSdcResourceBasicInfo> cldsSdcResourceBasicInfoList = null;
+ public List<SdcResourceBasicInfo> removeDuplicateSdcResourceBasicInfo(
+ List<SdcResourceBasicInfo> rawCldsSdcResourceListBasicList) {
+ List<SdcResourceBasicInfo> cldsSdcResourceBasicInfoList = null;
if (rawCldsSdcResourceListBasicList != null && !rawCldsSdcResourceListBasicList.isEmpty()) {
// sort list
Collections.sort(rawCldsSdcResourceListBasicList);
@@ -233,7 +233,7 @@ public class SdcCatalogServices {
for (int i = 1; i < rawCldsSdcResourceListBasicList.size(); i++) {
// compare name with previous - if not equal, then keep the
// previous (it's the last with that name)
- CldsSdcResourceBasicInfo prev = rawCldsSdcResourceListBasicList.get(i - 1);
+ SdcResourceBasicInfo prev = rawCldsSdcResourceListBasicList.get(i - 1);
if (!rawCldsSdcResourceListBasicList.get(i).getName().equals(prev.getName())) {
cldsSdcResourceBasicInfoList.add(prev);
}
@@ -260,10 +260,10 @@ public class SdcCatalogServices {
throws GeneralSecurityException, DecoderException {
String serviceUuid = "";
String responseStr = getSdcServicesInformation(null);
- List<CldsSdcServiceInfo> rawCldsSdcServicesList = getCldsSdcServicesListFromJson(responseStr);
- List<CldsSdcServiceInfo> cldsSdcServicesList = removeDuplicateServices(rawCldsSdcServicesList);
+ List<SdcServiceInfo> rawCldsSdcServicesList = getCldsSdcServicesListFromJson(responseStr);
+ List<SdcServiceInfo> cldsSdcServicesList = removeDuplicateServices(rawCldsSdcServicesList);
if (cldsSdcServicesList != null && !cldsSdcServicesList.isEmpty()) {
- for (CldsSdcServiceInfo currCldsSdcServiceInfo : cldsSdcServicesList) {
+ for (SdcServiceInfo currCldsSdcServiceInfo : cldsSdcServicesList) {
if (currCldsSdcServiceInfo != null && currCldsSdcServiceInfo.getInvariantUUID() != null
&& currCldsSdcServiceInfo.getInvariantUUID().equalsIgnoreCase(invariantId)) {
serviceUuid = currCldsSdcServiceInfo.getUuid();
@@ -282,14 +282,14 @@ public class SdcCatalogServices {
* @return The list of CldsSdcServiceInfo, if there is a failure it return
* an empty list
*/
- private List<CldsSdcServiceInfo> getCldsSdcServicesListFromJson(String jsonStr) {
+ private List<SdcServiceInfo> getCldsSdcServicesListFromJson(String jsonStr) {
ObjectMapper objectMapper = new ObjectMapper();
if (StringUtils.isBlank(jsonStr)) {
return new ArrayList<>();
}
try {
return objectMapper.readValue(jsonStr,
- objectMapper.getTypeFactory().constructCollectionType(List.class, CldsSdcServiceInfo.class));
+ objectMapper.getTypeFactory().constructCollectionType(List.class, SdcServiceInfo.class));
} catch (IOException e) {
logger.error("Error when attempting to decode the JSON containing CldsSdcServiceInfo", e);
return new ArrayList<>();
@@ -304,14 +304,14 @@ public class SdcCatalogServices {
* @return The list of CldsSdcResourceBasicInfo, an empty list in case of
* issues
*/
- private List<CldsSdcResourceBasicInfo> getAllSdcResourcesListFromJson(String jsonStr) {
+ private List<SdcResourceBasicInfo> getAllSdcResourcesListFromJson(String jsonStr) {
ObjectMapper objectMapper = new ObjectMapper();
if (StringUtils.isBlank(jsonStr)) {
return new ArrayList<>();
}
try {
return objectMapper.readValue(jsonStr,
- objectMapper.getTypeFactory().constructCollectionType(List.class, CldsSdcResourceBasicInfo.class));
+ objectMapper.getTypeFactory().constructCollectionType(List.class, SdcResourceBasicInfo.class));
} catch (IOException e) {
logger.error("Exception occurred when attempting to decode the list of CldsSdcResourceBasicInfo JSON", e);
return new ArrayList<>();
@@ -324,10 +324,10 @@ public class SdcCatalogServices {
* @param jsonStr
* @return
*/
- public CldsSdcServiceDetail getCldsSdcServiceDetailFromJson(String jsonStr) {
+ public SdcServiceDetail decodeCldsSdcServiceDetailFromJson(String jsonStr) {
ObjectMapper objectMapper = new ObjectMapper();
try {
- return objectMapper.readValue(jsonStr, CldsSdcServiceDetail.class);
+ return objectMapper.readValue(jsonStr, SdcServiceDetail.class);
} catch (IOException e) {
logger.error("Exception when attempting to decode the CldsSdcServiceDetail JSON", e);
return null;
@@ -472,9 +472,9 @@ public class SdcCatalogServices {
ObjectMapper objectMapper = new ObjectMapper();
CldsServiceData cldsServiceData = new CldsServiceData();
if (responseStr != null) {
- CldsSdcServiceDetail cldsSdcServiceDetail;
+ SdcServiceDetail cldsSdcServiceDetail;
try {
- cldsSdcServiceDetail = objectMapper.readValue(responseStr, CldsSdcServiceDetail.class);
+ cldsSdcServiceDetail = objectMapper.readValue(responseStr, SdcServiceDetail.class);
} catch (IOException e) {
logger.error("Exception when decoding the CldsServiceData JSON from SDC", e);
throw new SdcCommunicationException("Exception when decoding the CldsServiceData JSON from SDC", e);
@@ -484,11 +484,11 @@ public class SdcCatalogServices {
if (cldsSdcServiceDetail != null && cldsSdcServiceDetail.getResources() != null) {
cldsServiceData.setServiceUUID(cldsSdcServiceDetail.getUuid());
cldsServiceData.setServiceInvariantUUID(cldsSdcServiceDetail.getInvariantUUID());
- List<CldsSdcResource> cldsSdcResourceList = removeDuplicateSdcResourceInstances(
+ List<SdcResource> cldsSdcResourceList = removeDuplicateSdcResourceInstances(
cldsSdcServiceDetail.getResources());
if (cldsSdcResourceList != null && !cldsSdcResourceList.isEmpty()) {
List<CldsVfData> cldsVfDataList = new ArrayList<>();
- for (CldsSdcResource currCldsSdcResource : cldsSdcResourceList) {
+ for (SdcResource currCldsSdcResource : cldsSdcResourceList) {
if (currCldsSdcResource != null && currCldsSdcResource.getResoucreType() != null
&& "VF".equalsIgnoreCase(currCldsSdcResource.getResoucreType())) {
CldsVfData currCldsVfData = new CldsVfData();
@@ -511,9 +511,8 @@ public class SdcCatalogServices {
throws GeneralSecurityException {
// todo : refact this..
if (cldsVfDataList != null && !cldsVfDataList.isEmpty()) {
- List<CldsSdcResourceBasicInfo> allVfResources = getAllSdcVForVfcResourcesBasedOnResourceType(
- RESOURCE_VF_TYPE);
- List<CldsSdcResourceBasicInfo> allVfcResources = getAllSdcVForVfcResourcesBasedOnResourceType(
+ List<SdcResourceBasicInfo> allVfResources = getAllSdcVForVfcResourcesBasedOnResourceType(RESOURCE_VF_TYPE);
+ List<SdcResourceBasicInfo> allVfcResources = getAllSdcVForVfcResourcesBasedOnResourceType(
RESOURCE_VFC_TYPE);
allVfcResources.addAll(getAllSdcVForVfcResourcesBasedOnResourceType(RESOURCE_CVFC_TYPE));
for (CldsVfData currCldsVfData : cldsVfDataList) {
@@ -1128,18 +1127,18 @@ public class SdcCatalogServices {
* The artifact name that will be searched
* @return The artifact UUID found
*/
- public String getArtifactIdIfArtifactAlreadyExists(CldsSdcServiceDetail cldsSdcServiceDetail, String artifactName) {
+ public String getArtifactIdIfArtifactAlreadyExists(SdcServiceDetail cldsSdcServiceDetail, String artifactName) {
String artifactUuid = null;
boolean artifactExists = false;
if (cldsSdcServiceDetail != null && cldsSdcServiceDetail.getResources() != null
&& !cldsSdcServiceDetail.getResources().isEmpty()) {
- for (CldsSdcResource currCldsSdcResource : cldsSdcServiceDetail.getResources()) {
+ for (SdcResource currCldsSdcResource : cldsSdcServiceDetail.getResources()) {
if (artifactExists) {
break;
}
if (currCldsSdcResource != null && currCldsSdcResource.getArtifacts() != null
&& !currCldsSdcResource.getArtifacts().isEmpty()) {
- for (CldsSdcArtifact currCldsSdcArtifact : currCldsSdcResource.getArtifacts()) {
+ for (SdcArtifact currCldsSdcArtifact : currCldsSdcResource.getArtifacts()) {
if (currCldsSdcArtifact != null && currCldsSdcArtifact.getArtifactName() != null
&& currCldsSdcArtifact.getArtifactName().equalsIgnoreCase(artifactName)) {
artifactUuid = currCldsSdcArtifact.getArtifactUUID();
@@ -1154,7 +1153,7 @@ public class SdcCatalogServices {
}
// To get all sdc VF/VFC Resources basic info.
- private List<CldsSdcResourceBasicInfo> getAllSdcVForVfcResourcesBasedOnResourceType(String resourceType) {
+ private List<SdcResourceBasicInfo> getAllSdcVForVfcResourcesBasedOnResourceType(String resourceType) {
String catalogUrl = refProp.getStringValue(SDC_CATALOG_URL_PROPERTY_NAME);
String resourceUrl = catalogUrl + "resources?resourceType=" + resourceType;
String allSdcVfcResources = getCldsServicesOrResourcesBasedOnURL(resourceUrl);
@@ -1162,10 +1161,10 @@ public class SdcCatalogServices {
}
private String getResourceUuidFromResourceInvariantUuid(String resourceInvariantUuid,
- List<CldsSdcResourceBasicInfo> resourceInfoList) {
+ List<SdcResourceBasicInfo> resourceInfoList) {
String resourceUuid = null;
if (resourceInfoList != null && !resourceInfoList.isEmpty()) {
- for (CldsSdcResourceBasicInfo currResource : resourceInfoList) {
+ for (SdcResourceBasicInfo currResource : resourceInfoList) {
if (currResource != null && currResource.getInvariantUUID() != null && currResource.getUuid() != null
&& currResource.getInvariantUUID().equalsIgnoreCase(resourceInvariantUuid)) {
resourceUuid = currResource.getUuid();
@@ -1220,7 +1219,7 @@ public class SdcCatalogServices {
String originalServiceUuid = getServiceUuidFromServiceInvariantId(serviceInvariantUuid);
logger.info("ServiceUUID used before upload in url:" + originalServiceUuid);
String sdcServicesInformation = getSdcServicesInformation(originalServiceUuid);
- CldsSdcServiceDetail cldsSdcServiceDetail = getCldsSdcServiceDetailFromJson(sdcServicesInformation);
+ SdcServiceDetail cldsSdcServiceDetail = decodeCldsSdcServiceDetailFromJson(sdcServicesInformation);
String uploadedArtifactUuid = getArtifactIdIfArtifactAlreadyExists(cldsSdcServiceDetail,
artifactName);
// Upload artifacts to sdc
@@ -1233,7 +1232,7 @@ public class SdcCatalogServices {
}
logger.info("ServiceUUID used after upload in ulr:" + updatedServiceUuid);
sdcServicesInformation = getSdcServicesInformation(updatedServiceUuid);
- cldsSdcServiceDetail = getCldsSdcServiceDetailFromJson(sdcServicesInformation);
+ cldsSdcServiceDetail = decodeCldsSdcServiceDetailFromJson(sdcServicesInformation);
uploadedArtifactUuid = getArtifactIdIfArtifactAlreadyExists(cldsSdcServiceDetail,
locationArtifactName);
// To send location information also to sdc
diff --git a/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcReq.java b/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcRequests.java
index 3fb53a3b..214933d4 100644
--- a/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcReq.java
+++ b/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcRequests.java
@@ -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");
diff --git a/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java b/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java
index f13f4222..73355a7a 100644
--- a/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java
+++ b/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java
@@ -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);
diff --git a/src/main/java/org/onap/clamp/clds/model/refprop/RefProp.java b/src/main/java/org/onap/clamp/clds/config/CldsReferenceProperties.java
index f0cf71c1..a8acdee1 100644
--- a/src/main/java/org/onap/clamp/clds/model/refprop/RefProp.java
+++ b/src/main/java/org/onap/clamp/clds/config/CldsReferenceProperties.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/AbstractModelElement.java b/src/main/java/org/onap/clamp/clds/model/properties/AbstractModelElement.java
index a0685228..9b8d9d9c 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/AbstractModelElement.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/AbstractModelElement.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/Global.java b/src/main/java/org/onap/clamp/clds/model/properties/Global.java
index 48c2fd9f..ef36fef9 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/Global.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/Global.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/Holmes.java b/src/main/java/org/onap/clamp/clds/model/properties/Holmes.java
index bd47e8d7..db07cac4 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/Holmes.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/Holmes.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/ModelBpmn.java b/src/main/java/org/onap/clamp/clds/model/properties/ModelBpmn.java
index 9738396a..2b86b3fd 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/ModelBpmn.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/ModelBpmn.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/ModelBpmnEntry.java b/src/main/java/org/onap/clamp/clds/model/properties/ModelBpmnEntry.java
index dc668229..81cc48d6 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/ModelBpmnEntry.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/ModelBpmnEntry.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/ModelProperties.java b/src/main/java/org/onap/clamp/clds/model/properties/ModelProperties.java
index dca93e46..f9b1c25a 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/ModelProperties.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/ModelProperties.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/Policy.java b/src/main/java/org/onap/clamp/clds/model/properties/Policy.java
index 80d12aab..438936f7 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/Policy.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/Policy.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/PolicyChain.java b/src/main/java/org/onap/clamp/clds/model/properties/PolicyChain.java
index 217f7fd2..dddd7350 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/PolicyChain.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/PolicyChain.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/PolicyItem.java b/src/main/java/org/onap/clamp/clds/model/properties/PolicyItem.java
index 5fc82983..d1c1906a 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/PolicyItem.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/PolicyItem.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/ResourceGroup.java b/src/main/java/org/onap/clamp/clds/model/properties/ResourceGroup.java
index 8b2dbeb8..d3280876 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/ResourceGroup.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/ResourceGroup.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/ServiceConfiguration.java b/src/main/java/org/onap/clamp/clds/model/properties/ServiceConfiguration.java
index 418afbb9..4b80ac68 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/ServiceConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/ServiceConfiguration.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/Tca.java b/src/main/java/org/onap/clamp/clds/model/properties/Tca.java
index 4fd6b595..90a8a1ab 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/Tca.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/Tca.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/TcaItem.java b/src/main/java/org/onap/clamp/clds/model/properties/TcaItem.java
index 13bff002..299143c7 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/TcaItem.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/TcaItem.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/TcaThreshold.java b/src/main/java/org/onap/clamp/clds/model/properties/TcaThreshold.java
index d278c254..6cd13f2e 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/TcaThreshold.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/TcaThreshold.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsSdcArtifact.java b/src/main/java/org/onap/clamp/clds/model/sdc/SdcArtifact.java
index 48f90170..0f7b391f 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsSdcArtifact.java
+++ b/src/main/java/org/onap/clamp/clds/model/sdc/SdcArtifact.java
@@ -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,12 +21,12 @@
* 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;
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsSdcResource.java b/src/main/java/org/onap/clamp/clds/model/sdc/SdcResource.java
index 9c47f450..9717d7c8 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsSdcResource.java
+++ b/src/main/java/org/onap/clamp/clds/model/sdc/SdcResource.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsSdcResourceBasicInfo.java b/src/main/java/org/onap/clamp/clds/model/sdc/SdcResourceBasicInfo.java
index f91e36a8..3a60f6dc 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsSdcResourceBasicInfo.java
+++ b/src/main/java/org/onap/clamp/clds/model/sdc/SdcResourceBasicInfo.java
@@ -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;
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsSdcServiceDetail.java b/src/main/java/org/onap/clamp/clds/model/sdc/SdcServiceDetail.java
index 551418b7..8113ea54 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsSdcServiceDetail.java
+++ b/src/main/java/org/onap/clamp/clds/model/sdc/SdcServiceDetail.java
@@ -21,14 +21,14 @@
* 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;
}
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsSdcServiceInfo.java b/src/main/java/org/onap/clamp/clds/model/sdc/SdcServiceInfo.java
index cf447c5c..c829726a 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsSdcServiceInfo.java
+++ b/src/main/java/org/onap/clamp/clds/model/sdc/SdcServiceInfo.java
@@ -21,16 +21,16 @@
* 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;
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsService.java b/src/main/java/org/onap/clamp/clds/service/CldsService.java
index a139de11..14e65627 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsService.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsService.java
@@ -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);
}