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 {
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) {
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) {
return request;
}
- public CBAMHealVnfRequest healReqConvert(HealVnfRequest driverRequest) {
+ public CBAMHealVnfRequest healReqConvert() {
CBAMHealVnfRequest request = new CBAMHealVnfRequest();
request.setCause("");
request.setAdditionalParams("");
-/*
- * 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.
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;
this.requestConverter = requestConverter;
this.jobId = jobId;
this.jobDbMgmr = dbManager;
- this.vnfmId = vnfmId;
+ this.vnfmId = inVnfmId;
}
private void handleGrant(){
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) {
request.setJobId(jobId);
ResourceDefinition resource = getFreeVnfResource();
- List<ResourceDefinition> resourceList = new ArrayList<ResourceDefinition>();
+ List<ResourceDefinition> resourceList = new ArrayList<>();
resourceList.add(resource);
request.setRemoveResource(resourceList);
this.requestConverter = requestConverter;
}
- public void setVnfmId(String vnfmId) {
- this.vnfmId = vnfmId;
+ public void setVnfmId(String inVnfmId) {
+ this.vnfmId = inVnfmId;
}
}
-/*
- * 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.
}
- 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);
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() {
request.setJobId(jobId);
ResourceDefinition resource = getFreeVnfResource();
- List<ResourceDefinition> resourceList = new ArrayList<ResourceDefinition>();
+ List<ResourceDefinition> resourceList = new ArrayList<>();
resourceList.add(resource);
request.setAddResource(resourceList);
-/*
- * 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.
private ScaleVnfRequest driverRequest;
private String vnfInstanceId;
private String jobId;
-
+ private String vnfmId;
+ private ScaleType type;
@Autowired
private VnfmJobExecutionMapper jobDbMgmr;
this.requestConverter = requestConverter;
this.jobId = jobId;
this.jobDbMgmr = dbManager;
+ this.vnfmId = vnfmId;
}
private void handleGrant(){
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;
}