aboutsummaryrefslogtreecommitdiffstats
path: root/appc-inbound/appc-design-services/provider/src
diff options
context:
space:
mode:
authormojahidi <mojahidul.islam@amdocs.com>2017-08-29 18:20:26 +0530
committerMarcus Williams <marcus.williams@intel.com>2017-08-31 18:56:59 +0000
commit3df3182a7badeef662f743bfc8d67cea805b1ef4 (patch)
tree20e41c1f971de4c21ddd62e6c087d7a5d7ea5ae9 /appc-inbound/appc-design-services/provider/src
parentdc2344fc5754dee739f1db69cc6c16dfe0522ab8 (diff)
Update ASDC References to SDC 1/2
This patch changes ASDC to SDC in APPC code, bundle names and other pertinent places. This change sanitizes SDC for Open Source. It is the first in a two part change, the first updates code mentions and artifacts. The second will update database references. Change-Id: Iffd73480cc325172b5d8969fe839728f1c88ef78 Issue-ID:APPC-179 Signed-off-by: mojahidi <mojahidul.islam@amdocs.com>
Diffstat (limited to 'appc-inbound/appc-design-services/provider/src')
-rw-r--r--appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/dbervices/DesignDBService.java40
-rw-r--r--appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/ArtifactHandlerClient.java2
-rw-r--r--appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/DesignServiceConstants.java2
-rw-r--r--appc-inbound/appc-design-services/provider/src/test/java/org/openecomp/appc/design/validator/TestDBService.java8
4 files changed, 26 insertions, 26 deletions
diff --git a/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/dbervices/DesignDBService.java b/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/dbervices/DesignDBService.java
index ba126aff2..86c895fd5 100644
--- a/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/dbervices/DesignDBService.java
+++ b/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/dbervices/DesignDBService.java
@@ -188,13 +188,13 @@ public class DesignDBService {
ArtifactHandlerClient ac = new ArtifactHandlerClient();
String requestString = ac.createArtifactData(payload, requestID);
ac.execute(requestString, "POST");
- int asdc_artifact_id = getASDCArtifactIDbyRequestID(requestID);
- int asdc_reference_id = getASDCReferenceID(payload);
- createArtifactTrackingRecord(payload, requestID,asdc_artifact_id, asdc_reference_id );
+ int sdc_artifact_id = getSDCArtifactIDbyRequestID(requestID);
+ int sdc_reference_id = getSDCReferenceID(payload);
+ createArtifactTrackingRecord(payload, requestID,sdc_artifact_id, sdc_reference_id );
String status = getDataFromActionStatus(payload, "STATUS");
if(status == null || status.isEmpty())
setActionStatus(payload, "Not Tested");
- linkstatusRelationShip(asdc_artifact_id,asdc_reference_id, payload);
+ linkstatusRelationShip(sdc_artifact_id,sdc_reference_id, payload);
}
catch(Exception e){
@@ -205,13 +205,13 @@ public class DesignDBService {
}
- private void linkstatusRelationShip(int asdc_artifact_id, int asdc_reference_id, String payload) throws Exception {
+ private void linkstatusRelationShip(int sdc_artifact_id, int sdc_reference_id, String payload) throws Exception {
ObjectMapper objectMapper = new ObjectMapper();
JsonNode payloadObject = objectMapper.readTree(payload);
ArrayList<String> argList = new ArrayList<>();
- argList.add(String.valueOf(asdc_artifact_id));
- argList.add(String.valueOf(asdc_reference_id));
+ argList.add(String.valueOf(sdc_artifact_id));
+ argList.add(String.valueOf(sdc_reference_id));
argList.add(payloadObject.get(DesignServiceConstants.VNF_TYPE).textValue());
argList.add(payloadObject.get(DesignServiceConstants.ACTION).textValue());
argList.add(payloadObject.get(DesignServiceConstants.USER_ID).textValue());
@@ -233,7 +233,7 @@ public class DesignDBService {
throw new Exception("Error while updating RealtionShip table");
}
- private int getASDCReferenceID(String payload) throws Exception {
+ private int getSDCReferenceID(String payload) throws Exception {
String vnfc_type = null;
ObjectMapper objectMapper = new ObjectMapper();
@@ -259,12 +259,12 @@ public class DesignDBService {
log.info("Query String :" + queryString);
ResultSet data = dbservice.getDBData(queryString, argList);
- int asdc_reference_id = 0;
+ int sdc_reference_id = 0;
while(data.next()) {
- asdc_reference_id = data.getInt("ASDC_REFERENCE_ID");
+ sdc_reference_id = data.getInt("ASDC_REFERENCE_ID");
}
- log.info("Got asdc_reference_id = " + asdc_reference_id );
- return asdc_reference_id;
+ log.info("Got sdc_reference_id = " + sdc_reference_id );
+ return sdc_reference_id;
}
@@ -320,14 +320,14 @@ public class DesignDBService {
return updateStatus;
}
- private void createArtifactTrackingRecord(String payload, String requestID, int asdc_artifact_id, int asdc_reference_id) throws Exception {
+ private void createArtifactTrackingRecord(String payload, String requestID, int sdc_artifact_id, int sdc_reference_id) throws Exception {
String vnfc_type = null;
ObjectMapper objectMapper = new ObjectMapper();
JsonNode payloadObject = objectMapper.readTree(payload);
ArrayList<String> argList = new ArrayList<>();
- argList.add(String.valueOf(asdc_artifact_id));
- argList.add(String.valueOf(asdc_reference_id));
+ argList.add(String.valueOf(sdc_artifact_id));
+ argList.add(String.valueOf(sdc_reference_id));
argList.add(payloadObject.get(DesignServiceConstants.USER_ID).textValue());
if (payloadObject.get(DesignServiceConstants.TECHNOLOGY) != null &&! payloadObject.get(DesignServiceConstants.TECHNOLOGY).textValue().isEmpty())
argList.add(payloadObject.get(DesignServiceConstants.TECHNOLOGY).textValue());
@@ -350,7 +350,7 @@ public class DesignDBService {
}
- private int getASDCArtifactIDbyRequestID(String requestID) throws Exception {
+ private int getSDCArtifactIDbyRequestID(String requestID) throws Exception {
log.info("Starting getArtifactIDbyRequestID DB Operation");
int artifact_id = 0;
try{
@@ -367,7 +367,7 @@ public class DesignDBService {
e.printStackTrace();
throw e;
}
- log.info("Got ASDC_ARTIFACTS_ID As :" + artifact_id);
+ log.info("Got SDC_ARTIFACTS_ID As :" + artifact_id);
return artifact_id;
}
@@ -567,8 +567,8 @@ public class DesignDBService {
// localContext.setAttribute("userID", UserId);
// if (serviceLogic != null && localContext != null) {
// String queryString = "SELECT AR.VNF_TYPE, AR.VNFC_TYPE, DAT.PROTOCOL, DAT.IN_CART from " +
- // DesignServiceConstants.DB_DT_ARTIFACT_TRACKING + " DAT , " + DesignServiceConstants.DB_ASDC_REFERENCE +
- // " AR where DAT.ASDC_REFERENCE_ID= AR.ASDC_REFERENCE_ID and DAT.USER = $userID" ;
+ // DesignServiceConstants.DB_DT_ARTIFACT_TRACKING + " DAT , " + DesignServiceConstants.DB_SDC_REFERENCE +
+ // " AR where DAT.SDC_REFERENCE_ID= AR.SDC_REFERENCE_ID and DAT.USER = $userID" ;
//
// log.info(fn + "Query String : " + queryString);
// try {
@@ -607,7 +607,7 @@ public class DesignDBService {
argList.add(UserID);
String queryString = "SELECT AR.VNF_TYPE, AR.VNFC_TYPE, DAT.PROTOCOL, DAT.IN_CART, AR.ACTION, AR.ARTIFACT_NAME, AR.ARTIFACT_TYPE from " +
- DesignServiceConstants.DB_DT_ARTIFACT_TRACKING + " DAT , " + DesignServiceConstants.DB_ASDC_REFERENCE +
+ DesignServiceConstants.DB_DT_ARTIFACT_TRACKING + " DAT , " + DesignServiceConstants.DB_SDC_REFERENCE +
" AR where DAT.ASDC_REFERENCE_ID= AR.ASDC_REFERENCE_ID and DAT.USER = ? ";
DesignResponse designResponse = new DesignResponse();
diff --git a/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/ArtifactHandlerClient.java b/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/ArtifactHandlerClient.java
index 6254728ee..331c48e34 100644
--- a/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/ArtifactHandlerClient.java
+++ b/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/ArtifactHandlerClient.java
@@ -94,7 +94,7 @@ public class ArtifactHandlerClient {
ObjectNode requestInfo = objectMapper.createObjectNode();
requestInfo.put(DesignServiceConstants.REQUETS_ID, requestID);
- requestInfo.put(DesignServiceConstants.REQUEST_ACTION, "StoreAsdcDocumentRequest");
+ requestInfo.put(DesignServiceConstants.REQUEST_ACTION, "StoreSdcDocumentRequest");
requestInfo.put(DesignServiceConstants.SOURCE, DesignServiceConstants.DESIGN_TOOL);
String random = getRandom();
diff --git a/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/DesignServiceConstants.java b/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/DesignServiceConstants.java
index 702d1d1fa..73e6ba93f 100644
--- a/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/DesignServiceConstants.java
+++ b/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/DesignServiceConstants.java
@@ -83,7 +83,7 @@ public class DesignServiceConstants {
public static final String DB_DT_ARTIFACT_TRACKING = "DT_ARTIFACT_TRACKING";
- public static final String DB_ASDC_REFERENCE = "ASDC_REFERENCE";
+ public static final String DB_SDC_REFERENCE = "ASDC_REFERENCE";
public static final String SCHEMA_SDNCTL = "SDNCTL";
public static final String GETARTIFACT = "getArtifact";
public static final String USER_ID = "userID";
diff --git a/appc-inbound/appc-design-services/provider/src/test/java/org/openecomp/appc/design/validator/TestDBService.java b/appc-inbound/appc-design-services/provider/src/test/java/org/openecomp/appc/design/validator/TestDBService.java
index d14abceb6..d1a899d14 100644
--- a/appc-inbound/appc-design-services/provider/src/test/java/org/openecomp/appc/design/validator/TestDBService.java
+++ b/appc-inbound/appc-design-services/provider/src/test/java/org/openecomp/appc/design/validator/TestDBService.java
@@ -175,13 +175,13 @@ public class TestDBService {
}
@Test
- public void testGetASDCReferenceID() {
+ public void testGetSDCReferenceID() {
try {
String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
String payload = " { \"userID\": \"0000\",\"status\":\"Test\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-status\":\"\",\"artifact-contents\": "+ content + " } ";
DesignDBService design = DesignDBService.initialise();
- Whitebox.invokeMethod(design, "getASDCReferenceID", payload);
+ Whitebox.invokeMethod(design, "getSDCReferenceID", payload);
} catch (Exception e) {
}
}
@@ -209,12 +209,12 @@ public class TestDBService {
}
@Test
- public void testGetASDCArtifactIDbyRequestID() {
+ public void testGetSDCArtifactIDbyRequestID() {
try {
String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
String payload = " { \"userID\": \"0000\",\"status\":\"Test\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-status\":\"\",\"artifact-contents\": "+ content + " } ";
DesignDBService design = DesignDBService.initialise();
- Whitebox.invokeMethod(design, "getASDCArtifactIDbyRequestID", "0");
+ Whitebox.invokeMethod(design, "getSDCArtifactIDbyRequestID", "0");
} catch (Exception e) {
}
}