diff options
author | Gao Weitao <victor.gao@huawei.com> | 2017-09-20 07:49:14 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-20 07:49:14 +0000 |
commit | 08046f44be3223e9ae3308abb046da8e9ff7d7d0 (patch) | |
tree | 6393984704a0f8e405d68886976b6c83e7bc9f13 /huawei/vnfmadapter/VnfmadapterService | |
parent | 2720ab06fbee06b67f7fd68de70476629edc61c1 (diff) | |
parent | 4d163375fd9a3ad60ab57e078859230a07911662 (diff) |
Merge "Replace duplicating literal"
Diffstat (limited to 'huawei/vnfmadapter/VnfmadapterService')
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); |