diff options
author | 2017-09-27 14:33:28 +0800 | |
---|---|---|
committer | 2017-09-27 15:30:54 +0800 | |
commit | a1b77452f1a8281ec5ee5f5b83ea03a30df52fc6 (patch) | |
tree | deefa020e813b6430f36405f9cdd7ebe7ad9146a /nokia/vnfmdriver/vfcadaptorservice/vfcadaptor | |
parent | 03d33a66dc1bcff543ef91726d747e987d879710 (diff) |
Add deployment part
Modify pom file because verify failed
Change-Id: I4a1123bf8811853d0db1a70c61af7fdf1c476119
Issue-ID: VFC-53
Signed-off-by: yufei_zhou <yufei.zhou@nokia-sbell.com>
Diffstat (limited to 'nokia/vnfmdriver/vfcadaptorservice/vfcadaptor')
130 files changed, 1589 insertions, 2114 deletions
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/pom.xml b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/pom.xml index 85a1b18e..67503b3b 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/pom.xml +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/pom.xml @@ -14,176 +14,132 @@ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> -<modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.onap.vfc.nfvo.driver.vnfm.svnfm</groupId> - <artifactId>vnfmadapter-service-root</artifactId> - <version>1.0.0-SNAPSHOT</version> - </parent> + <artifactId>vfcadaptor</artifactId> + <version>1.0.0-SNAPSHOT</version> + <packaging>war</packaging> - <artifactId>vfcadaptor</artifactId> - <name>vfc/nfvo/drivers/vnfm/svnfm/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor</name> - <packaging>war</packaging> - - <properties> - <springVersion>4.3.11.RELEASE</springVersion> - </properties> - - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.11</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-annotations</artifactId> - <version>2.6.5</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - <version>2.6.5</version> - </dependency> - <dependency> - <groupId>org.codehaus.jackson</groupId> - <artifactId>jackson-mapper-asl</artifactId> - <version>1.9.13</version> - </dependency> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest-library</artifactId> - <version>1.3</version> - </dependency> - - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.8.1</version> - </dependency> - - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>javax.servlet-api</artifactId> - <version>4.0.0</version> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>${springVersion}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>${springVersion}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>${springVersion}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-web</artifactId> - <version>${springVersion}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-webmvc</artifactId> - <version>${springVersion}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-expression</artifactId> - <version>${springVersion}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-aop</artifactId> - <version>${springVersion}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - <version>${springVersion}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</artifactId> - <version>${springVersion}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-orm</artifactId> - <version>${springVersion}</version> - </dependency> - - <dependency> - <groupId>dom4j</groupId> - <artifactId>dom4j</artifactId> - <version>1.6.1</version> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>2.10.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>com.jayway.jsonpath</groupId> - <artifactId>json-path</artifactId> - <version>2.4.0</version> - <scope>test</scope> - </dependency> -<dependency> - <groupId>org.json</groupId> - <artifactId>json</artifactId> - <version>20170516</version> -</dependency> + <name>vfc/nfvo/driver/vnfm/svnfm/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor</name> + <description>svnfm vnfm driver</description> + + <parent> + <groupId>org.onap.vfc.nfvo.driver.vnfm.svnfm</groupId> + <artifactId>vfcadaptor-service</artifactId> + <version>1.0.0-SNAPSHOT</version> + </parent> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - <version>1.1.2</version> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + <java.version>1.8</java.version> + </properties> + + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-data-jpa</artifactId> + </dependency> +<!-- + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-data-rest</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-hateoas</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-integration</artifactId> + </dependency> +--> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter</artifactId> + <exclusions> + <exclusion> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-logging</artifactId> + </exclusion> + <!-- https://mvnrepository.com/artifact/com.vaadin.external.google/android-json --> + <exclusion> + <groupId>com.vaadin.external.google</groupId> + <artifactId>android-json</artifactId> + </exclusion> + + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-log4j2</artifactId> </dependency> - <dependency> + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-tomcat</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.tomcat.embed</groupId> + <artifactId>tomcat-embed-jasper</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> + + + <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> + <!-- <version>4.5.2</version> + --> </dependency> <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.12</version> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + <!-- + <version>2.8.2</version> + --> </dependency> - <dependency> - <groupId>javax.persistence</groupId> - <artifactId>persistence-api</artifactId> - <version>1.0.2</version> + <groupId>org.json</groupId> + <artifactId>json</artifactId> + <version>20170516</version> </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate</artifactId> - <version>3.5.4-Final</version> - <type>pom</type> - </dependency> - <!-- - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-core</artifactId> - <version>5.2.11.Final</version> - </dependency> - --> - </dependencies> - <build> - <finalName>vfcadaptor</finalName> - </build> + </dependencies> + + + <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <version>1.5.7.RELEASE</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.5</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> + </plugin> + </plugins> + </build> </project> diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/adaptor/Cbam2DriverResponseConverter.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/adaptor/Cbam2DriverResponseConverter.java deleted file mode 100644 index a6aca56d..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/adaptor/Cbam2DriverResponseConverter.java +++ /dev/null @@ -1,136 +0,0 @@ -/* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -package com.nokia.vfcadaptor.adaptor; - -import java.util.ArrayList; -import java.util.List; - -import org.springframework.stereotype.Component; - -import com.nokia.vfcadaptor.cbam.bo.CBAMCreateVnfResponse; - -import com.nokia.vfcadaptor.cbam.bo.CBAMInstantiateVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMOperExecutVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMQueryVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMScaleVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMTerminateVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.entity.OperationExecution; -import com.nokia.vfcadaptor.cbam.bo.CBAMHealVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.HealVnfResponse; - -import com.nokia.vfcadaptor.vnfmdriver.bo.InstantiateVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.OperStatusVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.QueryVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.ScaleVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.TerminateVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.entity.ResponseDescriptor; -import com.nokia.vfcadaptor.vnfmdriver.bo.entity.ResponseHistoryList; -import com.nokia.vfcadaptor.vnfmdriver.bo.entity.VnfInfo; - -@Component -public class Cbam2DriverResponseConverter { - - - public InstantiateVnfResponse createspConvert(CBAMCreateVnfResponse cbamResponse) { - - InstantiateVnfResponse response = new InstantiateVnfResponse(); - response.setJobId("1"); - response.setVnfInstanceId(cbamResponse.getVnfInfo().getId()); - - return response; - } - - public InstantiateVnfResponse instantspConvert(CBAMInstantiateVnfResponse cbamResponse) { - InstantiateVnfResponse response = new InstantiateVnfResponse(); - response.setJobId("1"); - response.setVnfInstanceId(cbamResponse.getProblemDetails().getInstance()); - return response; - } - - public TerminateVnfResponse terminaterspConvert(CBAMTerminateVnfResponse cbamResponse) { - - TerminateVnfResponse response = new TerminateVnfResponse(); - response.setJobId("1"); - return response; - } - - public QueryVnfResponse queryspConvert(CBAMQueryVnfResponse cbamResponse) { - QueryVnfResponse response = new QueryVnfResponse(); - VnfInfo vnf = new VnfInfo(); - vnf.setVnfdId(cbamResponse.getVnfInfo().getVnfdId()); - vnf.setVersion(cbamResponse.getVnfInfo().getVnfdVersion()); - vnf.setVnfInstanceId(cbamResponse.getVnfInfo().getId()); - vnf.setVnfInstanceName(cbamResponse.getVnfInfo().getName()); - vnf.setVnfInstanceDescription(cbamResponse.getVnfInfo().getDescription()); - vnf.setVnfPackageId(cbamResponse.getVnfInfo().getOnboardedVnfPkgInfoId()); - vnf.setVnfProvider(cbamResponse.getVnfInfo().getVnfProvider()); - vnf.setVnfStatus(cbamResponse.getVnfInfo().getInstantiationState()); - vnf.setVnfType(cbamResponse.getVnfInfo().getVnfSoftwareVersion()); - response.setVnfInfo(vnf); - return response; - } - - public OperStatusVnfResponse operspConvert(CBAMOperExecutVnfResponse cbamResponse) { - - OperStatusVnfResponse response = new OperStatusVnfResponse(); - List<OperationExecution> oper=cbamResponse.getOperationExecution(); - for(int i=0;i<oper.size();i++) { - response.setJobId(oper.get(i).getId()); - ResponseDescriptor er=new ResponseDescriptor(); - er.setProgress(i); - if(oper.get(i).getStatus().equals("STARTED")) { - er.setStatus("started"); - }else - if(oper.get(i).getStatus().equals("FINISHED")) { - er.setStatus("finished"); - }else - if(oper.get(i).getStatus().equals("FAILED")) { - er.setStatus("error"); - }else - if(oper.get(i).getStatus().equals("OTHER")) { - er.setStatus("processing"); - }else { - er.setStatus("error"); - } - er.setStatusDescription(""); - er.setErrorCode(null); - er.setResponseId(oper.get(i).getGrantId().hashCode()); - List<ResponseHistoryList> list=new ArrayList<ResponseHistoryList>(); - ResponseHistoryList relist=new ResponseHistoryList(); - relist.setProgress(i); - relist.setStatus(er.getStatus()); - relist.setStatusDescription(""); - relist.setErrorCode(null); - relist.setResponseId(er.getResponseId()); - list.add(relist); - er.setResponseHistoryList(list); - response.setResponseDescriptor(er); - } - return response; - } - - public HealVnfResponse healspconvert(CBAMHealVnfResponse cbamResponse) { - HealVnfResponse response=new HealVnfResponse(); - response.setJobId("1"); - return response; - } - - public ScaleVnfResponse scalespconvert(CBAMScaleVnfResponse cbamResponse) { - ScaleVnfResponse response=new ScaleVnfResponse(); - response.setJobId("1"); - return response; - } -} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/adaptor/TerminateVnfContinueRunnable.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/adaptor/TerminateVnfContinueRunnable.java deleted file mode 100644 index de192c54..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/adaptor/TerminateVnfContinueRunnable.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nokia.vfcadaptor.adaptor; - -import java.io.IOException; - -import org.apache.http.client.ClientProtocolException; -import org.apache.log4j.Logger; - -import com.nokia.vfcadaptor.catalog.inf.CatalogMgmrInf; -import com.nokia.vfcadaptor.cbam.bo.CBAMInstantiateVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMTerminateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMTerminateVnfResponse; -import com.nokia.vfcadaptor.cbam.inf.CbamMgmrInf; -import com.nokia.vfcadaptor.nslcm.bo.NslcmGrantVnfRequest; -import com.nokia.vfcadaptor.nslcm.bo.NslcmGrantVnfResponse; -import com.nokia.vfcadaptor.nslcm.inf.NslcmMgmrInf; -import com.nokia.vfcadaptor.vnfmdriver.bo.InstantiateVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.TerminateVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.TerminateVnfResponse; - -public class TerminateVnfContinueRunnable implements Runnable { - private Logger logger = Logger.getLogger(TerminateVnfContinueRunnable.class); - - private CbamMgmrInf cbamMgmr; - private NslcmMgmrInf nslcmMgmr; - - private TerminateVnfRequest driverRequest; - private String vnfInstanceId; - - private Driver2CbamRequestConverter requestConverter; - - public TerminateVnfContinueRunnable(TerminateVnfRequest driverRequest, String vnfInstanceId, - NslcmMgmrInf nslcmMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter) - { - this.driverRequest = driverRequest; - this.vnfInstanceId = vnfInstanceId; - this.nslcmMgmr = nslcmMgmr; - this.cbamMgmr = cbamMgmr; - this.requestConverter = requestConverter; - } - - public void run() { - try { - NslcmGrantVnfRequest grantRequest = new NslcmGrantVnfRequest(); - NslcmGrantVnfResponse grantResponse = nslcmMgmr.grantVnf(grantRequest); - handleNslcmGrantResponse(grantResponse); - - CBAMTerminateVnfRequest cbamRequest = requestConverter.terminaterqConvert(driverRequest); - CBAMTerminateVnfResponse cbamResponse = cbamMgmr.terminateVnf(cbamRequest, vnfInstanceId); - - cbamMgmr.deleteVnf(vnfInstanceId); - - } catch (ClientProtocolException e) { - logger.error("TerminateVnfContinueRunnable run error ClientProtocolException", e); - } catch (IOException e) { - logger.error("TerminateVnfContinueRunnable run error IOException", e); - } - - } - - private void handleNslcmGrantResponse(NslcmGrantVnfResponse grantResponse) { - // TODO Auto-generated method stub - - } - -} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/adaptor/VnfmDriverMgmrIml.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/adaptor/VnfmDriverMgmrIml.java deleted file mode 100644 index 6c332441..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/adaptor/VnfmDriverMgmrIml.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nokia.vfcadaptor.adaptor; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.apache.http.HttpStatus; -import org.apache.http.client.ClientProtocolException; -import org.apache.log4j.Logger; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.nokia.vfcadaptor.catalog.inf.CatalogMgmrInf; -import com.nokia.vfcadaptor.cbam.bo.CBAMCreateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMCreateVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMHealVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMHealVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMQueryVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMScaleVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMScaleVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMTerminateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMTerminateVnfResponse; -import com.nokia.vfcadaptor.cbam.inf.CbamMgmrInf; -import com.nokia.vfcadaptor.constant.CommonConstants; -import com.nokia.vfcadaptor.exception.VnfmDriverException; -import com.nokia.vfcadaptor.nslcm.bo.NslcmGrantVnfRequest; -import com.nokia.vfcadaptor.nslcm.bo.NslcmGrantVnfResponse; -import com.nokia.vfcadaptor.nslcm.bo.VnfmInfo; -import com.nokia.vfcadaptor.nslcm.inf.NslcmMgmrInf; -import com.nokia.vfcadaptor.vnfmdriver.bo.HealVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.HealVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.InstantiateVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.InstantiateVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.OperStatusVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.QueryVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.ScaleVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.ScaleVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.TerminateVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.TerminateVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.entity.ResponseDescriptor; -import com.nokia.vfcadaptor.vnfmdriver.bo.entity.ResponseHistoryList; -import com.nokia.vfcadaptor.vnfmdriver.inf.VnfmDriverMgmrInf; - -@Component -public class VnfmDriverMgmrIml implements VnfmDriverMgmrInf{ - private Logger logger = Logger.getLogger(VnfmDriverMgmrIml.class); - - @Autowired - Driver2CbamRequestConverter requestConverter; - - @Autowired - Cbam2DriverResponseConverter responseConverter; - - @Autowired - private CbamMgmrInf cbamMgmr; - - @Autowired - private CatalogMgmrInf catalogMgmr; - - @Autowired - private NslcmMgmrInf nslcmMgmr; - - public InstantiateVnfResponse instantiateVnf(InstantiateVnfRequest driverRequest, String vnfmId) throws VnfmDriverException { - InstantiateVnfResponse driverResponse; - try { - //step 1: query vnfm info - VnfmInfo vnfmInfo = nslcmMgmr.queryVnfm(vnfmId); - - if(vnfmInfo == null || vnfmId.equalsIgnoreCase(vnfmInfo.getVnfmId())) - { - throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); - } - - //step 3: create vnf - CBAMCreateVnfRequest cbamRequest = requestConverter.createrqConvert(driverRequest); - CBAMCreateVnfResponse cbamResponse = cbamMgmr.createVnf(cbamRequest); - driverResponse = responseConverter.createspConvert(cbamResponse); - - String vnfInstanceId = driverResponse.getVnfInstanceId(); - String jobId = driverResponse.getJobId(); - continueInstantiateVnf(driverRequest, vnfInstanceId, jobId); - - - } catch (Exception e) { - throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); - } - - return driverResponse; - } - - public void continueInstantiateVnf(InstantiateVnfRequest driverRequest, String vnfInstanceId, String jobId) { - InstantiateVnfContinueRunnable runnable = new InstantiateVnfContinueRunnable(driverRequest, vnfInstanceId, jobId, - nslcmMgmr, catalogMgmr, cbamMgmr, requestConverter); - - Thread thread = new Thread(runnable); - - thread.run(); - } - - public TerminateVnfResponse terminateVnf(TerminateVnfRequest driverRequest, String vnfmId, String vnfInstanceId) { - TerminateVnfResponse driverResponse; - try { - nslcmMgmr.queryVnfm(vnfmId); - driverResponse = generateTerminateVnfResponse(vnfInstanceId); - continueTerminateVnf(driverRequest, vnfInstanceId); - - } catch (Exception e) { - throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); - } - - return driverResponse; - } - - private TerminateVnfResponse generateTerminateVnfResponse(String vnfInstanceId) { - TerminateVnfResponse response = new TerminateVnfResponse(); - //TODO - response.setJobId(""); - return response; - } - - public void continueTerminateVnf(TerminateVnfRequest driverRequest, String vnfInstanceId) { - TerminateVnfContinueRunnable runnable = new TerminateVnfContinueRunnable(driverRequest, vnfInstanceId, - nslcmMgmr, cbamMgmr, requestConverter); - - Thread thread = new Thread(runnable); - - thread.run(); - } - - - public QueryVnfResponse queryVnf(String vnfmId, String vnfInstanceId) { - QueryVnfResponse driverResponse; - try { - nslcmMgmr.queryVnfm(vnfmId); - CBAMQueryVnfResponse cbamResponse = cbamMgmr.queryVnf(vnfInstanceId); - driverResponse = responseConverter.queryspConvert(cbamResponse); - } catch (Exception e) { - throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); - } - - return driverResponse; - } - - public OperStatusVnfResponse getOperStatus(String vnfmId, String jobId) { - OperStatusVnfResponse response = new OperStatusVnfResponse(); - - List<ResponseHistoryList> list=new ArrayList<ResponseHistoryList>(); - ResponseHistoryList relist=new ResponseHistoryList(); - relist.setErrorCode(41); - relist.setProgress(40); - relist.setResponseId(1); - relist.setStatus("proccessing"); - relist.setStatusDescription("OMC VMs are decommissioned in VIM"); - ResponseDescriptor res=new ResponseDescriptor(); - res.setErrorCode(41); - res.setProgress(40); - res.setResponseId(1); - res.setStatus("proccessing"); - res.setStatusDescription("OMC VMs are decommissioned in VIM"); - for(int i=0; i<2;i++) { - relist.setProgress(4+i); - list.add(relist); - } - res.setResponseHistoryList(list); - - response.setJobId("Jobid="+jobId); - response.setResponseDescriptor(res); - - return response; - } - - public ScaleVnfResponse scaleVnf(ScaleVnfRequest driverRequest, String vnfmId, String vnfInstanceId) throws VnfmDriverException { - ScaleVnfResponse driverResponse; - try { - nslcmMgmr.queryVnfm(vnfmId); - CBAMScaleVnfRequest cbamRequest = requestConverter.scaleconvert(driverRequest); - CBAMScaleVnfResponse cbamResponse = cbamMgmr.scaleVnf(cbamRequest, vnfInstanceId); - driverResponse = responseConverter.scalespconvert(cbamResponse); - } catch (Exception e) { - throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); - } - - return driverResponse; - } - - public HealVnfResponse healVnf(HealVnfRequest driverRequest, String vnfmId, String vnfInstanceId) throws VnfmDriverException { - HealVnfResponse driverResponse; - try { - nslcmMgmr.queryVnfm(vnfmId); - CBAMHealVnfRequest cbamRequest = requestConverter.healconvert(driverRequest); - CBAMHealVnfResponse cbamResponse = cbamMgmr.healVnf(cbamRequest, vnfInstanceId); - driverResponse = responseConverter.healspconvert(cbamResponse); - } catch (Exception e) { - throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); - } - - return driverResponse; - } - -} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/beans/ResourceType.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/beans/ResourceType.java deleted file mode 100644 index 0ce26da0..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/beans/ResourceType.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.nokia.vfcadaptor.beans; - -public enum ResourceType { - VDU, - VL, - CP, - Storage -} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMCreateVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMCreateVnfResponse.java deleted file mode 100644 index b4099da8..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMCreateVnfResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nokia.vfcadaptor.cbam.bo; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.cbam.bo.entity.ProblemDetails; -import com.nokia.vfcadaptor.cbam.bo.entity.VnfInfo; - -public class CBAMCreateVnfResponse { - @JsonProperty("vnfdId") - private VnfInfo vnfInfo; - - @JsonProperty("problemDetails") - private ProblemDetails problemDetails; - - public VnfInfo getVnfInfo() { - return vnfInfo; - } - - public void setVnfInfo(VnfInfo vnfInfo) { - this.vnfInfo = vnfInfo; - } - - public ProblemDetails getProblemDetails() { - return problemDetails; - } - - public void setProblemDetails(ProblemDetails problemDetails) { - this.problemDetails = problemDetails; - } - - - - -} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMTerminateVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMTerminateVnfResponse.java deleted file mode 100644 index 8629d543..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMTerminateVnfResponse.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nokia.vfcadaptor.cbam.bo; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.cbam.bo.entity.OperationExecution; -import com.nokia.vfcadaptor.cbam.bo.entity.ProblemDetails; - -public class CBAMTerminateVnfResponse { - @JsonProperty("operationExecution") - private OperationExecution operationExecution; - - @JsonProperty("problemDetails") - private ProblemDetails problemDetails; - - public OperationExecution getOperationExecution() { - return operationExecution; - } - - public void setOperationExecution(OperationExecution operationExecution) { - this.operationExecution = operationExecution; - } - - public ProblemDetails getProblemDetails() { - return problemDetails; - } - - public void setProblemDetails(ProblemDetails problemDetails) { - this.problemDetails = problemDetails; - } - - - - - - -} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/controller/CbamController.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/controller/CbamController.java deleted file mode 100644 index d0a9158e..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/controller/CbamController.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nokia.vfcadaptor.cbam.controller; - -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; - -import com.nokia.vfcadaptor.cbam.bo.CBAMCreateVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMHealVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMHealVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMInstantiateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMInstantiateVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMOperExecutVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMOperExecutVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMQueryVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMScaleVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMScaleVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMTerminateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMTerminateVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.entity.OperationExecution; -import com.nokia.vfcadaptor.cbam.bo.entity.ProblemDetails; -import com.nokia.vfcadaptor.cbam.bo.entity.VnfInfo; - -@Controller -@RequestMapping(value = "/vnfm/lcm/v3") -public class CbamController { - - @RequestMapping(value = "/vnfs", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public CBAMCreateVnfResponse createVnf(CBAMInstantiateVnfRequest request) - { - CBAMCreateVnfResponse response = new CBAMCreateVnfResponse(); - VnfInfo op=new VnfInfo(); - op.setName("VNF_001"); - ProblemDetails pr=new ProblemDetails(); - pr.setStatus(200); - response.setVnfInfo(op); - response.setProblemDetails(pr); - return response; - } - @RequestMapping(value = "/vnfs/{vnfInstanceId}/instantiate", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public CBAMInstantiateVnfResponse initiateVnf(CBAMInstantiateVnfRequest request, @PathVariable("vnfInstanceId") String vnfInstanceId) - { - CBAMInstantiateVnfResponse response = new CBAMInstantiateVnfResponse(); -// response.setJobid("11234"); - - return response; - } - - @RequestMapping(value = "/vnfs/{vnfInstanceId}/terminate", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public CBAMTerminateVnfResponse terminateVnf(CBAMTerminateVnfRequest request, @PathVariable("vnfInstanceId") String vnfInstanceId) - { - CBAMTerminateVnfResponse response = new CBAMTerminateVnfResponse(); - OperationExecution op=new OperationExecution(); - op.setGrantId("89"); - ProblemDetails pr=new ProblemDetails(); - pr.setStatus(200); - response.setOperationExecution(op); - response.setProblemDetails(pr); - return response; - } - - @RequestMapping(value = "/vnfs/{vnfInstanceId}/scale", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public CBAMScaleVnfResponse scaleVnf(CBAMScaleVnfRequest request, @PathVariable("vnfInstanceId") String vnfInstanceId) - { - CBAMScaleVnfResponse response = new CBAMScaleVnfResponse(); - OperationExecution op=new OperationExecution(); - op.setGrantId("89"); - ProblemDetails pr=new ProblemDetails(); - pr.setStatus(200); - response.setOperationExecution(op); - response.setProblemDetails(pr); - return response; - } - - @RequestMapping(value = "/vnfs/{vnfInstanceId}/heal", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public CBAMHealVnfResponse healVnf(CBAMHealVnfRequest request, @PathVariable("vnfInstanceId") String vnfInstanceId) - { - CBAMHealVnfResponse response = new CBAMHealVnfResponse(); - OperationExecution op=new OperationExecution(); - op.setGrantId("89"); - ProblemDetails pr=new ProblemDetails(); - pr.setStatus(200); - response.setOperationExecution(op); - response.setProblemDetails(pr); - return response; - } - - - @RequestMapping(value = "/vnfs/{vnfInstanceId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public CBAMQueryVnfResponse queryVnf(@PathVariable("vnfInstanceId") String vnfInstanceId) - { - CBAMQueryVnfResponse response = new CBAMQueryVnfResponse(); - VnfInfo op=new VnfInfo(); - op.setName("VNF_001"); - ProblemDetails pr=new ProblemDetails(); - pr.setStatus(200); - response.setVnfInfo(op); - response.setProblemDetails(pr); - return response; - } - - - @RequestMapping(value = "/operation_executions/{operationExecutionId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public CBAMOperExecutVnfResponse operVnf(@PathVariable("operationExecutionId") String operationExecutionId) - { - CBAMOperExecutVnfResponse response = new CBAMOperExecutVnfResponse(); - ProblemDetails pr=new ProblemDetails(); - pr.setStatus(200); - response.setProblemDetails(pr); - return response; - } - - @RequestMapping(value = "/operation_executions/{operationExecutionId}/cancel", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE,consumes = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public CBAMOperExecutVnfResponse operCancelVnf(CBAMOperExecutVnfRequest request,@PathVariable("operationExecutionId") String operationExecutionId) - { - CBAMOperExecutVnfResponse response = new CBAMOperExecutVnfResponse(); - ProblemDetails pr=new ProblemDetails(); - pr.setStatus(200); - response.setProblemDetails(pr); - return response; - } - - -} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/ServletInitializer.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/ServletInitializer.java new file mode 100644 index 00000000..b51f7cf4 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/ServletInitializer.java @@ -0,0 +1,29 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.vfc.nfvo.driver.vnfm.svnfm; + +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.support.SpringBootServletInitializer; + +public class ServletInitializer extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(VfcadaptorApplication.class); + } + +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/VfcadaptorApplication.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/VfcadaptorApplication.java new file mode 100644 index 00000000..09aa8193 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/VfcadaptorApplication.java @@ -0,0 +1,33 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.vfc.nfvo.driver.vnfm.svnfm; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +@Configuration +@SpringBootApplication +//@ComponentScan(basePackages= {"org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.controller"}) +@ComponentScan +public class VfcadaptorApplication { + + public static void main(String[] args) { + SpringApplication.run(VfcadaptorApplication.class, args); + } +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/Cbam2DriverResponseConverter.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/Cbam2DriverResponseConverter.java new file mode 100644 index 00000000..33d34d0f --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/Cbam2DriverResponseConverter.java @@ -0,0 +1,150 @@ +/* +* 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. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package org.onap.vfc.nfvo.driver.vnfm.svnfm.adaptor; + +import java.util.ArrayList; +import java.util.List; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMCreateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMQueryVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMScaleVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OperationExecution; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonConstants; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.db.bean.VnfmJobExecutionInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.db.repository.VnfmJobExecutionRepository; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.HealVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.InstantiateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.OperStatusVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.QueryVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.ScaleVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.TerminateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.ResponseDescriptor; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.ResponseHistoryList; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.VnfInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class Cbam2DriverResponseConverter { + + @Autowired + private VnfmJobExecutionRepository jobDbManager; + + public InstantiateVnfResponse createRspConvert(CBAMCreateVnfResponse cbamResponse) { + + VnfmJobExecutionInfo jobInfo = new VnfmJobExecutionInfo(); + jobInfo.setVnfInstanceId(cbamResponse.getId()); + jobInfo.setVnfmInterfceName(CommonConstants.NSLCM_OPERATION_INSTANTIATE); + jobInfo.setStatus(CommonConstants.CBAM_OPERATION_STATUS_START); + + VnfmJobExecutionInfo jobInfo1 = (VnfmJobExecutionInfo) jobDbManager.save(jobInfo); + Long jobId = jobInfo1.getJobId(); + + InstantiateVnfResponse response = new InstantiateVnfResponse(); + response.setJobId(jobId.longValue() + ""); + response.setVnfInstanceId(cbamResponse.getId()); + + return response; + } + + public InstantiateVnfResponse instantiateRspConvert(CBAMInstantiateVnfResponse cbamResponse) { + InstantiateVnfResponse response = new InstantiateVnfResponse(); + + VnfmJobExecutionInfo jobInfo = jobDbManager.findOne(Long.getLong(cbamResponse.getId())); + + response.setJobId("1"); + + response.setVnfInstanceId(""); + return response; + } + + public TerminateVnfResponse terminateRspConvert(CBAMTerminateVnfResponse cbamResponse) { + VnfmJobExecutionInfo jobInfo = new VnfmJobExecutionInfo(); + jobInfo.setVnfInstanceId(cbamResponse.getId()); + jobInfo.setVnfmInterfceName(CommonConstants.NSLCM_OPERATION_TERMINATE); + jobInfo.setStatus(CommonConstants.CBAM_OPERATION_STATUS_START); + + VnfmJobExecutionInfo jobInfo1 = (VnfmJobExecutionInfo) jobDbManager.save(jobInfo); + Long jobId = jobInfo1.getJobId(); + TerminateVnfResponse response = new TerminateVnfResponse(); + response.setJobId(jobId.longValue() + ""); + return response; + } + + public QueryVnfResponse queryRspConvert(CBAMQueryVnfResponse cbamResponse) { + QueryVnfResponse response = new QueryVnfResponse(); + VnfInfo vnf = new VnfInfo(); + vnf.setVnfdId(cbamResponse.getVnfdId()); + vnf.setVersion(cbamResponse.getVnfdVersion()); + vnf.setVnfInstanceId(cbamResponse.getId()); + vnf.setVnfInstanceName(cbamResponse.getName()); + vnf.setVnfInstanceDescription(cbamResponse.getDescription()); + vnf.setVnfPackageId(cbamResponse.getOnboardedVnfPkgInfoId()); + vnf.setVnfProvider(cbamResponse.getVnfProvider()); + vnf.setVnfStatus(cbamResponse.getInstantiationState()); + vnf.setVnfType(cbamResponse.getVnfSoftwareVersion()); + return response; + } + + public OperStatusVnfResponse operRspConvert(OperationExecution oper) { + + OperStatusVnfResponse response = new OperStatusVnfResponse(); + + response.setJobId(oper.getId()); + ResponseDescriptor er = new ResponseDescriptor(); + // TODO er.setProgress(i); + if (oper.getStatus().equals("STARTED")) { + er.setStatus("started"); + } else if (oper.getStatus().equals("FINISHED")) { + er.setStatus("finished"); + } else if (oper.getStatus().equals("FAILED")) { + er.setStatus("error"); + } else if (oper.getStatus().equals("OTHER")) { + er.setStatus("processing"); + } else { + er.setStatus("error"); + } + er.setStatusDescription(""); + er.setErrorCode(null); + er.setResponseId(oper.getGrantId().hashCode()); + List<ResponseHistoryList> list = new ArrayList<ResponseHistoryList>(); + ResponseHistoryList relist = new ResponseHistoryList(); + // TODO relist.setProgress(i); + relist.setStatus(er.getStatus()); + relist.setStatusDescription(""); + relist.setErrorCode(null); + relist.setResponseId(er.getResponseId()); + list.add(relist); + er.setResponseHistoryList(list); + response.setResponseDescriptor(er); + return response; + } + + public HealVnfResponse healRspConvert(CBAMHealVnfResponse cbamResponse) { + HealVnfResponse response = new HealVnfResponse(); + response.setJobId("1"); + return response; + } + + public ScaleVnfResponse scaleRspConvert(CBAMScaleVnfResponse cbamResponse) { + ScaleVnfResponse response = new ScaleVnfResponse(); + response.setJobId("1"); + return response; + } +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/adaptor/Driver2CbamRequestConverter.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/Driver2CbamRequestConverter.java index 5a51917d..a6dcc0af 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/adaptor/Driver2CbamRequestConverter.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/Driver2CbamRequestConverter.java @@ -14,37 +14,39 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.adaptor; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.adaptor; import java.util.ArrayList; import java.util.List; -import org.springframework.stereotype.Component; -import com.nokia.vfcadaptor.cbam.bo.CBAMCreateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMHealVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMInstantiateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMScaleVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMTerminateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.entity.EndpointInfo; -import com.nokia.vfcadaptor.cbam.bo.entity.ExtVirtualLinkData; -import com.nokia.vfcadaptor.cbam.bo.entity.OPENSTACK_V3_INFO; -import com.nokia.vfcadaptor.cbam.bo.entity.OpenStackAccessInfoV3; -import com.nokia.vfcadaptor.cbam.bo.entity.VimInfo; -import com.nokia.vfcadaptor.cbam.bo.entity.VimInfoType; -import com.nokia.vfcadaptor.cbam.bo.entity.VnfExtCpData; -import com.nokia.vfcadaptor.constant.CommonEnum; -import com.nokia.vfcadaptor.nslcm.bo.NslcmGrantVnfResponse; -import com.nokia.vfcadaptor.nslcm.bo.entity.GrantInfo; -import com.nokia.vfcadaptor.nslcm.bo.entity.VimComputeResourceFlavour; -import com.nokia.vfcadaptor.vnfmdriver.bo.HealVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.InstantiateVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.ScaleVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.TerminateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMCreateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMScaleVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.EndpointInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.ExtVirtualLinkData; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OPENSTACK_V3_INFO; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OpenStackAccessInfoV3; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VimInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VimInfoType; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VnfExtCpData; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.GrantInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.VimComputeResourceFlavour; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.HealVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.InstantiateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.ScaleVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.TerminateVnfRequest; + +import org.springframework.stereotype.Component; @Component public class Driver2CbamRequestConverter { - public CBAMCreateVnfRequest createrqConvert(InstantiateVnfRequest driverRequest) { + public CBAMCreateVnfRequest createReqConvert(InstantiateVnfRequest driverRequest) { CBAMCreateVnfRequest request = new CBAMCreateVnfRequest(); request.setVnfdId("vnfd_001"); @@ -53,7 +55,7 @@ public class Driver2CbamRequestConverter { return request; } - public CBAMInstantiateVnfRequest InstantiateCqonvert(InstantiateVnfRequest driverRequest, + public CBAMInstantiateVnfRequest InstantiateReqConvert(InstantiateVnfRequest driverRequest, NslcmGrantVnfResponse nslc, GrantInfo grant, VimComputeResourceFlavour vimco) { CBAMInstantiateVnfRequest request = new CBAMInstantiateVnfRequest(); List<VimInfo> vims = new ArrayList<VimInfo>(); @@ -90,21 +92,21 @@ public class Driver2CbamRequestConverter { return request; } - public CBAMTerminateVnfRequest terminaterqConvert(TerminateVnfRequest driverRequest) { + public CBAMTerminateVnfRequest terminateReqConvert(TerminateVnfRequest driverRequest) { CBAMTerminateVnfRequest request = new CBAMTerminateVnfRequest(); request.setTerminationType(driverRequest.getTerminationType()); request.setGracefulTerminationTimeout(driverRequest.getGracefulTerminationTimeout()); return request; } - public CBAMHealVnfRequest healconvert(HealVnfRequest driverRequest) { + public CBAMHealVnfRequest healReqConvert(HealVnfRequest driverRequest) { CBAMHealVnfRequest request = new CBAMHealVnfRequest(); request.setCause(""); request.setAdditionalParams(""); return request; } - public CBAMScaleVnfRequest scaleconvert(ScaleVnfRequest driverRequest) { + public CBAMScaleVnfRequest scaleReqconvert(ScaleVnfRequest driverRequest) { CBAMScaleVnfRequest request = new CBAMScaleVnfRequest(); if (driverRequest.getType().equals("SCALE_OUT")) { request.setType(CommonEnum.ScaleDirection.OUT); diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/adaptor/InstantiateVnfContinueRunnable.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java index 7efb9e9d..954ab6b1 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/adaptor/InstantiateVnfContinueRunnable.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java @@ -14,33 +14,35 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.adaptor; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.adaptor; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.http.client.ClientProtocolException; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.inf.CatalogMgmrInf; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.inf.CbamMgmrInf; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonConstants; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum.LifecycleOperation; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.db.bean.VnfmJobExecutionInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.db.repository.VnfmJobExecutionRepository; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmNotifyLCMEventsRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.ResourceDefinition; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.VnfPackageInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.inf.NslcmMgmrInf; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.InstantiateVnfRequest; -import com.nokia.vfcadaptor.catalog.inf.CatalogMgmrInf; -import com.nokia.vfcadaptor.cbam.bo.CBAMInstantiateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMInstantiateVnfResponse; -import com.nokia.vfcadaptor.cbam.inf.CbamMgmrInf; -import com.nokia.vfcadaptor.constant.CommonConstants; -import com.nokia.vfcadaptor.constant.CommonEnum; -import com.nokia.vfcadaptor.constant.CommonEnum.LifecycleOperation; -import com.nokia.vfcadaptor.nslcm.bo.NslcmGrantVnfRequest; -import com.nokia.vfcadaptor.nslcm.bo.NslcmGrantVnfResponse; -import com.nokia.vfcadaptor.nslcm.bo.NslcmNotifyLCMEventsRequest; -import com.nokia.vfcadaptor.nslcm.bo.entity.ResourceDefinition; -import com.nokia.vfcadaptor.nslcm.bo.entity.VnfPackageInfo; -import com.nokia.vfcadaptor.nslcm.inf.NslcmMgmrInf; -import com.nokia.vfcadaptor.vnfmdriver.bo.InstantiateVnfRequest; public class InstantiateVnfContinueRunnable implements Runnable { - private Logger logger = Logger.getLogger(InstantiateVnfContinueRunnable.class); - + private static final Logger logger = LogManager.getLogger("InstantiateVnfContinueRunnable"); private CbamMgmrInf cbamMgmr; private CatalogMgmrInf catalogMgmr; private NslcmMgmrInf nslcmMgmr; @@ -49,10 +51,12 @@ public class InstantiateVnfContinueRunnable implements Runnable { private String vnfInstanceId; private String jobId; + private VnfmJobExecutionRepository jobDbMgmr; + private Driver2CbamRequestConverter requestConverter; public InstantiateVnfContinueRunnable(InstantiateVnfRequest driverRequest, String vnfInstanceId, String jobId, - NslcmMgmrInf nslcmMgmr, CatalogMgmrInf catalogMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter) + NslcmMgmrInf nslcmMgmr, CatalogMgmrInf catalogMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter, VnfmJobExecutionRepository dbManager) { this.driverRequest = driverRequest; this.vnfInstanceId = vnfInstanceId; @@ -61,6 +65,7 @@ public class InstantiateVnfContinueRunnable implements Runnable { this.catalogMgmr = catalogMgmr; this.cbamMgmr = cbamMgmr; this.requestConverter = requestConverter; + this.jobDbMgmr = dbManager; } public void run() { @@ -73,9 +78,9 @@ public class InstantiateVnfContinueRunnable implements Runnable { VnfPackageInfo vnfPackageInfo = catalogMgmr.queryVnfPackage(driverRequest.getVnfPackageId()); //step 5: instantiate vnf - CBAMInstantiateVnfRequest instantiateReq = requestConverter.InstantiateCqonvert(driverRequest, grantResponse, null, null); + CBAMInstantiateVnfRequest instantiateReq = requestConverter.InstantiateReqConvert(driverRequest, grantResponse, null, null); CBAMInstantiateVnfResponse cbamInstantiateResponse = cbamMgmr.instantiateVnf(instantiateReq, vnfInstanceId); - handleCbamInstantiateResponse(cbamInstantiateResponse); + handleCbamInstantiateResponse(cbamInstantiateResponse, jobId); NslcmNotifyLCMEventsRequest nslcmNotifyReq = buildNslcmNotifyLCMEventsRequest(cbamInstantiateResponse); nslcmMgmr.notifyVnf(nslcmNotifyReq, vnfInstanceId); @@ -90,7 +95,7 @@ public class InstantiateVnfContinueRunnable implements Runnable { private NslcmNotifyLCMEventsRequest buildNslcmNotifyLCMEventsRequest(CBAMInstantiateVnfResponse cbamInstantiateResponse) { NslcmNotifyLCMEventsRequest request = new NslcmNotifyLCMEventsRequest(); - if(CommonEnum.OperationStatus.STARTED == cbamInstantiateResponse.getOperationExecution().getStatus()) + if(CommonEnum.OperationStatus.STARTED == cbamInstantiateResponse.getStatus()) { request.setStatus(CommonEnum.status.start); } @@ -114,7 +119,6 @@ public class InstantiateVnfContinueRunnable implements Runnable { NslcmGrantVnfRequest request = new NslcmGrantVnfRequest(); request.setVnfInstanceId(vnfInstanceId); - request.setVnfDescriptorId(driverRequest.getVnfDescriptorId()); request.setLifecycleOperation(LifecycleOperation.Instantiate); request.setJobId(jobId); @@ -131,9 +135,11 @@ public class InstantiateVnfContinueRunnable implements Runnable { return null; } - private void handleCbamInstantiateResponse(CBAMInstantiateVnfResponse cbamInstantiateResponse) { - // TODO - //update job id record according to the executionId + private void handleCbamInstantiateResponse(CBAMInstantiateVnfResponse cbamInstantiateResponse, String jobId) { + VnfmJobExecutionInfo jobInfo = jobDbMgmr.findOne(Long.getLong(jobId)); + + jobInfo.setVnfmExecutionId(cbamInstantiateResponse.getId()); + jobDbMgmr.save(jobInfo); } private void handleNslcmGrantResponse(NslcmGrantVnfResponse grantResponse) { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/TerminateVnfContinueRunnable.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/TerminateVnfContinueRunnable.java new file mode 100644 index 00000000..ba7663d9 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/TerminateVnfContinueRunnable.java @@ -0,0 +1,136 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.vfc.nfvo.driver.vnfm.svnfm.adaptor; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.http.client.ClientProtocolException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.inf.CbamMgmrInf; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonConstants; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum.LifecycleOperation; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.db.repository.VnfmJobExecutionRepository; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmNotifyLCMEventsRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.ResourceDefinition; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.inf.NslcmMgmrInf; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.TerminateVnfRequest; + + + +public class TerminateVnfContinueRunnable implements Runnable { + private static final Logger logger = LogManager.getLogger("TerminateVnfContinueRunnable"); + + private CbamMgmrInf cbamMgmr; + private NslcmMgmrInf nslcmMgmr; + + private TerminateVnfRequest driverRequest; + private String vnfInstanceId; + private String jobId; + private VnfmJobExecutionRepository jobDbManager; + + private Driver2CbamRequestConverter requestConverter; + + public TerminateVnfContinueRunnable(TerminateVnfRequest driverRequest, String vnfInstanceId, String jobId, + NslcmMgmrInf nslcmMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter, VnfmJobExecutionRepository dbManager) + { + this.driverRequest = driverRequest; + this.vnfInstanceId = vnfInstanceId; + this.nslcmMgmr = nslcmMgmr; + this.cbamMgmr = cbamMgmr; + this.requestConverter = requestConverter; + this.jobId = jobId; + this.jobDbManager = dbManager; + } + + public void run() { + try { + NslcmGrantVnfRequest grantRequest = buildNslcmGrantVnfRequest(); + NslcmGrantVnfResponse grantResponse = nslcmMgmr.grantVnf(grantRequest); + handleNslcmGrantResponse(grantResponse); + + CBAMTerminateVnfRequest cbamRequest = requestConverter.terminateReqConvert(driverRequest); + CBAMTerminateVnfResponse cbamResponse = cbamMgmr.terminateVnf(cbamRequest, vnfInstanceId); + + cbamMgmr.deleteVnf(vnfInstanceId); + + NslcmNotifyLCMEventsRequest nslcmNotifyReq = buildNslcmNotifyLCMEventsRequest(cbamResponse); + nslcmMgmr.notifyVnf(nslcmNotifyReq, vnfInstanceId); + + } catch (ClientProtocolException e) { + logger.error("TerminateVnfContinueRunnable run error ClientProtocolException", e); + } catch (IOException e) { + logger.error("TerminateVnfContinueRunnable run error IOException", e); + } + + } + + private NslcmGrantVnfRequest buildNslcmGrantVnfRequest() { + NslcmGrantVnfRequest request = new NslcmGrantVnfRequest(); + + request.setVnfInstanceId(vnfInstanceId); + request.setLifecycleOperation(LifecycleOperation.Instantiate); + request.setJobId(jobId); + + ResourceDefinition resource = getFreeVnfResource(); + List<ResourceDefinition> resourceList = new ArrayList<ResourceDefinition>(); + resourceList.add(resource); + request.setRemoveResource(resourceList); + + return request; + } + + private ResourceDefinition getFreeVnfResource() { + // TODO Auto-generated method stub + return null; + } + + private NslcmNotifyLCMEventsRequest buildNslcmNotifyLCMEventsRequest(CBAMTerminateVnfResponse cbamResponse) { + NslcmNotifyLCMEventsRequest request = new NslcmNotifyLCMEventsRequest(); + if(CommonEnum.OperationStatus.STARTED == cbamResponse.getStatus()) + { + request.setStatus(CommonEnum.status.start); + } + else + { + request.setStatus(CommonEnum.status.result); + + //TODO the following are for the result +// request.setAffectedVnfc(affectedVnfc); +// request.setAffectedVI(affectedVI); +// request.setAffectedVirtualStorage(affectedVirtualStorage); + } + + request.setVnfInstanceId(vnfInstanceId); + request.setOperation(CommonConstants.NSLCM_OPERATION_TERMINATE); + request.setJobId(jobId); + return request; + } + + private void handleNslcmGrantResponse(NslcmGrantVnfResponse grantResponse) { + // TODO Auto-generated method stub + + } + +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrIml.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrIml.java new file mode 100644 index 00000000..fa274fee --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrIml.java @@ -0,0 +1,249 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.vfc.nfvo.driver.vnfm.svnfm.adaptor; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.inf.CatalogMgmrInf; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMCreateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMCreateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMOperExecutVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMQueryOperExecutionResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMQueryVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMScaleVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMScaleVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.inf.CbamMgmrInf; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonConstants; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.db.bean.VnfmJobExecutionInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.db.repository.VnfmJobExecutionRepository; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.exception.VnfmDriverException; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.VnfmInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.inf.NslcmMgmrInf; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.HealVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.HealVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.InstantiateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.InstantiateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.OperStatusVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.QueryVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.ScaleVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.ScaleVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.TerminateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.TerminateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.ResponseDescriptor; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.ResponseHistoryList; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.inf.VnfmDriverMgmrInf; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + + +@Component +public class VnfmDriverMgmrIml implements VnfmDriverMgmrInf{ + private static final Logger logger = LogManager.getLogger("VnfmDriverMgmrIml"); + + @Autowired + Driver2CbamRequestConverter requestConverter; + + @Autowired + Cbam2DriverResponseConverter responseConverter; + + @Autowired + private CbamMgmrInf cbamMgmr; + + @Autowired + private CatalogMgmrInf catalogMgmr; + + @Autowired + private NslcmMgmrInf nslcmMgmr; + + @Autowired + private VnfmJobExecutionRepository jobDbManager; + + public InstantiateVnfResponse instantiateVnf(InstantiateVnfRequest driverRequest, String vnfmId) throws VnfmDriverException { + InstantiateVnfResponse driverResponse; + try { + //step 1: query vnfm info + VnfmInfo vnfmInfo = nslcmMgmr.queryVnfm(vnfmId); + + if(vnfmInfo == null || vnfmId.equalsIgnoreCase(vnfmInfo.getVnfmId())) + { + throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); + } + + //step 3: create vnf + CBAMCreateVnfRequest cbamRequest = requestConverter.createReqConvert(driverRequest); + CBAMCreateVnfResponse cbamResponse = cbamMgmr.createVnf(cbamRequest); + driverResponse = responseConverter.createRspConvert(cbamResponse); + + String vnfInstanceId = driverResponse.getVnfInstanceId(); + String jobId = driverResponse.getJobId(); + continueInstantiateVnf(driverRequest, vnfInstanceId, jobId); + + + } catch (Exception e) { + throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); + } + + return driverResponse; + } + + public void continueInstantiateVnf(InstantiateVnfRequest driverRequest, String vnfInstanceId, String jobId) { + InstantiateVnfContinueRunnable runnable = new InstantiateVnfContinueRunnable(driverRequest, vnfInstanceId, jobId, + nslcmMgmr, catalogMgmr, cbamMgmr, requestConverter, jobDbManager); + + Thread thread = new Thread(runnable); + + thread.run(); + } + + public TerminateVnfResponse terminateVnf(TerminateVnfRequest driverRequest, String vnfmId, String vnfInstanceId) { + TerminateVnfResponse driverResponse; + try { + VnfmInfo vnfmInfo = nslcmMgmr.queryVnfm(vnfmId); + + if(vnfmInfo == null || vnfmId.equalsIgnoreCase(vnfmInfo.getVnfmId())) + { + throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); + } + driverResponse = generateTerminateVnfResponse(vnfInstanceId); + String jobId = driverResponse.getJobId(); + continueTerminateVnf(driverRequest, vnfInstanceId, jobId); + + } catch (Exception e) { + throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); + } + + return driverResponse; + } + + private TerminateVnfResponse generateTerminateVnfResponse(String vnfInstanceId) { + VnfmJobExecutionInfo jobInfo = new VnfmJobExecutionInfo(); + jobInfo.setVnfInstanceId(vnfInstanceId); + jobInfo.setVnfmInterfceName(CommonConstants.NSLCM_OPERATION_TERMINATE); + jobInfo.setStatus(CommonConstants.CBAM_OPERATION_STATUS_START); + + VnfmJobExecutionInfo jobInfo1= jobDbManager.save(jobInfo); + Long jobId = jobInfo1.getJobId(); + + TerminateVnfResponse response = new TerminateVnfResponse(); + response.setJobId("" + jobId); + return response; + } + + public void continueTerminateVnf(TerminateVnfRequest driverRequest, String vnfInstanceId, String jobId) { + TerminateVnfContinueRunnable runnable = new TerminateVnfContinueRunnable(driverRequest, vnfInstanceId, jobId, + nslcmMgmr, cbamMgmr, requestConverter, jobDbManager); + + Thread thread = new Thread(runnable); + + thread.run(); + } + + + public QueryVnfResponse queryVnf(String vnfmId, String vnfInstanceId) { + QueryVnfResponse driverResponse; + try { + nslcmMgmr.queryVnfm(vnfmId); + VnfmInfo vnfmInfo = nslcmMgmr.queryVnfm(vnfmId); + + if(vnfmInfo == null || vnfmId.equalsIgnoreCase(vnfmInfo.getVnfmId())) + { + throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); + } + CBAMQueryVnfResponse cbamResponse = cbamMgmr.queryVnf(vnfInstanceId); + driverResponse = responseConverter.queryRspConvert(cbamResponse); + } catch (Exception e) { + throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); + } + + return driverResponse; + } + + public OperStatusVnfResponse getOperStatus(String vnfmId, String jobId) throws VnfmDriverException { + VnfmInfo vnfmInfo; + try { + vnfmInfo = nslcmMgmr.queryVnfm(vnfmId); + } catch (Exception e) { + throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); + } + + if(vnfmInfo == null || vnfmId.equalsIgnoreCase(vnfmInfo.getVnfmId())) + { + throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); + } + + VnfmJobExecutionInfo jobInfo = jobDbManager.findOne(Long.getLong(jobId)); + String execId = jobInfo.getVnfmExecutionId(); + + CBAMQueryOperExecutionResponse cbamResponse; + + try { + cbamResponse = cbamMgmr.queryOperExecution(execId); + } catch (Exception e) { + throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); + } + + OperStatusVnfResponse response = responseConverter.operRspConvert(cbamResponse); + + return response; + } + + public ScaleVnfResponse scaleVnf(ScaleVnfRequest driverRequest, String vnfmId, String vnfInstanceId) throws VnfmDriverException { + ScaleVnfResponse driverResponse; + try { + VnfmInfo vnfmInfo = nslcmMgmr.queryVnfm(vnfmId); + + if(vnfmInfo == null || vnfmId.equalsIgnoreCase(vnfmInfo.getVnfmId())) + { + throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); + } + CBAMScaleVnfRequest cbamRequest = requestConverter.scaleReqconvert(driverRequest); + CBAMScaleVnfResponse cbamResponse = cbamMgmr.scaleVnf(cbamRequest, vnfInstanceId); + driverResponse = responseConverter.scaleRspConvert(cbamResponse); + } catch (Exception e) { + throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); + } + + return driverResponse; + } + + public HealVnfResponse healVnf(HealVnfRequest driverRequest, String vnfmId, String vnfInstanceId) throws VnfmDriverException { + HealVnfResponse driverResponse; + try { + VnfmInfo vnfmInfo = nslcmMgmr.queryVnfm(vnfmId); + + if(vnfmInfo == null || vnfmId.equalsIgnoreCase(vnfmInfo.getVnfmId())) + { + throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); + } + CBAMHealVnfRequest cbamRequest = requestConverter.healReqConvert(driverRequest); + CBAMHealVnfResponse cbamResponse = cbamMgmr.healVnf(cbamRequest, vnfInstanceId); + driverResponse = responseConverter.healRspConvert(cbamResponse); + } catch (Exception e) { + throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500); + } + + return driverResponse; + } + +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/catalog/bo/CatalogQueryVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/bo/CatalogQueryVnfRequest.java index 8b47ac9e..82946b11 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/catalog/bo/CatalogQueryVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/bo/CatalogQueryVnfRequest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.catalog.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.bo; public class CatalogQueryVnfRequest { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/catalog/bo/CatalogQueryVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/bo/CatalogQueryVnfResponse.java index 761f54b0..f5d44ca7 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/catalog/bo/CatalogQueryVnfResponse.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/bo/CatalogQueryVnfResponse.java @@ -13,14 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.catalog.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.bo; import java.util.List; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.bo.entity.ImageInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.bo.entity.VnfInstanceInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.VnfPackageInfo; + import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.catalog.bo.entity.ImageInfo; -import com.nokia.vfcadaptor.catalog.bo.entity.VnfInstanceInfo; -import com.nokia.vfcadaptor.nslcm.bo.entity.VnfPackageInfo; public class CatalogQueryVnfResponse { @JsonProperty("csarId") diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/catalog/bo/entity/ImageInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/bo/entity/ImageInfo.java index 568179bd..fe7f5f8a 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/catalog/bo/entity/ImageInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/bo/entity/ImageInfo.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.catalog.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/catalog/bo/entity/VnfInstanceInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/bo/entity/VnfInstanceInfo.java index d3c81fdf..6ce4b07b 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/catalog/bo/entity/VnfInstanceInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/bo/entity/VnfInstanceInfo.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.catalog.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/catalog/impl/CatalogMgmrImpl.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/impl/CatalogMgmrImpl.java index c3553800..186a1720 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/catalog/impl/CatalogMgmrImpl.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/impl/CatalogMgmrImpl.java @@ -14,28 +14,29 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.catalog.impl; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.impl; import java.io.IOException; import org.apache.http.client.ClientProtocolException; import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.bo.CatalogQueryVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.inf.CatalogMgmrInf; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.common.bo.AdaptorEnv; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonConstants; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.http.client.HttpRequestProcessor; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.VnfPackageInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.RequestMethod; import com.google.gson.Gson; -import com.nokia.vfcadaptor.catalog.bo.CatalogQueryVnfResponse; -import com.nokia.vfcadaptor.catalog.inf.CatalogMgmrInf; -import com.nokia.vfcadaptor.common.bo.AdaptorEnv; -import com.nokia.vfcadaptor.constant.CommonConstants; -import com.nokia.vfcadaptor.http.client.HttpRequestProcessor; -import com.nokia.vfcadaptor.nslcm.bo.entity.VnfPackageInfo; @Component public class CatalogMgmrImpl implements CatalogMgmrInf{ - private Logger logger = Logger.getLogger(CatalogMgmrImpl.class); + private static final Logger logger = LogManager.getLogger("CatalogMgmrImpl"); private Gson gson = new Gson(); @@ -46,7 +47,7 @@ public class CatalogMgmrImpl implements CatalogMgmrInf{ private HttpClientBuilder httpClientBuilder; public VnfPackageInfo queryVnfPackage(String vnfPackageId) throws ClientProtocolException, IOException { - String url="http://" + adaptorEnv.getCatalogIp() + ":" + adaptorEnv.getCatalogPort() + String.format(CommonConstants.RetrieveVnfPackagePath, vnfPackageId); + String url=adaptorEnv.getCatalogApiUriFront() + String.format(CommonConstants.RetrieveVnfPackagePath, vnfPackageId); HttpRequestProcessor processor = new HttpRequestProcessor(httpClientBuilder, RequestMethod.GET); String responseStr = processor.process(url); diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/catalog/inf/CatalogMgmrInf.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/inf/CatalogMgmrInf.java index bf7ae78c..5984aaaf 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/catalog/inf/CatalogMgmrInf.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/inf/CatalogMgmrInf.java @@ -14,13 +14,12 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.catalog.inf; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.inf; import java.io.IOException; import org.apache.http.client.ClientProtocolException; - -import com.nokia.vfcadaptor.nslcm.bo.entity.VnfPackageInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.VnfPackageInfo; public interface CatalogMgmrInf { public VnfPackageInfo queryVnfPackage(String vnfPackageId) throws ClientProtocolException, IOException; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMCreateVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMCreateVnfRequest.java index 03578d66..d1c6a7bd 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMCreateVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMCreateVnfRequest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMCreateVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMCreateVnfResponse.java new file mode 100644 index 00000000..a920fbca --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMCreateVnfResponse.java @@ -0,0 +1,47 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VnfInfo; + +public class CBAMCreateVnfResponse extends VnfInfo{ +// @JsonProperty("vnfdId") +// private VnfInfo vnfInfo; +// +// @JsonProperty("problemDetails") +// private ProblemDetails problemDetails; +// +// public VnfInfo getVnfInfo() { +// return vnfInfo; +// } +// +// public void setVnfInfo(VnfInfo vnfInfo) { +// this.vnfInfo = vnfInfo; +// } +// +// public ProblemDetails getProblemDetails() { +// return problemDetails; +// } +// +// public void setProblemDetails(ProblemDetails problemDetails) { +// this.problemDetails = problemDetails; +// } +// + + + +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMHealVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMHealVnfRequest.java index 2918e3ce..152a124a 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMHealVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMHealVnfRequest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMHealVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMHealVnfResponse.java index 4d9a4191..b3c1dee8 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMHealVnfResponse.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMHealVnfResponse.java @@ -14,14 +14,12 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.cbam.bo.entity.OperationExecution; -import com.nokia.vfcadaptor.cbam.bo.entity.ProblemDetails; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OperationExecution; -public class CBAMHealVnfResponse { - @JsonProperty("operationExecution") +public class CBAMHealVnfResponse extends OperationExecution { + /*@JsonProperty("operationExecution") private OperationExecution operationExecution; @JsonProperty("problemDetails") @@ -42,7 +40,7 @@ public class CBAMHealVnfResponse { public void setProblemDetails(ProblemDetails problemDetails) { this.problemDetails = problemDetails; } - + */ } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMInstantiateVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMInstantiateVnfRequest.java index 36628528..db79d190 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMInstantiateVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMInstantiateVnfRequest.java @@ -15,14 +15,15 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; import java.util.List; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.ExtManagedVirtualLinkData; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.ExtVirtualLinkData; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VimInfo; + import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.cbam.bo.entity.ExtManagedVirtualLinkData; -import com.nokia.vfcadaptor.cbam.bo.entity.ExtVirtualLinkData; -import com.nokia.vfcadaptor.cbam.bo.entity.VimInfo; public class CBAMInstantiateVnfRequest { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMInstantiateVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMInstantiateVnfResponse.java index 276586e8..f1b4ac82 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMInstantiateVnfResponse.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMInstantiateVnfResponse.java @@ -1,4 +1,3 @@ - /* * Copyright 2016-2017, Nokia Corporation * @@ -15,14 +14,12 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.cbam.bo.entity.OperationExecution; -import com.nokia.vfcadaptor.cbam.bo.entity.ProblemDetails; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OperationExecution; -public class CBAMInstantiateVnfResponse { - @JsonProperty("operationExecution") +public class CBAMInstantiateVnfResponse extends OperationExecution{ +/* @JsonProperty("operationExecution") private OperationExecution operationExecution; @JsonProperty("problemDetails") @@ -43,7 +40,7 @@ public class CBAMInstantiateVnfResponse { public void setProblemDetails(ProblemDetails problemDetails) { this.problemDetails = problemDetails; } - +*/ diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMOperExecutVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMOperExecutVnfRequest.java index 211448c1..0c748cfd 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMOperExecutVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMOperExecutVnfRequest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; public class CBAMOperExecutVnfRequest { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMOperExecutVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMOperExecutVnfResponse.java index c0f00b1e..f0ae5b84 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMOperExecutVnfResponse.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMOperExecutVnfResponse.java @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; import java.util.List; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OperationExecution; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.ProblemDetails; + import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.cbam.bo.entity.OperationExecution; -import com.nokia.vfcadaptor.cbam.bo.entity.ProblemDetails; public class CBAMOperExecutVnfResponse { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMQueryOperExecutionResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMQueryOperExecutionResponse.java new file mode 100644 index 00000000..8a11ea82 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMQueryOperExecutionResponse.java @@ -0,0 +1,24 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OperationExecution; + +public class CBAMQueryOperExecutionResponse extends OperationExecution{ + +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMQueryVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMQueryVnfResponse.java index 61e23134..ce00715e 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMQueryVnfResponse.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMQueryVnfResponse.java @@ -15,14 +15,12 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.cbam.bo.entity.ProblemDetails; -import com.nokia.vfcadaptor.cbam.bo.entity.VnfInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VnfInfo; -public class CBAMQueryVnfResponse { - @JsonProperty("vnfInfo") +public class CBAMQueryVnfResponse extends VnfInfo { + /*@JsonProperty("vnfInfo") private VnfInfo vnfInfo; @JsonProperty("problemDetails") @@ -42,7 +40,7 @@ public class CBAMQueryVnfResponse { public void setProblemDetails(ProblemDetails problemDetails) { this.problemDetails = problemDetails; - } + }*/ diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMScaleVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMScaleVnfRequest.java index 1c2abf2c..399b3800 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMScaleVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMScaleVnfRequest.java @@ -14,10 +14,11 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.constant.CommonEnum; public class CBAMScaleVnfRequest { @JsonProperty("type") diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMScaleVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMScaleVnfResponse.java index c001f3af..ce524648 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMScaleVnfResponse.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMScaleVnfResponse.java @@ -14,14 +14,12 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.cbam.bo.entity.OperationExecution; -import com.nokia.vfcadaptor.cbam.bo.entity.ProblemDetails; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OperationExecution; -public class CBAMScaleVnfResponse { - @JsonProperty("operationExecution") +public class CBAMScaleVnfResponse extends OperationExecution { + /*@JsonProperty("operationExecution") private OperationExecution operationExecution; @JsonProperty("problemDetails") @@ -41,7 +39,7 @@ public class CBAMScaleVnfResponse { public void setProblemDetails(ProblemDetails problemDetails) { this.problemDetails = problemDetails; - } + }*/ diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMTerminateVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMTerminateVnfRequest.java index 7761f057..8552a160 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/CBAMTerminateVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMTerminateVnfRequest.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.constant.CommonEnum; public class CBAMTerminateVnfRequest { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMTerminateVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMTerminateVnfResponse.java new file mode 100644 index 00000000..0ee100e9 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMTerminateVnfResponse.java @@ -0,0 +1,44 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OperationExecution; + +public class CBAMTerminateVnfResponse extends OperationExecution{ +// @JsonProperty("operationExecution") +// private OperationExecution operationExecution; +// +// @JsonProperty("problemDetails") +// private ProblemDetails problemDetails; +// +// public OperationExecution getOperationExecution() { +// return operationExecution; +// } +// +// public void setOperationExecution(OperationExecution operationExecution) { +// this.operationExecution = operationExecution; +// } +// +// public ProblemDetails getProblemDetails() { +// return problemDetails; +// } +// +// public void setProblemDetails(ProblemDetails problemDetails) { +// this.problemDetails = problemDetails; +// } + +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/EndpointInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/EndpointInfo.java index 863920ac..30500a7c 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/EndpointInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/EndpointInfo.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/ExtManagedVirtualLinkData.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ExtManagedVirtualLinkData.java index 4a7ee81f..b20dbe51 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/ExtManagedVirtualLinkData.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ExtManagedVirtualLinkData.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/ExtVirtualLinkData.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ExtVirtualLinkData.java index 3a7e4127..d981a77d 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/ExtVirtualLinkData.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ExtVirtualLinkData.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import java.util.ArrayList; import java.util.List; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/Inputs.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/Inputs.java index d17d6cdc..29b6b473 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/Inputs.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/Inputs.java @@ -1,4 +1,20 @@ -package com.nokia.vfcadaptor.cbam.bo.entity; +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/InstantiatedVnfInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/InstantiatedVnfInfo.java index 1479e963..94fb6973 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/InstantiatedVnfInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/InstantiatedVnfInfo.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; public class InstantiatedVnfInfo { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/NetworkAddress.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/NetworkAddress.java index b4ebb7f6..5a0649bf 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/NetworkAddress.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/NetworkAddress.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/OPENSTACK_V2_INFO.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OPENSTACK_V2_INFO.java index 2cca3090..9fad8cb3 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/OPENSTACK_V2_INFO.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OPENSTACK_V2_INFO.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/OPENSTACK_V3_INFO.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OPENSTACK_V3_INFO.java index 11cdfdfc..d5cc23a8 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/OPENSTACK_V3_INFO.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OPENSTACK_V3_INFO.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/OTHER_VIM_INFO.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OTHER_VIM_INFO.java index 0578ba16..76651247 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/OTHER_VIM_INFO.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OTHER_VIM_INFO.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/OpenStackAccessInfoV2.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OpenStackAccessInfoV2.java index bc67a619..d4d5b7c1 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/OpenStackAccessInfoV2.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OpenStackAccessInfoV2.java @@ -1,4 +1,4 @@ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; /* * Copyright 2016-2017 Nokia Corporation diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/OpenStackAccessInfoV3.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OpenStackAccessInfoV3.java index 4cf5b6f9..3a9fc360 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/OpenStackAccessInfoV3.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OpenStackAccessInfoV3.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/OperationExecution.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OperationExecution.java index efb8f8a4..e6dfbc87 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/OperationExecution.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OperationExecution.java @@ -14,10 +14,11 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.constant.CommonEnum; public class OperationExecution { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/ProblemDetails.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ProblemDetails.java index ead7e11a..73dea4b4 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/ProblemDetails.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ProblemDetails.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VCloudAccessInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VCloudAccessInfo.java index 32a3abbe..d67dfd15 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VCloudAccessInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VCloudAccessInfo.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VMWARE_VCLOUD_INFO.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VMWARE_VCLOUD_INFO.java index 866a31f4..2e417fec 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VMWARE_VCLOUD_INFO.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VMWARE_VCLOUD_INFO.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VimComputeResourceFlavour.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VimComputeResourceFlavour.java index 2add1c6f..f0d7fbc1 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VimComputeResourceFlavour.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VimComputeResourceFlavour.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VimInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VimInfo.java index c68d3b3b..db55d95f 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VimInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VimInfo.java @@ -14,10 +14,9 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.constant.CommonEnum; public class VimInfo { @JsonProperty("id") diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VimInfoType.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VimInfoType.java index 9e4aa88f..67e6ed76 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VimInfoType.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VimInfoType.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; public class VimInfoType { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VimSoftwareImage.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VimSoftwareImage.java index 53ea38b8..5b4521d1 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VimSoftwareImage.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VimSoftwareImage.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VnfExtCpData.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VnfExtCpData.java index 85c4fbeb..bbd6287b 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VnfExtCpData.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VnfExtCpData.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import java.util.ArrayList; import java.util.List; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VnfInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VnfInfo.java index 32cbcb26..1e5737cd 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VnfInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VnfInfo.java @@ -15,13 +15,14 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import java.util.ArrayList; import java.util.List; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; + import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.constant.CommonEnum; public class VnfInfo { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VnfProperty.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VnfProperty.java index 8941c393..55444de1 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/VnfProperty.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VnfProperty.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; public class VnfProperty { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/ZoneInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ZoneInfo.java index 21c830c0..fc283b80 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/ZoneInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ZoneInfo.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/_links.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/_links.java index f7b2a4d4..3c8277ef 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/bo/entity/_links.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/_links.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/controller/CbamController.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/controller/CbamController.java new file mode 100644 index 00000000..9578e75f --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/controller/CbamController.java @@ -0,0 +1,188 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.controller; + +import java.io.IOException; + +import org.apache.http.client.ClientProtocolException; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.bo.CatalogQueryVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMCreateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMOperExecutVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMOperExecutVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMQueryVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMScaleVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMScaleVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OperationExecution; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.ProblemDetails; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VnfInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.common.bo.AdaptorEnv; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonConstants; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.http.client.HttpRequestProcessor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.google.gson.Gson; + +@Controller +@RequestMapping(value = "/vnfm/lcm/v3") +public class CbamController { + private static final Logger logger = LogManager.getLogger("CbamController"); + @Autowired + private AdaptorEnv adaptorEnv; + + @Autowired + private HttpClientBuilder httpClientBuilder; + + private Gson gson = new Gson(); + + @RequestMapping(value = "/vnfs", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public CBAMCreateVnfResponse createVnf(CBAMInstantiateVnfRequest request) throws ClientProtocolException, IOException + { + CBAMCreateVnfResponse response = new CBAMCreateVnfResponse(); + String url=adaptorEnv.getCbamApiUriFront() + String.format(CommonConstants.CbamCreateVnfPath); + HttpRequestProcessor processor = new HttpRequestProcessor(httpClientBuilder, RequestMethod.GET); + + String responseStr = processor.process(url); + + logger.info("CbamMgmrImpl -> createVnf, responseStr is " + responseStr); + + CatalogQueryVnfResponse resp = gson.fromJson(responseStr, CatalogQueryVnfResponse.class); + + + return response; + } + @RequestMapping(value = "/vnfs/{vnfInstanceId}/instantiate", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public CBAMInstantiateVnfResponse initiateVnf(CBAMInstantiateVnfRequest request, @PathVariable("vnfInstanceId") String vnfInstanceId) throws ClientProtocolException, IOException + { + CBAMInstantiateVnfResponse response = new CBAMInstantiateVnfResponse(); + String url=adaptorEnv.getCbamApiUriFront() + String.format(CommonConstants.CbamInstantiateVnfPath,vnfInstanceId); + HttpRequestProcessor processor = new HttpRequestProcessor(httpClientBuilder, RequestMethod.GET); + + String responseStr = processor.process(url); + + logger.info("CbamMgmrImpl -> initiateVnf, responseStr is " + responseStr); + + CatalogQueryVnfResponse resp = gson.fromJson(responseStr, CatalogQueryVnfResponse.class); + + + return response; + } + + @RequestMapping(value = "/vnfs/{vnfInstanceId}/terminate", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public CBAMTerminateVnfResponse terminateVnf(CBAMTerminateVnfRequest request, @PathVariable("vnfInstanceId") String vnfInstanceId) throws ClientProtocolException, IOException + { + CBAMTerminateVnfResponse response = new CBAMTerminateVnfResponse(); + String url=adaptorEnv.getCbamApiUriFront() + String.format(CommonConstants.CbamTerminateVnfPath,vnfInstanceId); + HttpRequestProcessor processor = new HttpRequestProcessor(httpClientBuilder, RequestMethod.GET); + + String responseStr = processor.process(url); + + logger.info("CbamMgmrImpl -> terminateVnf, responseStr is " + responseStr); + + CatalogQueryVnfResponse resp = gson.fromJson(responseStr, CatalogQueryVnfResponse.class); + return response; + } + + @RequestMapping(value = "/vnfs/{vnfInstanceId}/scale", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public CBAMScaleVnfResponse scaleVnf(CBAMScaleVnfRequest request, @PathVariable("vnfInstanceId") String vnfInstanceId) throws ClientProtocolException, IOException + { + CBAMScaleVnfResponse response = new CBAMScaleVnfResponse(); + String url=adaptorEnv.getCbamApiUriFront() + String.format(CommonConstants.CbamScaleVnfPath,vnfInstanceId); + HttpRequestProcessor processor = new HttpRequestProcessor(httpClientBuilder, RequestMethod.GET); + + String responseStr = processor.process(url); + + logger.info("CbamMgmrImpl -> scaleVnf, responseStr is " + responseStr); + + CatalogQueryVnfResponse resp = gson.fromJson(responseStr, CatalogQueryVnfResponse.class); + return response; + } + + @RequestMapping(value = "/vnfs/{vnfInstanceId}/heal", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public CBAMHealVnfResponse healVnf(CBAMHealVnfRequest request, @PathVariable("vnfInstanceId") String vnfInstanceId) throws ClientProtocolException, IOException + { + CBAMHealVnfResponse response = new CBAMHealVnfResponse(); + String url=adaptorEnv.getCbamApiUriFront() + String.format(CommonConstants.CbamHealVnfPath,vnfInstanceId); + HttpRequestProcessor processor = new HttpRequestProcessor(httpClientBuilder, RequestMethod.GET); + + String responseStr = processor.process(url); + + logger.info("CbamMgmrImpl -> healVnf, responseStr is " + responseStr); + + CatalogQueryVnfResponse resp = gson.fromJson(responseStr, CatalogQueryVnfResponse.class); + return response; + } + + + @RequestMapping(value = "/vnfs/{vnfInstanceId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public CBAMQueryVnfResponse queryVnf(@PathVariable("vnfInstanceId") String vnfInstanceId) throws ClientProtocolException, IOException + { + CBAMQueryVnfResponse response = new CBAMQueryVnfResponse(); + String url=adaptorEnv.getCbamApiUriFront() + String.format(CommonConstants.CbamQueryVnfPath, vnfInstanceId); + HttpRequestProcessor processor = new HttpRequestProcessor(httpClientBuilder, RequestMethod.GET); + + String responseStr = processor.process(url); + + logger.info("CbamMgmrImpl -> queryVnfPackage, responseStr is " + responseStr); + + CatalogQueryVnfResponse resp = gson.fromJson(responseStr, CatalogQueryVnfResponse.class); + + + return response; + } + + + @RequestMapping(value = "/operation_executions/{operationExecutionId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public CBAMOperExecutVnfResponse operVnf(@PathVariable("operationExecutionId") String operationExecutionId) throws ClientProtocolException, IOException + { + CBAMOperExecutVnfResponse response = new CBAMOperExecutVnfResponse(); + String url=adaptorEnv.getCbamApiUriFront() + String.format(CommonConstants.CbamGetOperStatusPath,operationExecutionId); + HttpRequestProcessor processor = new HttpRequestProcessor(httpClientBuilder, RequestMethod.GET); + + String responseStr = processor.process(url); + + logger.info("CbamMgmrImpl -> operVnf, responseStr is " + responseStr); + + CatalogQueryVnfResponse resp = gson.fromJson(responseStr, CatalogQueryVnfResponse.class); + return response; + } + + + + +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/impl/CbamMgmrImpl.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/impl/CbamMgmrImpl.java index 50e265cd..bb56fc18 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/impl/CbamMgmrImpl.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/impl/CbamMgmrImpl.java @@ -14,40 +14,42 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.impl; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.impl; import java.io.IOException; import org.apache.http.client.ClientProtocolException; import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.json.JSONException; import org.json.JSONObject; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMCreateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMCreateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMQueryOperExecutionResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMQueryVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMScaleVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMScaleVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.inf.CbamMgmrInf; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.common.bo.AdaptorEnv; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonConstants; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.http.client.HttpRequestProcessor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.RequestMethod; import com.google.gson.Gson; -import com.nokia.vfcadaptor.cbam.bo.CBAMCreateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMCreateVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMHealVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMHealVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMInstantiateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMInstantiateVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMQueryVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMScaleVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMScaleVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMTerminateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMTerminateVnfResponse; -import com.nokia.vfcadaptor.cbam.inf.CbamMgmrInf; -import com.nokia.vfcadaptor.common.bo.AdaptorEnv; -import com.nokia.vfcadaptor.constant.CommonConstants; -import com.nokia.vfcadaptor.http.client.HttpRequestProcessor; @Component public class CbamMgmrImpl implements CbamMgmrInf { - private Logger logger = Logger.getLogger(CbamMgmrImpl.class); - + private static final Logger logger = LogManager.getLogger("CbamMgmrImpl"); private Gson gson = new Gson(); @Autowired @@ -56,9 +58,9 @@ public class CbamMgmrImpl implements CbamMgmrInf { @Autowired private HttpClientBuilder httpClientBuilder; - private String retrieveToken() throws ClientProtocolException, IOException { + private String retrieveToken() throws ClientProtocolException, IOException, JSONException { String result = null; - String url="https://" + adaptorEnv.getCbamIp() + CommonConstants.RetrieveCbamTokenPath; + String url= adaptorEnv.getCbamApiUriFront() + CommonConstants.RetrieveCbamTokenPath; HttpRequestProcessor processor = new HttpRequestProcessor(httpClientBuilder, RequestMethod.POST); processor.addHdeader(CommonConstants.ACCEPT, "*/*"); processor.addHdeader(CommonConstants.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE); @@ -128,9 +130,6 @@ public class CbamMgmrImpl implements CbamMgmrInf { logger.info("CbamMgmrImpl -> deleteVnf."); } - /* (non-Javadoc) - * @see com.nokia.vfcadaptor.cbam.impl.CbamMgmrInf#scaleVnf(com.nokia.vfcadaptor.cbam.bo.CBAMScaleVnfRequest, java.lang.String) - */ public CBAMScaleVnfResponse scaleVnf(CBAMScaleVnfRequest cbamRequest, String vnfInstanceId) throws ClientProtocolException, IOException { String httpPath = String.format(CommonConstants.CbamScaleVnfPath, vnfInstanceId); RequestMethod method = RequestMethod.POST; @@ -169,8 +168,14 @@ public class CbamMgmrImpl implements CbamMgmrInf { } public String operateCbamHttpTask(Object httpBodyObj, String httpPath, RequestMethod method) throws ClientProtocolException, IOException { - String token = retrieveToken(); - String url="https://" + adaptorEnv.getCbamIp() + httpPath; + String token = null; + try { + token = retrieveToken(); + } catch (JSONException e) { + logger.error("retrieveTokenError ", e); + } + + String url= adaptorEnv.getCbamApiUriFront() + httpPath; HttpRequestProcessor processor = new HttpRequestProcessor(httpClientBuilder, method); processor.addHdeader(CommonConstants.AUTHORIZATION, "bearer " + token); processor.addHdeader(CommonConstants.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE); @@ -181,5 +186,18 @@ public class CbamMgmrImpl implements CbamMgmrInf { return responseStr; } + + public CBAMQueryOperExecutionResponse queryOperExecution(String execId) throws ClientProtocolException, IOException{ + String httpPath = String.format(CommonConstants.CbamGetOperStatusPath, execId); + RequestMethod method = RequestMethod.GET; + + String responseStr = operateCbamHttpTask(null, httpPath, method); + + logger.info("CbamMgmrImpl -> CBAMQueryOperExecutionResponse, responseStr is " + responseStr); + + CBAMQueryOperExecutionResponse response = gson.fromJson(responseStr, CBAMQueryOperExecutionResponse.class); + + return response; + } } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/inf/CbamMgmrInf.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/inf/CbamMgmrInf.java index fe0f424c..9c4bc6cc 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/cbam/inf/CbamMgmrInf.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/inf/CbamMgmrInf.java @@ -14,23 +14,23 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.cbam.inf; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.inf; import java.io.IOException; import org.apache.http.client.ClientProtocolException; - -import com.nokia.vfcadaptor.cbam.bo.CBAMCreateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMCreateVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMHealVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMHealVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMInstantiateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMInstantiateVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMQueryVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMScaleVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMScaleVnfResponse; -import com.nokia.vfcadaptor.cbam.bo.CBAMTerminateVnfRequest; -import com.nokia.vfcadaptor.cbam.bo.CBAMTerminateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMCreateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMCreateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMQueryOperExecutionResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMQueryVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMScaleVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMScaleVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfResponse; public interface CbamMgmrInf { @@ -51,4 +51,6 @@ public interface CbamMgmrInf { public CBAMQueryVnfResponse queryVnf(String vnfInstanceId) throws ClientProtocolException, IOException; public void deleteVnf(String vnfInstanceId) throws ClientProtocolException, IOException; + + public CBAMQueryOperExecutionResponse queryOperExecution(String execId) throws ClientProtocolException, IOException; }
\ No newline at end of file diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/common/bo/AdaptorEnv.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/common/bo/AdaptorEnv.java index 6400d7f3..93454329 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/common/bo/AdaptorEnv.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/common/bo/AdaptorEnv.java @@ -14,85 +14,63 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.common.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.common.bo; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component public class AdaptorEnv { - private String nslcmIp; - private String nslcmPort; - - //for retrieving token - private String cbamIp; + @Value("${nslcmApiUriFront}") + private String nslcmApiUriFront; + @Value("${catalogApiUriFront}") + private String catalogApiUriFront; + @Value("${cbamApiUriFront}") + private String cbamApiUriFront; + //for retrieving token from CBAM + @Value("${grantType}") private String grantType; + @Value("${clientId}") private String clientId; + @Value("${clientSecret}") private String clientSecret; - private String catalogIp; - private String catalogPort; - - public String getCbamIp() { - return cbamIp; + public String getNslcmApiUriFront() { + return nslcmApiUriFront; } - - public void setCbamIp(String cbamIp) { - this.cbamIp = cbamIp; + public void setNslcmApiUriFront(String nslcmApiUriFront) { + this.nslcmApiUriFront = nslcmApiUriFront; + } + public String getCatalogApiUriFront() { + return catalogApiUriFront; + } + public void setCatalogApiUriFront(String catalogApiUriFront) { + this.catalogApiUriFront = catalogApiUriFront; + } + public String getCbamApiUriFront() { + return cbamApiUriFront; + } + public void setCbamApiUriFront(String cbamApiUriFront) { + this.cbamApiUriFront = cbamApiUriFront; } - public String getGrantType() { return grantType; } - public void setGrantType(String grantType) { this.grantType = grantType; } - public String getClientId() { return clientId; } - public void setClientId(String clientId) { this.clientId = clientId; } - public String getClientSecret() { return clientSecret; } - public void setClientSecret(String clientSecret) { this.clientSecret = clientSecret; } - - public String getCatalogIp() { - return catalogIp; - } - - public void setCatalogIp(String catalogIp) { - this.catalogIp = catalogIp; - } - - public String getCatalogPort() { - return catalogPort; - } - - public void setCatalogPort(String catalogPort) { - this.catalogPort = catalogPort; - } - - public String getNslcmIp() { - return nslcmIp; - } - - public void setNslcmIp(String nslcmIp) { - this.nslcmIp = nslcmIp; - } - - public String getNslcmPort() { - return nslcmPort; - } - - public void setNslcmPort(String nslcmPort) { - this.nslcmPort = nslcmPort; - } - } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/common/bo/KeyValuePair.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/common/bo/KeyValuePair.java index c883d932..0d5ee831 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/common/bo/KeyValuePair.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/common/bo/KeyValuePair.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.common.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.common.bo; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/constant/CommonConstants.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/CommonConstants.java index c4a9d4a8..c145e28c 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/constant/CommonConstants.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/CommonConstants.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.constant; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.constant; public class CommonConstants { public static final String HTTP_ERROR_DESC_500 = "Internal Server Error"; @@ -49,9 +49,12 @@ public class CommonConstants { public static final String CbamHealVnfPath="/vnfs/%s/heal"; public static final String NSLCM_OPERATION_INSTANTIATE = "Instantiate"; + public static final String NSLCM_OPERATION_TERMINATE = "Terminal"; public static final String NSLCM_OPERATION_SCALE_OUT = "Scaleout"; public static final String NSLCM_OPERATION_SCALE_IN = "Scalein"; public static final String NSLCM_OPERATION_SCALE_UP = "Scaleup"; public static final String NSLCM_OPERATION_SCALE_DOWN = "Scaledown"; - public static final String NSLCM_OPERATION_SCALE_TERMINATE = "Terminal"; + + public static final String CBAM_OPERATION_STATUS_START = "start"; + public static final String CBAM_OPERATION_STATUS_FINISH = "finished"; } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/constant/CommonEnum.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/CommonEnum.java index dcf1b4b3..cbb94b94 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/constant/CommonEnum.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/CommonEnum.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.constant; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.constant; public class CommonEnum { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/db/bean/ResourceType.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/db/bean/ResourceType.java new file mode 100644 index 00000000..afb726c3 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/db/bean/ResourceType.java @@ -0,0 +1,24 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.vfc.nfvo.driver.vnfm.svnfm.db.bean; + +public enum ResourceType { + VDU, + VL, + CP, + Storage +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/beans/VnfmJobExecutionInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/db/bean/VnfmJobExecutionInfo.java index ad95b1ff..9c53c516 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/beans/VnfmJobExecutionInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/db/bean/VnfmJobExecutionInfo.java @@ -14,9 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.beans; - -import java.io.Serializable; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.db.bean; import javax.persistence.Column; import javax.persistence.Entity; @@ -28,7 +26,7 @@ import javax.persistence.Table; @Entity @Table(name = "vnfm_job_execution_record") -public class VnfmJobExecutionInfo implements Serializable{ +public class VnfmJobExecutionInfo{ private static final long serialVersionUID = -2880159539002942812L; @Id @@ -87,5 +85,19 @@ public class VnfmJobExecutionInfo implements Serializable{ this.status = status; } + @Override + public String toString() + { + return " VnfmJobRecord: [ " + + super.toString() + + ", jobId = " + jobId + + ", vnfInstanceId = " + vnfInstanceId + + ", vnfmExecutionId = " + vnfmExecutionId + + ", vnfmInterfceName = " + vnfmInterfceName + + ", status = " + status + + "]"; + + } + } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/beans/VnfmResourceInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/db/bean/VnfmResourceInfo.java index d969428f..b245f2b8 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/beans/VnfmResourceInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/db/bean/VnfmResourceInfo.java @@ -14,13 +14,17 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.beans; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.db.bean; +import javax.persistence.Entity; import javax.persistence.Column; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.Table; +@Entity +@Table(name = "vnfm_resource_record") public class VnfmResourceInfo { @Id @GeneratedValue(strategy = GenerationType.AUTO) diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/db/repository/VnfmJobExecutionRepository.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/db/repository/VnfmJobExecutionRepository.java new file mode 100644 index 00000000..a499f452 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/db/repository/VnfmJobExecutionRepository.java @@ -0,0 +1,23 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.vfc.nfvo.driver.vnfm.svnfm.db.repository; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.db.bean.VnfmJobExecutionInfo; +import org.springframework.data.repository.CrudRepository; + +public interface VnfmJobExecutionRepository extends CrudRepository< VnfmJobExecutionInfo, Long> { + +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/db/repository/VnfmResourceRepository.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/db/repository/VnfmResourceRepository.java new file mode 100644 index 00000000..52d41927 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/db/repository/VnfmResourceRepository.java @@ -0,0 +1,23 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.vfc.nfvo.driver.vnfm.svnfm.db.repository; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.db.bean.VnfmResourceInfo; +import org.springframework.data.repository.CrudRepository; + +public interface VnfmResourceRepository extends CrudRepository<VnfmResourceInfo, Integer> { + +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/exception/VnfmDriverException.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/exception/VnfmDriverException.java index 9ce9f09d..8a465435 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/exception/VnfmDriverException.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/exception/VnfmDriverException.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.exception; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.exception; public class VnfmDriverException extends RuntimeException{ private static final long serialVersionUID = 14325435432545L; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/http/client/HttpClientUtils.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientUtils.java index f00b5664..e3ed0c82 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/http/client/HttpClientUtils.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.http.client; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.http.client; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; @@ -36,12 +36,15 @@ import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.http.ssl.SSLContextBuilder; import org.apache.http.ssl.TrustStrategy; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.context.annotation.Bean; import org.springframework.web.bind.annotation.RequestMethod; public class HttpClientUtils { - private final static Logger logger = Logger.getLogger(HttpClientUtils.class); + private static final Logger logger = LogManager.getLogger("HttpClientUtils"); + @Bean public static HttpClientBuilder createHttpClientBuilder() { HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/http/client/HttpRequestProcessor.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpRequestProcessor.java index 0e8903a8..b2414a52 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/http/client/HttpRequestProcessor.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpRequestProcessor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.http.client; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.http.client; import java.io.IOException; import java.net.URI; @@ -28,10 +28,9 @@ import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.util.EntityUtils; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonConstants; import org.springframework.web.bind.annotation.RequestMethod; -import com.nokia.vfcadaptor.constant.CommonConstants; - public class HttpRequestProcessor { private CloseableHttpClient httpClient; private HttpRequestBase httpRequest; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/NslcmGrantVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/NslcmGrantVnfRequest.java index b6d1f92f..c441cee6 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/NslcmGrantVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/NslcmGrantVnfRequest.java @@ -14,23 +14,21 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo; import java.util.List; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.common.bo.KeyValuePair; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.ResourceDefinition; + import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.common.bo.KeyValuePair; -import com.nokia.vfcadaptor.constant.CommonEnum; -import com.nokia.vfcadaptor.nslcm.bo.entity.ResourceDefinition; public class NslcmGrantVnfRequest { @JsonProperty("vnfInstanceId") private String vnfInstanceId; - @JsonProperty("vnfDescriptorId") - private String vnfDescriptorId; - @JsonProperty("lifecycleOperation") private CommonEnum.LifecycleOperation lifecycleOperation; @@ -54,13 +52,6 @@ public class NslcmGrantVnfRequest { this.vnfInstanceId = vnfInstanceId; } - public String getVnfDescriptorId() { - return vnfDescriptorId; - } - - public void setVnfDescriptorId(String vnfDescriptorId) { - this.vnfDescriptorId = vnfDescriptorId; - } public CommonEnum.LifecycleOperation getLifecycleOperation() { return lifecycleOperation; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/NslcmGrantVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/NslcmGrantVnfResponse.java index f4169c63..b5f0fec1 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/NslcmGrantVnfResponse.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/NslcmGrantVnfResponse.java @@ -13,14 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo; import java.util.List; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.ResourceDefinition; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.VimAssets; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.VimInfo; + import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.nslcm.bo.entity.ResourceDefinition; -import com.nokia.vfcadaptor.nslcm.bo.entity.VimAssets; -import com.nokia.vfcadaptor.nslcm.bo.entity.VimInfo; public class NslcmGrantVnfResponse { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/NslcmNotifyLCMEventsRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/NslcmNotifyLCMEventsRequest.java index 9552cd81..bdfdf848 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/NslcmNotifyLCMEventsRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/NslcmNotifyLCMEventsRequest.java @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.AffectedVirtualLink; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.AffectedVirtualStorage; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.AffectedVnfc; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.constant.CommonEnum; -import com.nokia.vfcadaptor.nslcm.bo.entity.AffectedVirtualLink; -import com.nokia.vfcadaptor.nslcm.bo.entity.AffectedVirtualStorage; -import com.nokia.vfcadaptor.nslcm.bo.entity.AffectedVnfc; public class NslcmNotifyLCMEventsRequest { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/VnfmInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/VnfmInfo.java index 1d0d295e..bf6608df 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/VnfmInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/VnfmInfo.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/AccessInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/AccessInfo.java index 2d550227..ae89c82a 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/AccessInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/AccessInfo.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/AffectedVirtualLink.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/AffectedVirtualLink.java index 28020ed0..fc1ab047 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/AffectedVirtualLink.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/AffectedVirtualLink.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.constant.CommonEnum; public class AffectedVirtualLink { @JsonProperty("vlInstanceId") diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/AffectedVirtualStorage.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/AffectedVirtualStorage.java index 5080d4e0..6139adb8 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/AffectedVirtualStorage.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/AffectedVirtualStorage.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/AffectedVnfc.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/AffectedVnfc.java index 5f1fea01..e30f1513 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/AffectedVnfc.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/AffectedVnfc.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.constant.CommonEnum; public class AffectedVnfc { @JsonProperty("vnfcInstanceId") diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/GrantInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/GrantInfo.java index 47b41f97..cb6a255f 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/GrantInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/GrantInfo.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/InterfaceInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/InterfaceInfo.java index b0a348ee..213bddd5 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/InterfaceInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/InterfaceInfo.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/ResourceDefinition.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/ResourceDefinition.java index 9b18b007..4a10ae99 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/ResourceDefinition.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/ResourceDefinition.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.constant.CommonEnum; public class ResourceDefinition { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/ResourceHandle.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/ResourceHandle.java index ce7f9ccb..72d3dbc3 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/ResourceHandle.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/ResourceHandle.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.constant.CommonEnum; public class ResourceHandle { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/VimAssets.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/VimAssets.java index 65ce3cfd..041e6413 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/VimAssets.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/VimAssets.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/VimComputeResourceFlavour.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/VimComputeResourceFlavour.java index ae27dd99..38b2e183 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/VimComputeResourceFlavour.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/VimComputeResourceFlavour.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/VimInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/VimInfo.java index ef734a23..8bb63490 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/VimInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/VimInfo.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/VimSoftwareImage.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/VimSoftwareImage.java index 5aba7761..a4f24a70 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/VimSoftwareImage.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/VimSoftwareImage.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/VnfPackageInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/VnfPackageInfo.java index 1793b148..53f80c1d 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/bo/entity/VnfPackageInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/bo/entity/VnfPackageInfo.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.constant.CommonEnum; public class VnfPackageInfo { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/impl/NslcmMgmrImpl.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/impl/NslcmMgmrImpl.java index e5b8180b..94be8d21 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/impl/NslcmMgmrImpl.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/impl/NslcmMgmrImpl.java @@ -14,31 +14,32 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.impl; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.impl; import java.io.IOException; import org.apache.http.client.ClientProtocolException; import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.common.bo.AdaptorEnv; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonConstants; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.http.client.HttpRequestProcessor; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmNotifyLCMEventsRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.VnfmInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.inf.NslcmMgmrInf; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.RequestMethod; import com.google.gson.Gson; -import com.nokia.vfcadaptor.common.bo.AdaptorEnv; -import com.nokia.vfcadaptor.constant.CommonConstants; -import com.nokia.vfcadaptor.http.client.HttpRequestProcessor; -import com.nokia.vfcadaptor.nslcm.bo.NslcmGrantVnfRequest; -import com.nokia.vfcadaptor.nslcm.bo.NslcmGrantVnfResponse; -import com.nokia.vfcadaptor.nslcm.bo.NslcmNotifyLCMEventsRequest; -import com.nokia.vfcadaptor.nslcm.bo.VnfmInfo; -import com.nokia.vfcadaptor.nslcm.inf.NslcmMgmrInf; @Component public class NslcmMgmrImpl implements NslcmMgmrInf{ - private Logger logger = Logger.getLogger(NslcmMgmrImpl.class); + private static final Logger logger = LogManager.getLogger("NslcmMgmrImpl"); @Autowired private AdaptorEnv adaptorEnv; @@ -83,7 +84,7 @@ public class NslcmMgmrImpl implements NslcmMgmrInf{ } public String operateNslcmHttpTask(Object httpBodyObj, String httpPath, RequestMethod method) throws ClientProtocolException, IOException { - String url="http://" + adaptorEnv.getNslcmIp() + ":" + adaptorEnv.getNslcmPort() + httpPath; + String url=adaptorEnv.getNslcmApiUriFront() + httpPath; HttpRequestProcessor processor = new HttpRequestProcessor(httpClientBuilder, method); processor.addHdeader(CommonConstants.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE); diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/inf/NslcmMgmrInf.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/inf/NslcmMgmrInf.java index 98e27858..ca7fa449 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/nslcm/inf/NslcmMgmrInf.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/inf/NslcmMgmrInf.java @@ -14,16 +14,15 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.nslcm.inf; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.inf; import java.io.IOException; import org.apache.http.client.ClientProtocolException; - -import com.nokia.vfcadaptor.nslcm.bo.NslcmGrantVnfRequest; -import com.nokia.vfcadaptor.nslcm.bo.NslcmGrantVnfResponse; -import com.nokia.vfcadaptor.nslcm.bo.NslcmNotifyLCMEventsRequest; -import com.nokia.vfcadaptor.nslcm.bo.VnfmInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmNotifyLCMEventsRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.VnfmInfo; public interface NslcmMgmrInf { public VnfmInfo queryVnfm(String vnfmId) throws ClientProtocolException, IOException; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/HealVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/HealVnfRequest.java index 45dc5ed6..bdf55b46 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/HealVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/HealVnfRequest.java @@ -14,10 +14,11 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.Affectedvm; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.vnfmdriver.bo.entity.Affectedvm; public class HealVnfRequest { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/HealVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/HealVnfResponse.java index f2ec9e78..65e9f89a 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/HealVnfResponse.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/HealVnfResponse.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/InstantiateVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/InstantiateVnfRequest.java index 267288d3..6f1325d3 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/InstantiateVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/InstantiateVnfRequest.java @@ -13,18 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo; -import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonIdentityInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.AdditionalParam; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.ExtVirtualLinkData; + import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.ObjectIdGenerators; -import com.nokia.vfcadaptor.vnfmdriver.bo.entity.AdditionalParam; -import com.nokia.vfcadaptor.vnfmdriver.bo.entity.ExtVirtualLinkData; //@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class,property = "@id") // -- zhouyufei added property id cause problem -- 415 Unsupported Media Type (UTF-8 is not supported) diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/InstantiateVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/InstantiateVnfResponse.java index c84cde2c..ea1a1902 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/InstantiateVnfResponse.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/InstantiateVnfResponse.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/OperStatusVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/OperStatusVnfRequest.java index aa663c80..5c140357 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/OperStatusVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/OperStatusVnfRequest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo; public class OperStatusVnfRequest { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/OperStatusVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/OperStatusVnfResponse.java index 2d84b21b..9f96bd38 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/OperStatusVnfResponse.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/OperStatusVnfResponse.java @@ -14,10 +14,11 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.ResponseDescriptor; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.vnfmdriver.bo.entity.ResponseDescriptor; public class OperStatusVnfResponse { @JsonProperty("jobId") diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/QueryVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/QueryVnfRequest.java index c693adfb..ce29605c 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/QueryVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/QueryVnfRequest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/QueryVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/QueryVnfResponse.java index 7e3b462d..27645149 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/QueryVnfResponse.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/QueryVnfResponse.java @@ -1,4 +1,3 @@ - /* * Copyright 2016-2017, Nokia Corporation * @@ -14,13 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.vnfmdriver.bo.entity.VnfInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.VnfInfo; -public class QueryVnfResponse { - @JsonProperty("vnfInfo") +public class QueryVnfResponse extends VnfInfo { + /*@JsonProperty("vnfInfo") private VnfInfo vnfInfo; @@ -30,7 +28,7 @@ public class QueryVnfResponse { public void setVnfInfo(VnfInfo vnfInfo) { this.vnfInfo = vnfInfo; - } + }*/ } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/ScaleVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/ScaleVnfRequest.java index 396d2aaf..536af321 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/ScaleVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/ScaleVnfRequest.java @@ -14,11 +14,12 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.AdditionalParam; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.constant.CommonEnum; -import com.nokia.vfcadaptor.vnfmdriver.bo.entity.AdditionalParam; public class ScaleVnfRequest { @JsonProperty("vnfInstanceId") diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/ScaleVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/ScaleVnfResponse.java index 4b05b9b9..5fdf9854 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/ScaleVnfResponse.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/ScaleVnfResponse.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/TerminateVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/TerminateVnfRequest.java index 24963392..45acab42 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/TerminateVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/TerminateVnfRequest.java @@ -14,10 +14,11 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.constant.CommonEnum; public class TerminateVnfRequest { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/TerminateVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/TerminateVnfResponse.java index 143fdf58..a015abee 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/TerminateVnfResponse.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/TerminateVnfResponse.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/AccessInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/AccessInfo.java index 83cbde44..2f10c7e4 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/AccessInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/AccessInfo.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/AdditionalParam.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/AdditionalParam.java index 3e3c25f8..8d1f44ed 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/AdditionalParam.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/AdditionalParam.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity; public class AdditionalParam { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/Affectedvm.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/Affectedvm.java index 898404d9..b4841305 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/Affectedvm.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/Affectedvm.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/ExtVirtualLinkData.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/ExtVirtualLinkData.java index 7c52c5b1..3cbc9020 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/ExtVirtualLinkData.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/ExtVirtualLinkData.java @@ -13,10 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; public class ExtVirtualLinkData { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/InterfaceInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/InterfaceInfo.java index b9464127..f046aa66 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/InterfaceInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/InterfaceInfo.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/ResponseDescriptor.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/ResponseDescriptor.java index 197d466f..e1b8f967 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/ResponseDescriptor.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/ResponseDescriptor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity; import java.util.List; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/ResponseHistoryList.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/ResponseHistoryList.java index 5863985d..b9bbd6c4 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/ResponseHistoryList.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/ResponseHistoryList.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/VimInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/VimInfo.java index ea9a687f..bd4e9d7a 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/VimInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/VimInfo.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/VnfInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/VnfInfo.java index 543f805d..01191f67 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/bo/entity/VnfInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/entity/VnfInfo.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.bo.entity; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; import com.fasterxml.jackson.annotation.JsonProperty; -import com.nokia.vfcadaptor.constant.CommonEnum; public class VnfInfo { @JsonProperty("vnfInstanceId") diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/controller/VnfmDriverController.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/controller/VnfmDriverController.java index ba2641b5..a3aee38e 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/controller/VnfmDriverController.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/controller/VnfmDriverController.java @@ -14,14 +14,27 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.controller; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.controller; import java.io.IOException; import javax.servlet.http.HttpServletResponse; import org.apache.http.HttpStatus; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.exception.VnfmDriverException; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.HealVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.HealVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.InstantiateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.InstantiateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.OperStatusVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.QueryVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.ScaleVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.ScaleVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.TerminateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.TerminateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.inf.VnfmDriverMgmrInf; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; @@ -32,23 +45,11 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.google.gson.Gson; -import com.nokia.vfcadaptor.exception.VnfmDriverException; -import com.nokia.vfcadaptor.vnfmdriver.bo.HealVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.HealVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.InstantiateVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.InstantiateVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.OperStatusVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.QueryVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.ScaleVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.ScaleVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.TerminateVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.TerminateVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.inf.VnfmDriverMgmrInf; @Controller @RequestMapping(value = "/nokiavnfm/v1") public class VnfmDriverController { - private Logger logger = Logger.getLogger(VnfmDriverController.class); + private static final Logger logger = LogManager.getLogger("VnfmDriverController"); @Autowired private VnfmDriverMgmrInf vnfmDriverMgmr; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/inf/VnfmDriverMgmrInf.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/inf/VnfmDriverMgmrInf.java index 833712a0..01e7155f 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/com/nokia/vfcadaptor/vnfmdriver/inf/VnfmDriverMgmrInf.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/inf/VnfmDriverMgmrInf.java @@ -14,19 +14,19 @@ * limitations under the License. */ -package com.nokia.vfcadaptor.vnfmdriver.inf; - -import com.nokia.vfcadaptor.exception.VnfmDriverException; -import com.nokia.vfcadaptor.vnfmdriver.bo.HealVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.HealVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.InstantiateVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.InstantiateVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.OperStatusVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.QueryVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.ScaleVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.ScaleVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.TerminateVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.TerminateVnfResponse; +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.inf; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.exception.VnfmDriverException; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.HealVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.HealVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.InstantiateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.InstantiateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.OperStatusVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.QueryVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.ScaleVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.ScaleVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.TerminateVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.TerminateVnfResponse; public interface VnfmDriverMgmrInf { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/ProxoolConf.xml b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/ProxoolConf.xml deleted file mode 100644 index 1c58dcdc..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/ProxoolConf.xml +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - 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. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> -<something-else-entirely> - <proxool> - - <alias>proxoolPool</alias> - <driver-url>jdbc:mysql://135.251.208.57:3306/aware_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=round -<!-- <driver-url>jdbc:mysql://10.134.120.95:3306/aware_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=round --> - - </driver-url> - <driver-class>com.mysql.jdbc.Driver</driver-class> - <driver-properties> - <property name="user" value="root" /> - <property name="password" value="irlaxjwrMLu03MNgih6czpllxKgnfk" /> - <property name="autoReconnect" value="true" /> - </driver-properties> - - <house-keeping-sleep-time>2700000</house-keeping-sleep-time> - <simultaneous-build-throttle>100</simultaneous-build-throttle> - <!-- - <maximum-new-connections>5</maximum-new-connections> - --> - <prototype-count>5</prototype-count> - <maximum-connection-count>50</maximum-connection-count> - - <maximum-active-time>2700000</maximum-active-time> - <maximum-connection-lifetime>7200000</maximum-connection-lifetime> - - <minimum-connection-count>2</minimum-connection-count> - <test-before-use>true</test-before-use> - <!-- - <test-after-use>true</test-after-use> - --> - <trace>true</trace> - <house-keeping-test-sql>select CURRENT_DATE from dual - </house-keeping-test-sql> - - </proxool> -</something-else-entirely>
\ No newline at end of file diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/application.properties b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/application.properties new file mode 100644 index 00000000..0ae1288c --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/application.properties @@ -0,0 +1,45 @@ +############################################################################### +# Copyright 2016, Nokia Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################### + +server.error.whitelabel.enabled=false +## for MySql Database begin ## +spring.datasource.url=jdbc:mysql://135.251.208.57:5029/aware_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=round +spring.datasource.username=root +spring.datasource.password=123456 + +spring.datasource.driver-class-name=com.mysql.jdbc.Driver +spring.datasource.tomcat.max-wait=30000 +spring.datasource.tomcat.max-active=50 +spring.datasource.tomcat.test-on-borrow=true +## for MySql Database end ## + +## for logging begin ## +com.fasterxml.jackson.core=jackson-databind +logging.file=D:/VfcadaptorApplication.log +logging.level.org.springframework.web=DEBUG +logging.level.org.hibernate=ERROR +## for logging end ## + +## common configuration for connections begin ## +nslcmApiHttpFront=http://1.2.3.4:88 +catalogApiUriFront=http://1.2.6.7:88 +cbamApiUriFront=https://1.2.5.4:88 + +## for retrieving token from CBAM ## +grantType=grantType1 +clientId=clientId1 +clientSecret=clientSecret1 +## common configuration for connections end ##
\ No newline at end of file diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/config.properties b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/config.properties deleted file mode 100644 index ad3ba369..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/config.properties +++ /dev/null @@ -1,27 +0,0 @@ -############################################################################### -# Copyright 2016, Nokia Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -############################################################################### - -nslcmIp=1.2.3.4 -nslcmPort=88 - -catalogIp=1.2.3.4 -catalogPort=88 - -cbamIp=2.3.4.5 - -grant_type=lient_credentials -client_id=frontend -client_secret=secret
\ No newline at end of file diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/hdm/vnfm_job_execution_map.hbm.xml b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/hdm/vnfm_job_execution_map.hbm.xml deleted file mode 100644 index 0977b94c..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/hdm/vnfm_job_execution_map.hbm.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0"?> -<!-- - 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. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> -<!DOCTYPE hibernate-mapping PUBLIC - "-//Hibernate/Hibernate Mapping DTD 3.0//EN" - "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping> - <class name="com.nokia.vfcadaptor.beans.VnfmJobExecutioInfo" table="vnfm_job_execution_record" dynamic-update="true" lazy="true"> - <id name="jobId" column="jobId" /> - - <property name="vnfInstanceId" column="vnfInstanceId"/> - <property name="vnfmExecutionId" column="vnfmExecutionId"/> - - <property name="vnfmInterfceName" column="vnfmInterfceName"/> - <property name="status" column="status"/> - - </class> -</hibernate-mapping>
\ No newline at end of file diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/hdm/vnfm_resource_record.hbm.xml b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/hdm/vnfm_resource_record.hbm.xml deleted file mode 100644 index c1e279e9..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/hdm/vnfm_resource_record.hbm.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0"?> -<!-- - 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. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> -<!DOCTYPE hibernate-mapping PUBLIC - "-//Hibernate/Hibernate Mapping DTD 3.0//EN" - "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping> - <class name="com.nokia.vfcadaptor.beans.VnfmResourceInfo" table="vnfm_resource_record" dynamic-update="true" lazy="true"> - <id name="id" column="id" /> - - <property name="type" column="type"/> - <property name="resourceDefinitionId" column="resourceDefinitionId"/> - <property name="vdu" column="vdu"/> - <property name="status" column="status"/> - - </class> -</hibernate-mapping>
\ No newline at end of file diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/log4j.properties b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/log4j.properties deleted file mode 100644 index 41230be3..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/log4j.properties +++ /dev/null @@ -1,33 +0,0 @@ -############################################################################### -# Copyright 2016, Nokia Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -############################################################################### -log4j.rootLogger=info, stdout, R -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout - -# Pattern to output the caller's file name and line number. -log4j.appender.stdout.layout.ConversionPattern=%5p %d [%t] (%F:%L) - %m%n - -log4j.appender.R=org.apache.log4j.RollingFileAppender -log4j.appender.R.File=D:/tmp/vnfmdriver.log -log4j.appender.R.MaxFileSize= 10MB - -# Keep one backup file -log4j.appender.R.MaxBackupIndex=5 - -log4j.appender.R.layout=org.apache.log4j.PatternLayout -log4j.appender.R.layout.ConversionPattern=%5p %d [%t] (%F:%L) - %m%n - - diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/webapp/WEB-INF/applicationContext-hibernate.xml b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/webapp/WEB-INF/applicationContext-hibernate.xml deleted file mode 100644 index 08a34c58..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/webapp/WEB-INF/applicationContext-hibernate.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" -"http://www.springframework.org/dtd/spring-beans.dtd"> -<beans> - - <bean id="sessionFactory" - class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> - <property name="hibernateProperties"> - <props> - <prop key="hibernate.dialect"> - org.hibernate.dialect.MySQLDialect - </prop> - <prop key="hibernate.show_sql">false</prop> - <prop key="hibernate.jdbc.batch_size">100</prop> - <!--<prop key="hibernate.connection.autocommit">false</prop>--> - <prop key="hibernate.connection.autocommit">true</prop> - <prop key="hibernate.proxool.pool_alias">proxoolPool</prop> - <prop key="hibernate.proxool.xml">ProxoolConf.xml</prop> - <prop key="hibernate.connection.provider_class">org.hibernate.connection.ProxoolConnectionProvider</prop> - <prop key="hibernate.cache.provider_class"> - org.hibernate.cache.HashtableCacheProvider - </prop> - <prop key="hibernate.connection.release_mode">after_transaction</prop> - </props> - </property> - - <!-- mappingResources属性用来列出全部映射文件 --> - <property name="mappingResources"> - <list> - <!-- 配置所有PO映射文件 --> - <value>hbm/vnfm_job_execution_map.hbm.xml</value> - </list> - </property> - </bean> - <!-- 事务管理器 --> - <bean id="transactionManager" - class="org.springframework.orm.hibernate4.HibernateTransactionManager"> - <property name="sessionFactory"> - <ref local="sessionFactory" /> - </property> - </bean> - -</beans>
\ No newline at end of file diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/webapp/WEB-INF/mvc-servlet.xml b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/webapp/WEB-INF/mvc-servlet.xml deleted file mode 100644 index f26ce071..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/webapp/WEB-INF/mvc-servlet.xml +++ /dev/null @@ -1,100 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - 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. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:context="http://www.springframework.org/schema/context" - xmlns:mvc="http://www.springframework.org/schema/mvc" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-4.3.xsd - http://www.springframework.org/schema/mvc - http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd - http://www.springframework.org/schema/context - http://www.springframework.org/schema/context/spring-context-4.3.xsd" - - default-lazy-init="true"> - - <bean id="propertyConfigurer" - class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> - <property name="location" value="classpath:config.properties"/> - </bean> - - <bean id="adaptorEnv" class="com.nokia.vfcadaptor.common.bo.AdaptorEnv" scope="singleton" > - <property name = "nslcmIp" value="${nslcmIp}" /> - <property name = "nslcmPort" value="${nslcmPort}" /> - <property name = "catalogIp" value="${catalogIp}" /> - <property name = "catalogPort" value="${catalogPort}" /> - <property name = "cbamIp" value="${cbamIp}" /> - <property name = "grantType" value="${grant_type}" /> - <property name = "clientId" value="${client_id}" /> - <property name = "clientSecret" value="${client_secret}" /> - </bean> - - <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/> - - <bean name = "httpClientBuilder" class="com.nokia.vfcadaptor.http.client.HttpClientUtils" factory-method="createHttpClientBuilder"/> - - <context:component-scan base-package="com.nokia.vfcadaptor" /> - - <!-- 将StringHttpMessageCOnverter的默认编码设为UTF-8 --> - <mvc:annotation-driven> - <mvc:message-converters register-defaults="true"> - <bean class="org.springframework.http.converter.StringHttpMessageConverter"> - <constructor-arg value="UTF-8" /> - </bean> - </mvc:message-converters> - </mvc:annotation-driven> - - <!-- public part end --> - - <bean id="sessionFactory" - class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> - <property name="hibernateProperties"> - <props> - <prop key="hibernate.dialect"> - org.hibernate.dialect.MySQLDialect - </prop> - <prop key="hibernate.show_sql">false</prop> - <prop key="hibernate.jdbc.batch_size">100</prop> - <!--<prop key="hibernate.connection.autocommit">false</prop>--> - <prop key="hibernate.connection.autocommit">true</prop> - <prop key="hibernate.proxool.pool_alias">proxoolPool</prop> - <prop key="hibernate.proxool.xml">ProxoolConf.xml</prop> - <prop key="hibernate.connection.provider_class">org.hibernate.connection.ProxoolConnectionProvider</prop> - <prop key="hibernate.cache.provider_class"> - org.hibernate.cache.HashtableCacheProvider - </prop> - <prop key="hibernate.connection.release_mode">after_transaction</prop> - </props> - </property> - - <!-- mappingResources属性用来列出全部映射文件 --> - <property name="mappingResources"> - <list> - <!-- 配置所有PO映射文件 --> - <value>hbm/vnfm_job_execution_map.hbm.xml</value> - </list> - </property> - </bean> - <!-- 事务管理器 --> - <bean id="transactionManager" - class="org.springframework.orm.hibernate3.HibernateTransactionManager"> - <property name="sessionFactory"> - <ref local="sessionFactory" /> - </property> - </bean> - -</beans> diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/webapp/WEB-INF/web.xml b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/webapp/WEB-INF/web.xml index 124ec37e..e6aa9856 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/webapp/WEB-INF/web.xml +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/webapp/WEB-INF/web.xml @@ -1,68 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> - <!-- - 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. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> -<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns="http://java.sun.com/xml/ns/javaee" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" - version="3.0"> - <display-name>vfcadaptor</display-name> - - <filter> - <filter-name>CharacterEncoding</filter-name> - <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> - <init-param> - <param-name>encoding</param-name> - <param-value>UTF-8</param-value> - </init-param> - <init-param> - <param-name>forceEncoding</param-name> - <param-value>true</param-value> - </init-param> - </filter> - - <filter-mapping> - <filter-name>CharacterEncoding</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - <!-- 设置servlet编码结束 --> -<!-- - <context-param> - <param-name>contextConfigLocation</param-name> - <param-value> - classpath:WEB-INF/applicationContext-hibernate.xml - </param-value> - </context-param> ---> - <servlet> - <servlet-name>springservlet</servlet-name> - <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> - <init-param> - <param-name>contextConfigLocation</param-name> - <param-value>/WEB-INF/mvc-servlet.xml</param-value> - </init-param> - <load-on-startup>1</load-on-startup> - </servlet> - <servlet-mapping> - <servlet-name>springservlet</servlet-name> - <url-pattern>/</url-pattern> - </servlet-mapping> +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> + <display-name>vfcadaptorsrc</display-name> - <session-config> - <session-timeout>60</session-timeout> - </session-config> + <!-- + <context-param> + <param-name>contextConfigLocation</param-name> + <param-value>/WEB-INF/spring/application-context.xml</param-value> + </context-param> + <listener> + <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> + </listener> +--> <welcome-file-list> <welcome-file>index.html</welcome-file> diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/com/nokia/vfcadaptor/http/client/HttpRequestProcessorTest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/com/nokia/vfcadaptor/http/client/HttpRequestProcessorTest.java deleted file mode 100644 index 61367505..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/com/nokia/vfcadaptor/http/client/HttpRequestProcessorTest.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nokia.vfcadaptor.http.client; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.security.KeyManagementException; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; - -import org.apache.http.client.ClientProtocolException; -import org.apache.http.impl.client.HttpClientBuilder; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; -import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.context.WebApplicationContext; - -import com.google.gson.Gson; -import com.nokia.vfcadaptor.vnfmdriver.bo.InstantiateVnfRequest; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(locations={"file:src/main/webapp/WEB-INF/mvc-servlet.xml"}) -@WebAppConfiguration -public class HttpRequestProcessorTest { - private String url; - private String basicUrl="http://localhost:8080/NvfmDriver/api/nokiavnfm/v1"; - private String funcPath; - - private Gson gson = new Gson(); - - @Autowired - private WebApplicationContext wac; - private MockMvc mockMvc; - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); //MockMvc - } - - @Test - public void testP() - { - String message = "{\"vnfInstanceName\":\"vnfInstanceName_001\",\"vnfPackageId\":\"1\"}"; - InstantiateVnfRequest request = gson.fromJson(message, InstantiateVnfRequest.class); - - System.out.println("vnfInstanceName = " + request.getVnfInstanceName()); - - String result; - try { - result = mockMvc.perform(MockMvcRequestBuilders.post("/nokiavnfm/v1/vnfmId_001/vnfs") - .contentType(MediaType.APPLICATION_JSON).content(message) - .accept(MediaType.APPLICATION_JSON)) //ִ - .andReturn().getResponse().getContentAsString(); - System.out.println("result = " + result); - } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - - } -// -// @Test -// public void testProcess() throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException, ClientProtocolException, IOException -// { -// funcPath = "/vnfmId_001/vnfs"; -// url = basicUrl + funcPath; -// String message = "{\"vnfInstanceName\":\"vnfInstanceName_001\",\"vnfPackageId\":\"1\"}"; -// -// HttpClientBuilder httpClientBuilder = HttpClientUtils.createHttpClientBuilder(); -// HttpRequestProcessor processor = new HttpRequestProcessor(httpClientBuilder, RequestMethod.POST); -// processor.addPostEntity(message); -// String result = processor.process(url); -// -// System.out.println(result); -// } -// -// @Test -// public void testHttps() throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException, ClientProtocolException, IOException -// { -// url = "https://www.baidu.com"; -// HttpClientBuilder httpClientBuilder = HttpClientUtils.createHttpClientBuilder(); -// HttpRequestProcessor processor = new HttpRequestProcessor(httpClientBuilder, RequestMethod.GET); -// -// String result = processor.process(url); -// -// System.out.println("The result is :" + result); -// } -// @Test -// public void testHome() throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException, ClientProtocolException, IOException -// { -// url = "http://172.24.208.168/"; -// HttpClientBuilder httpClientBuilder = HttpClientUtils.createHttpClientBuilder(); -// HttpRequestProcessor processor = new HttpRequestProcessor(httpClientBuilder, RequestMethod.GET); -// -// String result = processor.process(url); -// -// System.out.println("The result is :" + result); -// } -} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/com/nokia/vfcadaptor/vnfmdriver/controller/BaseControllerTestCase.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/com/nokia/vfcadaptor/vnfmdriver/controller/BaseControllerTestCase.java deleted file mode 100644 index 025949c0..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/com/nokia/vfcadaptor/vnfmdriver/controller/BaseControllerTestCase.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nokia.vfcadaptor.vnfmdriver.controller; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; - -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; - -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.conn.scheme.Scheme; -import org.apache.http.conn.scheme.SchemeRegistry; -import org.apache.http.conn.ssl.SSLSocketFactory; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager; -import org.apache.http.util.EntityUtils; -import org.junit.BeforeClass; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.http.MediaType; - -public class BaseControllerTestCase { - - private static final String CONTENT_TYPE = "Content-Type"; - private static final String AUTH = "auth"; - - private static final String UTF_8 = "utf-8"; - - protected static String serviceUrl = "http://127.0.0.1:8080/AppSenseAnalysisSystem"; - - protected static String baseUrl; - - protected static String pictureServerRootUrl = "http://localhost"; - - protected Logger log = LoggerFactory.getLogger(this.getClass()); - protected boolean isHttpsProtocol = false; - - @BeforeClass - public static void beforeClass() throws Exception { - baseUrl = serviceUrl; - } - - public static org.apache.http.client.HttpClient wrapClient(org.apache.http.client.HttpClient base) { - try { - SSLContext ctx = SSLContext.getInstance("TLS"); - X509TrustManager tm = new X509TrustManager() { - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return null; - } - public void checkClientTrusted( - java.security.cert.X509Certificate[] chain, - String authType) - throws java.security.cert.CertificateException { - // TODO Auto-generated method stub - - } - public void checkServerTrusted( - java.security.cert.X509Certificate[] chain, - String authType) - throws java.security.cert.CertificateException { - // TODO Auto-generated method stub - - } - }; - ctx.init(null, new TrustManager[] { tm }, null); - SSLSocketFactory ssf = new SSLSocketFactory(ctx, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); - SchemeRegistry registry = new SchemeRegistry(); - registry.register(new Scheme("https", 8089, ssf)); - ThreadSafeClientConnManager mgr = new ThreadSafeClientConnManager(registry); - return new DefaultHttpClient(mgr, base.getParams()); - } catch (Exception ex) { - ex.printStackTrace(); - return null; - } - } - - protected String sendPostMsg(String message, String url) throws UnsupportedEncodingException, - IOException, ClientProtocolException { - - HttpClient httpclient = new DefaultHttpClient(); - if(isHttpsProtocol) - { - httpclient = wrapClient(httpclient); - } - HttpPost httppost = new HttpPost(url); - StringEntity myEntity = new StringEntity(message, UTF_8); - String auth = ""; - httppost.addHeader(AUTH, auth); - httppost.addHeader(CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE); -// httppost.addHeader(CONTENT_TYPE, MediaType.TEXT_XML_VALUE); - httppost.setEntity(myEntity); - HttpResponse response = httpclient.execute(httppost); - HttpEntity resEntity = response.getEntity(); - String responseContent = ""; - if (resEntity != null) { - responseContent = EntityUtils.toString(resEntity, "UTF-8"); - EntityUtils.consume(resEntity); - } - httpclient.getConnectionManager().shutdown(); - return responseContent; - } - - protected String sendGetMsg(String message, String url) throws UnsupportedEncodingException, - IOException, ClientProtocolException { - - HttpClient httpclient = new DefaultHttpClient(); - if(isHttpsProtocol) - { - httpclient = wrapClient(httpclient); - } - HttpGet httpGet = new HttpGet(url); - StringEntity myEntity = new StringEntity(message, UTF_8); - String auth = ""; - httpGet.addHeader(AUTH, auth); - httpGet.addHeader(CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE); - //httppost.addHeader(CONTENT_TYPE, MediaType.TEXT_XML_VALUE); - //((HttpResponse) httpGet).setEntity(myEntity); - HttpResponse response = httpclient.execute(httpGet); - HttpEntity resEntity = response.getEntity(); - String responseContent = ""; - if (resEntity != null) { - responseContent = EntityUtils.toString(resEntity, "UTF-8"); - responseContent.replaceAll("\r", "");// - EntityUtils.consume(resEntity); - } - httpclient.getConnectionManager().shutdown(); - return responseContent; - } -} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/com/nokia/vfcadaptor/vnfmdriver/controller/VnfmDriverAdaptorControllerTest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/com/nokia/vfcadaptor/vnfmdriver/controller/VnfmDriverAdaptorControllerTest.java deleted file mode 100644 index 69a5c853..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/com/nokia/vfcadaptor/vnfmdriver/controller/VnfmDriverAdaptorControllerTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.nokia.vfcadaptor.vnfmdriver.controller; - -import java.io.IOException; -import java.net.URISyntaxException; - -import org.apache.http.client.ClientProtocolException; -import org.junit.Before; -import org.junit.Test; - -public class VnfmDriverAdaptorControllerTest extends BaseControllerTestCase{ - - private String url; - private String basicUrl="http://localhost:8080/NvfmDriver/api/nokiavnfm/v1"; - private String funcPath; - - @Before - public void setUp() - { - isHttpsProtocol = false; - } - - @Test - public void testInstantiateVnf() throws URISyntaxException, ClientProtocolException, IOException { - funcPath = "/vnfmId_001/vnfs"; - url = basicUrl + funcPath; - String message = "{\"vnfInstanceName\":\"vnfInstanceName_001\",\"vnfPackageId\":\"1\"}"; - - String responseContent = sendPostMsg(message, url); - System.out.println("-------------------------------"); - System.out.println( " Initiate Response is " + responseContent); - } - - @Test - public void testTerminateVnf() throws URISyntaxException, ClientProtocolException, IOException { - funcPath = "/vnfmId_001/vnfs/vnfInstanceId_001/terminate"; - url = basicUrl + funcPath; - String message = "{\"terminationType\":\"graceful\"}"; - String responseContent = sendPostMsg(message, url); - System.out.println("-------------------------------"); - System.out.println("Terminate Response is " + responseContent); - } - - @Test - public void testQueryVnf() throws URISyntaxException, ClientProtocolException, IOException { - funcPath = "/vnfmId_001/vnfs/vnfInstanceId_001"; - url = basicUrl + funcPath; - String message = "{\"vnfInfo\":\"{\"nfInstanceId\":\"1\",\"vnfInstanceName\":\"vFW\",\"vnfInstanceDescription\":\"vFW in Nanjing TIC Edge\",\"vnfdId\":\"1\"}\"}"; - String responseContent = sendGetMsg(message, url); - - System.out.println("-------------------------------"); - System.out.println("QueryResponse is " + responseContent); - } - - @Test - public void testOperStatusVnf() throws URISyntaxException, ClientProtocolException, IOException { - funcPath = "/vnfmId_001/jobs/jobId_001&responseId=responseId_001"; - url = basicUrl + funcPath; - String message = "{\"jobId\":\"12345\",\"responseDescriptor\":\"{\"progress\":\"40\",\"status\":\"proccessing\"}\"}"; - String responseContent = sendGetMsg(message, url); - System.out.println("-------------------------------"); - System.out.println(" operStatus Response is " + responseContent); - } - - @Test - public void testScaleVnf() throws URISyntaxException, ClientProtocolException, IOException { - funcPath = "/vnfmId_001/vnfs/vnfInstanceId_001/scale"; - url = basicUrl + funcPath; - String message = "{\"type\":\"12345\",\"aspectId\":\"145\"}"; - String responseContent = sendPostMsg(message, url); - System.out.println("-------------------------------"); - System.out.println(" Scale Response is " + responseContent); - } - - @Test - public void testHealVnf() throws URISyntaxException, ClientProtocolException, IOException { - funcPath = "/vnfmId_001/vnfs/vnfInstanceId_001/heal"; - url = basicUrl + funcPath; - String message = "{\"action\":\"12345\"}"; - String responseContent = sendPostMsg(message, url); - System.out.println("-------------------------------"); - System.out.println(" Heal Response is " + responseContent); - } - -} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/com/nokia/vfcadaptor/vnfmdriver/controller/VnfmDriverControllerTest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/com/nokia/vfcadaptor/vnfmdriver/controller/VnfmDriverControllerTest.java deleted file mode 100644 index cd6d93eb..00000000 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/com/nokia/vfcadaptor/vnfmdriver/controller/VnfmDriverControllerTest.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nokia.vfcadaptor.vnfmdriver.controller; - - -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import org.apache.http.HttpStatus; -import org.json.JSONObject; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.MockitoAnnotations; -import org.springframework.http.MediaType; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.setup.MockMvcBuilders; - -import com.nokia.vfcadaptor.exception.VnfmDriverException; -import com.nokia.vfcadaptor.vnfmdriver.bo.InstantiateVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.InstantiateVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.bo.TerminateVnfRequest; -import com.nokia.vfcadaptor.vnfmdriver.bo.TerminateVnfResponse; -import com.nokia.vfcadaptor.vnfmdriver.inf.VnfmDriverMgmrInf; - -//@RunWith(SpringJUnit4ClassRunner.class) -//@ContextConfiguration(locations={"file:src/main/webapp/WEB-INF/mvc-servlet.xml"}) -//@WebAppConfiguration(value = "src/main/webapp") -public class VnfmDriverControllerTest { - - @Mock - private VnfmDriverMgmrInf vnfmDriverMgmr; - - @InjectMocks - private VnfmDriverController controller; - - private MockMvc mockMvc; - - @Before - public void setUp() { - MockitoAnnotations.initMocks(this); - mockMvc = MockMvcBuilders.standaloneSetup(controller).build(); - } - - @Test - public void testInstantiateVnf() throws Exception - { - InstantiateVnfResponse mockResponse = new InstantiateVnfResponse(); - mockResponse.setJobId("job_001"); - mockResponse.setVnfInstanceId("vnfInstanceId_001"); - String jsonString = "{\"vnfInstanceName\":\"vnfInstanceName_001\",\"vnfPackageId\":\"1\"}"; - when(vnfmDriverMgmr.instantiateVnf(Mockito.any(InstantiateVnfRequest.class), Mockito.anyString())).thenReturn(mockResponse); - - String responseString = mockMvc.perform( - post("/nokiavnfm/v1/vnfmId_001/vnfs"). - characterEncoding("UTF-8"). - accept(MediaType.APPLICATION_JSON). - contentType(MediaType.APPLICATION_JSON). - content(jsonString)) - .andDo(print()) - .andExpect(status().isCreated()) - .andReturn().getResponse().getContentAsString(); - - JSONObject jsonObj = new JSONObject(responseString); - Assert.assertEquals("jobId is ", mockResponse.getJobId(), jsonObj.get("jobId")); - Assert.assertEquals("vnfInstanceId is ", mockResponse.getVnfInstanceId(), jsonObj.get("vnfInstanceId")); - } - - @Test - public void testTerminateVnfSuccess() throws Exception - { - TerminateVnfResponse mockResponse = new TerminateVnfResponse(); - mockResponse.setJobId("job_002"); - String jsonString = "{\"vnfInstanceId\":\"vnfInstanceId_001\"}"; - when(vnfmDriverMgmr.terminateVnf(Mockito.any(TerminateVnfRequest.class), Mockito.anyString(), Mockito.anyString())).thenReturn(mockResponse); - - String responseString = mockMvc.perform( - post("/nokiavnfm/v1/vnfmId_001/vnfs/vnfInstanceId_001/terminate"). - characterEncoding("UTF-8"). - accept(MediaType.APPLICATION_JSON). - contentType(MediaType.APPLICATION_JSON). - content(jsonString)) - .andDo(print()) - .andExpect(status().isCreated()) - .andReturn().getResponse().getContentAsString(); - - JSONObject jsonObj = new JSONObject(responseString); - Assert.assertEquals("jobId is ", mockResponse.getJobId(), jsonObj.get("jobId")); - } - @Test - public void testTerminateVnfException() throws Exception - { - TerminateVnfResponse mockResponse = new TerminateVnfResponse(); - mockResponse.setJobId("job_002"); - String jsonString = "{\"vnfInstanceId\":\"vnfInstanceId_001\"}"; - VnfmDriverException exception = new VnfmDriverException(HttpStatus.SC_BAD_REQUEST, "vnfInstanceId is wrong"); - when(vnfmDriverMgmr.terminateVnf(Mockito.any(TerminateVnfRequest.class), Mockito.anyString(), Mockito.anyString())).thenThrow(exception); - - String erroMsg = mockMvc.perform( - post("/nokiavnfm/v1/vnfmId_001/vnfs/vnfInstanceId_001/terminate"). - characterEncoding("UTF-8"). - accept(MediaType.APPLICATION_JSON). - contentType(MediaType.APPLICATION_JSON). - content(jsonString)) - .andDo(print()) - .andExpect(status().isBadRequest()) - .andReturn().getResponse().getErrorMessage() - ; - Assert.assertEquals("Error Message is ", exception.getMessage(), erroMsg); - } - -} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vfcadaptor/VfcadaptorApplicationTests.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vfcadaptor/VfcadaptorApplicationTests.java new file mode 100644 index 00000000..288770f5 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vfcadaptor/VfcadaptorApplicationTests.java @@ -0,0 +1,32 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.vfc.nfvo.driver.vnfm.svnfm.vfcadaptor; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class VfcadaptorApplicationTests { + + @Test + public void contextLoads() { + } + +} |