Added seq generator changes for vnf level actions
[appc.git] / appc-sequence-generator / appc-sequence-generator-bundle / src / main / java / org / onap / appc / seqgen / dgplugin / impl / SequenceGeneratorPluginImpl.java
index 8e44bc3..a53c408 100644 (file)
@@ -1,20 +1,23 @@
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * 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.
+ *
  * ============LICENSE_END=========================================================
  */
 
@@ -93,7 +96,7 @@ public class SequenceGeneratorPluginImpl implements SequenceGeneratorPlugin {
 
         return sequenceGeneratorInput;
     }
-    private List<Transaction> generateSequence(SequenceGeneratorInput sequenceGeneratorInput) throws APPCException {
+    private List<Transaction> generateSequence(SequenceGeneratorInput sequenceGeneratorInput) throws Exception {
         if (sequenceGeneratorInput.getRequestInfo() == null) {
             throw new APPCException("Request info is not provided in the input");
         }
@@ -259,9 +262,12 @@ public class SequenceGeneratorPluginImpl implements SequenceGeneratorPlugin {
 
         String vnfId = vnfInfo.get("vnf-id").asText();
         String vnfType = vnfInfo.get("vnf-type").asText();
+        String identityUrl = vnfInfo.get("identity-url").asText();
         Vnf vnf =new Vnf();
         vnf.setVnfId(vnfId);
         vnf.setVnfType(vnfType);
+        vnf.setIdentityUrl(identityUrl);
+        logger.debug("IdentityUrl in SeqGen:" + identityUrl);
         Map<Vnfc, List<Vserver>> vfcs = new HashMap<>();
         JsonNode vms = vnfInfo.get("vm");
         if(vms.size()<1){
@@ -272,8 +278,10 @@ public class SequenceGeneratorPluginImpl implements SequenceGeneratorPlugin {
                 throw new APPCException("vserver-id not found ");
             }
             String vserverId = vm.get("vserver-id").asText();
+            String vmId =vm.get("vm-id").asText();
             Vserver vserver = new Vserver();
             vserver.setId(vserverId);
+            vserver.setUrl(vmId);
             if (vm.get("vnfc")!=null&& vm.get("vnfc").get("vnfc-name") != null && vm.get("vnfc").get("vnfc-type")!= null) {
                 Vnfc vfc = new Vnfc();
                 vfc.setVnfcType(vm.get("vnfc").get("vnfc-type").asText());