summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan Yang <yangyanyj@chinamobile.com>2018-04-03 02:18:04 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-03 02:18:04 +0000
commit185a849076f7d604b62d9ee7fd49cacf95657e3c (patch)
tree293ffaf555fa2fdffe320fbf3febc112115635d5
parent6f37b2926e216487b44d7b25cdae7a9bbfd8160d (diff)
parent3e4e031ba53b297bae8cb0ba505aed8166502192 (diff)
Merge "Method handling nokia-vnfmdriver"
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/aai/impl/AaiMgmrInfImpl.java8
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/Driver2CbamRequestConverter.java10
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/HealVnfContinueRunnable.java16
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java12
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/ScaleVnfContinueRunnable.java16
5 files changed, 31 insertions, 31 deletions
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/aai/impl/AaiMgmrInfImpl.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/aai/impl/AaiMgmrInfImpl.java
index 748680aa..94d90bcb 100644
--- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/aai/impl/AaiMgmrInfImpl.java
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/aai/impl/AaiMgmrInfImpl.java
@@ -53,9 +53,7 @@ public class AaiMgmrInfImpl implements AaiMgmrInf{
logger.info("AaiMgmrInfImpl->queryVnfm, the vnfmInfo is {}", responseStr);
- AaiVnfmInfo response = gson.fromJson(responseStr, AaiVnfmInfo.class);
-
- return response;
+ return gson.fromJson(responseStr, AaiVnfmInfo.class);
}
private String operateHttpTask(Object httpBodyObj, String httpPath, RequestMethod method) throws IOException {
@@ -72,9 +70,7 @@ public class AaiMgmrInfImpl implements AaiMgmrInf{
headerMap.put("Authorization", "Basic " + authen);
logger.info("getVimById headerMap: {}", headerMap.toString());
- String responseStr = httpClientProcessor.process(url, method, headerMap, gson.toJson(httpBodyObj)).getContent();
-
- return responseStr;
+ return httpClientProcessor.process(url, method, headerMap, gson.toJson(httpBodyObj)).getContent();
}
public void setAdaptorEnv(AdaptorEnv env) {
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/Driver2CbamRequestConverter.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/Driver2CbamRequestConverter.java
index 5978fe7d..cb783c45 100644
--- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/Driver2CbamRequestConverter.java
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/Driver2CbamRequestConverter.java
@@ -57,16 +57,12 @@ public class Driver2CbamRequestConverter {
NslcmGrantVnfResponse nslc, GrantInfo grant, VimComputeResourceFlavour vimco) throws IOException {
Gson gson = new Gson();
String inputJson = readcbamInputInfoFromJsonFile();
- CBAMInstantiateVnfRequest request = gson.fromJson(inputJson, CBAMInstantiateVnfRequest.class);
-
- return request;
+ return gson.fromJson(inputJson, CBAMInstantiateVnfRequest.class);
}
private String readcbamInputInfoFromJsonFile() throws IOException {
String filePath = "/etc/vnfpkginfo/cbam_input.json";
- String fileContent = CommonUtil.getJsonStrFromFile(filePath);
-
- return fileContent;
+ return CommonUtil.getJsonStrFromFile(filePath);
}
public CBAMTerminateVnfRequest terminateReqConvert(TerminateVnfRequest driverRequest) {
@@ -77,7 +73,7 @@ public class Driver2CbamRequestConverter {
return request;
}
- public CBAMHealVnfRequest healReqConvert(HealVnfRequest driverRequest) {
+ public CBAMHealVnfRequest healReqConvert() {
CBAMHealVnfRequest request = new CBAMHealVnfRequest();
request.setCause("");
request.setAdditionalParams("");
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/HealVnfContinueRunnable.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/HealVnfContinueRunnable.java
index 9338a056..63cb09be 100644
--- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/HealVnfContinueRunnable.java
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/HealVnfContinueRunnable.java
@@ -1,5 +1,5 @@
-/*
- * Copyright 2016-2017, Nokia Corporation
+/**
+ * Copyright 2016-2017, Nokia Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ public class HealVnfContinueRunnable implements Runnable {
private Driver2CbamRequestConverter requestConverter;
- public HealVnfContinueRunnable(String vnfmId, HealVnfRequest driverRequest, String vnfInstanceId, String jobId,
+ public HealVnfContinueRunnable(String inVnfmId, HealVnfRequest driverRequest, String vnfInstanceId, String jobId,
NslcmMgmrInf nslcmMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter, VnfmJobExecutionMapper dbManager)
{
this.driverRequest = driverRequest;
@@ -64,7 +64,7 @@ public class HealVnfContinueRunnable implements Runnable {
this.requestConverter = requestConverter;
this.jobId = jobId;
this.jobDbMgmr = dbManager;
- this.vnfmId = vnfmId;
+ this.vnfmId = inVnfmId;
}
private void handleGrant(){
@@ -86,7 +86,7 @@ public class HealVnfContinueRunnable implements Runnable {
private CBAMHealVnfResponse handleHeal() {
CBAMHealVnfResponse cbamResponse = null;
try {
- CBAMHealVnfRequest modifyReq = requestConverter.healReqConvert(driverRequest);
+ CBAMHealVnfRequest modifyReq = requestConverter.healReqConvert();
cbamResponse = cbamMgmr.healVnf(modifyReq, vnfInstanceId);
handleCbamHealResponse(cbamResponse, jobId);
} catch (Exception e) {
@@ -117,7 +117,7 @@ public class HealVnfContinueRunnable implements Runnable {
request.setJobId(jobId);
ResourceDefinition resource = getFreeVnfResource();
- List<ResourceDefinition> resourceList = new ArrayList<ResourceDefinition>();
+ List<ResourceDefinition> resourceList = new ArrayList<>();
resourceList.add(resource);
request.setRemoveResource(resourceList);
@@ -154,7 +154,7 @@ public class HealVnfContinueRunnable implements Runnable {
this.requestConverter = requestConverter;
}
- public void setVnfmId(String vnfmId) {
- this.vnfmId = vnfmId;
+ public void setVnfmId(String inVnfmId) {
+ this.vnfmId = inVnfmId;
}
}
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java
index 07c15c0e..29524ccd 100644
--- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java
@@ -1,5 +1,5 @@
-/*
- * Copyright 2016-2017, Nokia Corporation
+/**
+ * Copyright 2016-2017, Nokia Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -158,7 +158,7 @@ public class InstantiateVnfContinueRunnable implements Runnable {
}
- private CBAMInstantiateVnfResponse handleInstantiate() throws Exception {
+ private CBAMInstantiateVnfResponse handleInstantiate() throws IOException {
CBAMInstantiateVnfRequest instantiateReq = requestConverter.instantiateRequestConvert(driverRequest, null, null, null);
CBAMInstantiateVnfResponse cbamInstantiateResponse = cbamMgmr.instantiateVnf(instantiateReq, vnfInstanceId);
handleCbamInstantiateResponse(cbamInstantiateResponse, jobId);
@@ -186,9 +186,7 @@ public class InstantiateVnfContinueRunnable implements Runnable {
private CBAMModifyVnfRequest generateModifyVnfRequest() throws IOException{
String filePath = "/etc/vnfpkginfo/cbam_extension.json";
String fileContent = CommonUtil.getJsonStrFromFile(filePath);
- CBAMModifyVnfRequest req = gson.fromJson(fileContent, CBAMModifyVnfRequest.class);
-
- return req;
+ return gson.fromJson(fileContent, CBAMModifyVnfRequest.class);
}
private void handleVnfPackage() {
@@ -260,7 +258,7 @@ public class InstantiateVnfContinueRunnable implements Runnable {
request.setJobId(jobId);
ResourceDefinition resource = getFreeVnfResource();
- List<ResourceDefinition> resourceList = new ArrayList<ResourceDefinition>();
+ List<ResourceDefinition> resourceList = new ArrayList<>();
resourceList.add(resource);
request.setAddResource(resourceList);
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/ScaleVnfContinueRunnable.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/ScaleVnfContinueRunnable.java
index 1606d533..52a08518 100644
--- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/ScaleVnfContinueRunnable.java
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/ScaleVnfContinueRunnable.java
@@ -1,5 +1,5 @@
-/*
- * Copyright 2016-2017, Nokia Corporation
+/**
+ * Copyright 2016-2017, Nokia Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,7 +48,8 @@ public class ScaleVnfContinueRunnable implements Runnable {
private ScaleVnfRequest driverRequest;
private String vnfInstanceId;
private String jobId;
-
+ private String vnfmId;
+ private ScaleType type;
@Autowired
private VnfmJobExecutionMapper jobDbMgmr;
@@ -64,6 +65,7 @@ public class ScaleVnfContinueRunnable implements Runnable {
this.requestConverter = requestConverter;
this.jobId = jobId;
this.jobDbMgmr = dbManager;
+ this.vnfmId = vnfmId;
}
private void handleGrant(){
@@ -153,6 +155,14 @@ public class ScaleVnfContinueRunnable implements Runnable {
this.jobId = jobId;
}
+ public void setVnfmId(String vnfmId) {
+ this.vnfmId = vnfmId;
+ }
+
+ public void setType(ScaleType type) {
+ this.type = type;
+ }
+
public void setRequestConverter(Driver2CbamRequestConverter requestConverter) {
this.requestConverter = requestConverter;
}