summaryrefslogtreecommitdiffstats
path: root/huawei
diff options
context:
space:
mode:
authorluxin <luxin7@huawei.com>2017-09-20 11:45:05 +0800
committerluxin <luxin7@huawei.com>2017-09-20 11:45:05 +0800
commit4d163375fd9a3ad60ab57e078859230a07911662 (patch)
tree48d4ceff77f01d689b1962b7ab868fbe483e159a /huawei
parentbf5f1addf2911db53edefb6a953fc0eef70b8339 (diff)
Replace duplicating literal
Change-Id: I452679a049d29f13b549c5dc7c691f68945f7005 Issue-Id:VFC-375 Signed-off-by: luxin <luxin7@huawei.com>
Diffstat (limited to 'huawei')
-rw-r--r--huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/vnf/VnfMgrVnfm.java12
-rw-r--r--huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java6
2 files changed, 9 insertions, 9 deletions
diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/vnf/VnfMgrVnfm.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/vnf/VnfMgrVnfm.java
index 3bc7346b..33730fd2 100644
--- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/vnf/VnfMgrVnfm.java
+++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/vnf/VnfMgrVnfm.java
@@ -78,7 +78,7 @@ public class VnfMgrVnfm implements InterfaceVnfMgr {
if(statusCode == Constant.HTTP_CREATED || statusCode == Constant.HTTP_OK) {
restJson.put(Constant.RETCODE, Constant.REST_SUCCESS);
JSONObject resultObj = new JSONObject();
- resultObj.put("jobId", vnfInstanceId + "_" + Constant.PUT);
+ resultObj.put(Constant.JOBID, vnfInstanceId + "_" + Constant.PUT);
restJson.put("data", resultObj);
} else {
LOG.error("function=scaleVnf, msg=send create vnf msg to csm get wrong status: " + statusCode);
@@ -134,7 +134,7 @@ public class VnfMgrVnfm implements InterfaceVnfMgr {
JSONObject appInfo = JSONObject.fromObject(queryResult.getString("data")).getJSONObject("app_info");
JSONObject resultObj = new JSONObject();
resultObj.put("vnfInstanceId", appInfo.getString("id"));
- resultObj.put("jobId", appInfo.getString("id") + "_" + Constant.POST);
+ resultObj.put(Constant.JOBID, appInfo.getString("id") + "_" + Constant.POST);
restJson.put("data", resultObj);
} else {
LOG.error("function=createVnf, msg=send create vnf msg to csm get wrong status: " + statusCode);
@@ -162,7 +162,7 @@ public class VnfMgrVnfm implements InterfaceVnfMgr {
if(statusCode == Constant.HTTP_NOCONTENT) {
restJson.put(Constant.RETCODE, Constant.REST_SUCCESS);
JSONObject resultObj = new JSONObject();
- resultObj.put("jobId", vnfId + "_" + Constant.DELETE);
+ resultObj.put(Constant.JOBID, vnfId + "_" + Constant.DELETE);
restJson.put("data", resultObj);
} else {
LOG.error("function=removeVnf, msg=send remove vnf msg to csm get wrong status: {}", statusCode);
@@ -181,7 +181,7 @@ public class VnfMgrVnfm implements InterfaceVnfMgr {
String.format(ParamConstants.VNF_INSTANCE_GET, vnfId) + Constant.ROARAND + "&type=status", Constant.GET,
null, Constant.CERTIFICATE);
- int statusCode = queryResult.getInt("retCode");
+ int statusCode = queryResult.getInt(Constant.RETCODE);
if(statusCode == Constant.HTTP_OK || statusCode == Constant.HTTP_CREATED) {
if(null == (queryResult.get("data"))) {
@@ -208,7 +208,7 @@ public class VnfMgrVnfm implements InterfaceVnfMgr {
String.format(ParamConstants.VNF_INSTANCE_GET, vnfId) + Constant.ROARAND + "&type=status", Constant.GET,
null, Constant.CERTIFICATE);
- int statusCode = queryResult.getInt("retCode");
+ int statusCode = queryResult.getInt(Constant.RETCODE);
if(statusCode == Constant.HTTP_OK || statusCode == Constant.HTTP_CREATED) {
@@ -255,7 +255,7 @@ public class VnfMgrVnfm implements InterfaceVnfMgr {
JSONObject healResult = ResultRequestUtil.callSouth(vnfmObjcet, path, Constant.PUT, subJsonObject.toString(),
Constant.CERTIFICATE);
- int statusCode = healResult.getInt("retCode");
+ int statusCode = healResult.getInt(Constant.RETCODE);
if(statusCode == Constant.HTTP_OK) {
restJson.put(Constant.RETCODE, Constant.REST_SUCCESS);
diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java
index 5733efa7..9e58d6bb 100644
--- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java
+++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java
@@ -202,7 +202,7 @@ public class VnfMgr {
basicInfoJson.put("vnfInstanceDescription", "vFW");
Vnfm vnfm = vnfmDao.getVnfmById(retJson.getString("id"));
- basicInfoJson.put("vnfdId", vnfm == null ? "" : vnfm.getVnfdId());
+ basicInfoJson.put(Constant.VNFDID, vnfm == null ? "" : vnfm.getVnfdId());
basicInfoJson.put("vnfdPackageId", vnfm == null ? "" : vnfm.getVnfPackageId());
basicInfoJson.put("version", vnfm == null ? "" : vnfm.getVersion());
basicInfoJson.put("vnfProvider", "hw");
@@ -227,7 +227,7 @@ public class VnfMgr {
private JSONObject transferVnfBody(JSONObject vnfObject, JSONObject resObject, String vnfmId) {
JSONObject restJson = new JSONObject();
JSONObject vappIfno = new JSONObject();
- restJson.put("vnfd_id", resObject.getString("vnfdId"));
+ restJson.put("vnfd_id", resObject.getString(Constant.VNFDID));
restJson.put("plan_id", resObject.getOrDefault("planId", ""));
restJson.put("plan_name", resObject.getOrDefault("planName", ""));
restJson.put("vapp_name", vnfObject.get("vnfInstanceName"));
@@ -283,7 +283,7 @@ public class VnfMgr {
Vnfm info = new Vnfm();
info.setId(vnfObject.getJSONObject("data").getString("vnfInstanceId"));
info.setVersion(resObject.getString("vnfdVersion"));
- info.setVnfdId(resObject.getString("vnfdId"));
+ info.setVnfdId(resObject.getString(Constant.VNFDID));
info.setVnfPackageId("");
try {
vnfmDao.insertVnfm(info);