2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.so.bpmn.common.scripts;
23 import org.apache.commons.lang3.*
24 import org.onap.so.logger.MessageEnum
25 import org.onap.so.logger.MsoLogger
29 public class VfModule implements Serializable {
30 private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VfModule.class);
34 * Class representing a VF Module Node. Fields of this class include indicators
35 * as to whether the VF Module is the only VF Module in its containing Generic VNF
36 * and whether the VF Module is the base VF Module in its containing Generic VNF.
40 private Boolean onlyVfModule
41 private Boolean baseVfModule
46 * @param node Node representing the VF Module xml.
47 * @param onlyVfModule Is this VF Module the only VF Module in its containing Generic VNF?
49 public VfModule(Node node, boolean onlyVfModule) {
51 this.onlyVfModule = onlyVfModule
52 this.baseVfModule = getElementText('is-base-vf-module').equals('true')
56 * Get the Node representing the VF Module xml.
58 * @return the Node representing the VF Module xml.
60 public Node getNode() {
64 public String getElementText(String childNodeName) {
65 def Node childNode = (new MsoUtils()).getChildNode(node, childNodeName)
66 if (childNode == null) {
69 return childNode.text()
74 * Is this VF Module the only VF Module in its containing Generic VNF?
76 * @return true if this VF Module is the only VF Module in its containing Generic VNF;
79 public boolean isOnlyVfModule() {
84 * Is this VF Module the base VF Module in its containing Generic VNF?
86 * @return true if this VF Module is the base VF Module in its containing Generic VNF;
89 public boolean isBaseVfModule() {