<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>com.att.nsa</groupId>
+ <artifactId>dmaapClient</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
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;
\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
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
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
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
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;
@Autowired
private PolicyClient policyClient;
@Autowired
- private RefProp refProp;
+ private CldsReferenceProperties refProp;
/**
* Perform activity. Send Holmes info to policy api.
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;
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;
* 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.
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;
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;
@Autowired
private SdcCatalogServices sdcCatalogServices;
@Autowired
- private SdcReq sdcReq;
+ private SdcRequests sdcReq;
@Autowired
- private RefProp refProp;
+ private CldsReferenceProperties refProp;
/**
* Perform activity. Send to sdc proxy.
@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
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,
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;
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;
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;
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;
* @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);
* @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();
* @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();
* @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();
* @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);
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;
@Autowired
protected ApplicationContext appContext;
@Autowired
- protected RefProp refProp;
+ protected CldsReferenceProperties refProp;
/**
* Perform BRMS policy type.
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
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
* 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
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
* @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
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
* @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
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
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
* @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
* @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
* @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
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
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
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
* 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
}\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
}\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
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
}\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
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;
* 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
+ "} \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");
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;
/**
* 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);
* 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;
* 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;
* 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);
* 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;
* Holds reference properties.
*/
@Component
-public class RefProp {
+public class CldsReferenceProperties {
@Autowired
private ApplicationContext appContext;
* ============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.prop;
+package org.onap.clamp.clds.model.properties;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
* ============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.prop;
+package org.onap.clamp.clds.model.properties;
import java.util.List;
* ============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.prop;
+package org.onap.clamp.clds.model.properties;
import com.fasterxml.jackson.databind.JsonNode;
* ============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.prop;
+package org.onap.clamp.clds.model.properties;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
* ============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.prop;
+package org.onap.clamp.clds.model.properties;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
* 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;
* ============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.prop;
+package org.onap.clamp.clds.model.properties;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
* 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;
* ============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.prop;
+package org.onap.clamp.clds.model.properties;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
* ============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.prop;
+package org.onap.clamp.clds.model.properties;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
* ============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.prop;
+package org.onap.clamp.clds.model.properties;
import java.util.HashMap;
import java.util.Iterator;
* ============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.prop;
+package org.onap.clamp.clds.model.properties;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
* ============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.prop;
+package org.onap.clamp.clds.model.properties;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
* ============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.prop;
+package org.onap.clamp.clds.model.properties;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
* ============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;
* ============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.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
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;
}
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() {
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.
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;
* 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;
@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;
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.
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;
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;
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;
* 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.
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;
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;
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;
@Autowired
private XslTransformer cldsBpmnTransformer;
@Autowired
- private RefProp refProp;
+ private CldsReferenceProperties refProp;
@Autowired
private SdcCatalogServices sdcCatalogServices;
@Autowired
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());
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) {
/**
}
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());
}
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();
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);
}
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;
public abstract class AbstractItCase {
@Autowired
- protected RefProp refProp;
+ protected CldsReferenceProperties refProp;
@Autowired
protected PolicyClient policyClient;
*/
@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.
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;
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;
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;
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;
@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);
@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);
@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);
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;
public class SdcReqItCase extends AbstractItCase {
@Autowired
- private SdcReq sdcReq;
+ private SdcRequests sdcReq;
private String modelBpmnProp;
private String modelBpmn;
private String modelName;
@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(
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;
\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
\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
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;
/**
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