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;
24 * Represents the additional parameters to be sent during instantiation from VF-C to the driver
26 public class AdditionalParameters {
27 private VimInfoTypeEnum vimType;
28 private String domain;
29 private String instantiationLevel;
30 private List<VimComputeResourceFlavour> computeResourceFlavours = new ArrayList<>();
31 private List<ZoneInfo> zones = new ArrayList<>();
32 private List<VimSoftwareImage> softwareImages = new ArrayList<>();
33 private List<ExtManagedVirtualLinkData> extManagedVirtualLinks = new ArrayList<>();
34 private Map<String, List<NetworkAddress>> externalConnectionPointAddresses = new HashMap<>();
35 private List<ExtVirtualLinkData> extVirtualLinks = new ArrayList<>();
36 private Object additionalParams;
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 domain of the OpenStack (required for v3 API)
73 public String getDomain() {
78 * @param domain the domain of the OpenStack (required for v3 API)
80 public void setDomain(String domain) {
85 * @return the flavours to be used for the VNF
87 public List<VimComputeResourceFlavour> getComputeResourceFlavours() {
88 return computeResourceFlavours;
92 * @param computeResourceFlavours the flavours to be used for the VNF
94 public void setComputeResourceFlavours(List<VimComputeResourceFlavour> computeResourceFlavours) {
95 this.computeResourceFlavours = computeResourceFlavours;
99 * @return the images to be used
101 public List<VimSoftwareImage> getSoftwareImages() {
102 return softwareImages;
106 * @param softwareImages the images to be used
108 public void setSoftwareImages(List<VimSoftwareImage> softwareImages) {
109 this.softwareImages = softwareImages;
113 * @return the zones to be used for the VNF
115 public List<ZoneInfo> getZones() {
120 * @param zones the zones to be used for the VNF
122 public void setZones(List<ZoneInfo> zones) {
127 * @return the instantiation level of the VNF
129 public String getInstantiationLevel() {
130 return instantiationLevel;
134 * @param instantiationLevel the instantiation level of the VNF
136 public void setInstantiationLevel(String instantiationLevel) {
137 this.instantiationLevel = instantiationLevel;
141 * @return the externally managed internal virtual links
143 public List<ExtManagedVirtualLinkData> getExtManagedVirtualLinks() {
144 return extManagedVirtualLinks;
148 * @param extManagedVirtualLinks the externally managed internal virtual links
150 public void setExtManagedVirtualLinks(List<ExtManagedVirtualLinkData> extManagedVirtualLinks) {
151 this.extManagedVirtualLinks = extManagedVirtualLinks;
155 * @return a binding of the extenal connection points by identifier to it's network addresses to be used
157 public Map<String, List<NetworkAddress>> getExternalConnectionPointAddresses() {
158 return externalConnectionPointAddresses;
162 * @param externalConnectionPointAddresses a binding of the extenal connection points by identifier to it's network addresses to be used
164 public void setExternalConnectionPointAddresses(Map<String, List<NetworkAddress>> externalConnectionPointAddresses) {
165 this.externalConnectionPointAddresses = externalConnectionPointAddresses;
168 public List<ExtVirtualLinkData> getExtVirtualLinks() {
169 return extVirtualLinks;
172 public void setExtVirtualLinks(List<ExtVirtualLinkData> extVirtualLinks) {
173 this.extVirtualLinks = extVirtualLinks;
177 //generated code. This is the recommended way to formulate equals
178 @SuppressWarnings({"squid:S00122", "squid:S1067"})
179 public boolean equals(Object o) {
180 if (this == o) return true;
181 if (o == null || getClass() != o.getClass()) return false;
182 AdditionalParameters that = (AdditionalParameters) o;
183 return vimType == that.vimType &&
184 Objects.equals(domain, that.domain) &&
185 Objects.equals(instantiationLevel, that.instantiationLevel) &&
186 Objects.equals(computeResourceFlavours, that.computeResourceFlavours) &&
187 Objects.equals(zones, that.zones) &&
188 Objects.equals(softwareImages, that.softwareImages) &&
189 Objects.equals(extManagedVirtualLinks, that.extManagedVirtualLinks) &&
190 Objects.equals(externalConnectionPointAddresses, that.externalConnectionPointAddresses) &&
191 Objects.equals(extVirtualLinks, that.extVirtualLinks) &&
192 Objects.equals(additionalParams, that.additionalParams);
196 public int hashCode() {
198 return Objects.hash(vimType, domain, instantiationLevel, computeResourceFlavours, zones, softwareImages, extManagedVirtualLinks, externalConnectionPointAddresses, extVirtualLinks, additionalParams);
202 public String toString() {
203 return "AdditionalParameters{" +
204 "vimType=" + vimType +
205 ", domain='" + domain + '\'' +
206 ", instantiationLevel='" + instantiationLevel + '\'' +
207 ", computeResourceFlavours=" + computeResourceFlavours +
209 ", softwareImages=" + softwareImages +
210 ", extManagedVirtualLinks=" + extManagedVirtualLinks +
211 ", externalConnectionPointAddresses=" + externalConnectionPointAddresses +
212 ", extVirtualLinks=" + extVirtualLinks +
213 ", additionalParams=" + additionalParams +