2 * Copyright 2016-2017, Nokia Corporation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm;
18 import com.nokia.cbam.lcm.v32.model.*;
19 import com.nokia.cbam.lcm.v32.model.VimInfo.VimInfoTypeEnum;
23 * Represents the additional parameters to be sent during instantiation from VF-C to the driver
25 public class AdditionalParameters {
26 private VimInfoTypeEnum vimType;
27 private String instantiationLevel;
28 private List<VimComputeResourceFlavour> computeResourceFlavours = new ArrayList<>();
29 private List<ZoneInfo> zones = new ArrayList<>();
30 private List<VimSoftwareImage> softwareImages = new ArrayList<>();
31 private List<ExtManagedVirtualLinkData> extManagedVirtualLinks = new ArrayList<>();
32 private Map<String, List<NetworkAddress>> externalConnectionPointAddresses = new HashMap<>();
33 private List<ExtVirtualLinkData> extVirtualLinks = new ArrayList<>();
34 private List<VnfProperty> extensions = new ArrayList<>();
35 private Object additionalParams;
36 private String domain;
38 public AdditionalParameters() {
39 //only used through reflection (gson)
43 * @return the additional parameters of the instantiation
45 public Object getAdditionalParams() {
46 return additionalParams;
50 * @param additionalParams the additional parameters of the instantiation
52 public void setAdditionalParams(Object additionalParams) {
53 this.additionalParams = additionalParams;
57 * @return the type of the VIM
59 public VimInfoTypeEnum getVimType() {
64 * @param vimType the type of the VIM
66 public void setVimType(VimInfoTypeEnum vimType) {
67 this.vimType = vimType;
71 * @return the flavours to be used for the VNF
73 public List<VimComputeResourceFlavour> getComputeResourceFlavours() {
74 return computeResourceFlavours;
78 * @param computeResourceFlavours the flavours to be used for the VNF
80 public void setComputeResourceFlavours(List<VimComputeResourceFlavour> computeResourceFlavours) {
81 this.computeResourceFlavours = computeResourceFlavours;
85 * @return the images to be used
87 public List<VimSoftwareImage> getSoftwareImages() {
88 return softwareImages;
92 * @param softwareImages the images to be used
94 public void setSoftwareImages(List<VimSoftwareImage> softwareImages) {
95 this.softwareImages = softwareImages;
99 * @return the zones to be used for the VNF
101 public List<ZoneInfo> getZones() {
106 * @param zones the zones to be used for the VNF
108 public void setZones(List<ZoneInfo> zones) {
113 * @return the instantiation level of the VNF
115 public String getInstantiationLevel() {
116 return instantiationLevel;
120 * @param instantiationLevel the instantiation level of the VNF
122 public void setInstantiationLevel(String instantiationLevel) {
123 this.instantiationLevel = instantiationLevel;
127 * @return the externally managed internal virtual links
129 public List<ExtManagedVirtualLinkData> getExtManagedVirtualLinks() {
130 return extManagedVirtualLinks;
134 * @param extManagedVirtualLinks the externally managed internal virtual links
136 public void setExtManagedVirtualLinks(List<ExtManagedVirtualLinkData> extManagedVirtualLinks) {
137 this.extManagedVirtualLinks = extManagedVirtualLinks;
141 * @return a binding of the extenal connection points by identifier to it's network addresses to be used
143 public Map<String, List<NetworkAddress>> getExternalConnectionPointAddresses() {
144 return externalConnectionPointAddresses;
148 * @param externalConnectionPointAddresses a binding of the extenal connection points by identifier to it's network addresses to be used
150 public void setExternalConnectionPointAddresses(Map<String, List<NetworkAddress>> externalConnectionPointAddresses) {
151 this.externalConnectionPointAddresses = externalConnectionPointAddresses;
154 public List<ExtVirtualLinkData> getExtVirtualLinks() {
155 return extVirtualLinks;
158 public void setExtVirtualLinks(List<ExtVirtualLinkData> extVirtualLinks) {
159 this.extVirtualLinks = extVirtualLinks;
162 public String getDomain() {
166 public void setDomain(String domain) {
167 this.domain = domain;
171 * @return the extensions of the VNF modifiable attributes
173 public List<VnfProperty> getExtensions() {
178 * @param extensions the extensions of the VNF modifiable attributes
180 public void setExtensions(List<VnfProperty> extensions) {
181 this.extensions = extensions;
185 //generated code. This is the recommended way to formulate equals
186 @SuppressWarnings({"squid:S00122", "squid:S1067"})
187 public boolean equals(Object o) {
188 if (this == o) return true;
189 if (o == null || getClass() != o.getClass()) return false;
190 AdditionalParameters that = (AdditionalParameters) o;
191 return vimType == that.vimType &&
192 Objects.equals(domain, that.domain) &&
193 Objects.equals(instantiationLevel, that.instantiationLevel) &&
194 Objects.equals(computeResourceFlavours, that.computeResourceFlavours) &&
195 Objects.equals(zones, that.zones) &&
196 Objects.equals(softwareImages, that.softwareImages) &&
197 Objects.equals(extManagedVirtualLinks, that.extManagedVirtualLinks) &&
198 Objects.equals(externalConnectionPointAddresses, that.externalConnectionPointAddresses) &&
199 Objects.equals(extVirtualLinks, that.extVirtualLinks) &&
200 Objects.equals(extensions, that.extensions) &&
201 Objects.equals(additionalParams, that.additionalParams);
205 public int hashCode() {
206 return Objects.hash(vimType, domain, instantiationLevel, computeResourceFlavours, zones, softwareImages, extManagedVirtualLinks, externalConnectionPointAddresses, extVirtualLinks, extensions, additionalParams);
210 public String toString() {
211 return "AdditionalParameters{" +
212 "vimType=" + vimType +
213 ", instantiationLevel='" + instantiationLevel + '\'' +
214 ", computeResourceFlavours=" + computeResourceFlavours +
216 ", softwareImages=" + softwareImages +
217 ", extManagedVirtualLinks=" + extManagedVirtualLinks +
218 ", externalConnectionPointAddresses=" + externalConnectionPointAddresses +
219 ", extVirtualLinks=" + extVirtualLinks +
220 ", extensions=" + extensions +
221 ", additionalParams=" + additionalParams +
222 ", domain='" + domain + '\'' +