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 domain;
28 private String instantiationLevel;
29 private List<VimComputeResourceFlavour> computeResourceFlavours = new ArrayList<>();
30 private List<ZoneInfo> zones = new ArrayList<>();
31 private List<VimSoftwareImage> softwareImages = new ArrayList<>();
32 private List<ExtManagedVirtualLinkData> extManagedVirtualLinks = new ArrayList<>();
33 private Map<String, List<NetworkAddress>> externalConnectionPointAddresses = new HashMap<>();
34 private List<ExtVirtualLinkData> extVirtualLinks = new ArrayList<>();
35 private Object additionalParams;
37 public AdditionalParameters() {
38 //only used through reflection (gson)
42 * @return the additional parameters of the instantiation
44 public Object getAdditionalParams() {
45 return additionalParams;
49 * @param additionalParams the additional parameters of the instantiation
51 public void setAdditionalParams(Object additionalParams) {
52 this.additionalParams = additionalParams;
56 * @return the type of the VIM
58 public VimInfoTypeEnum getVimType() {
63 * @param vimType the type of the VIM
65 public void setVimType(VimInfoTypeEnum vimType) {
66 this.vimType = vimType;
70 * @return the domain of the OpenStack (required for v3 API)
72 public String getDomain() {
77 * @param domain the domain of the OpenStack (required for v3 API)
79 public void setDomain(String domain) {
84 * @return the flavours to be used for the VNF
86 public List<VimComputeResourceFlavour> getComputeResourceFlavours() {
87 return computeResourceFlavours;
91 * @param computeResourceFlavours the flavours to be used for the VNF
93 public void setComputeResourceFlavours(List<VimComputeResourceFlavour> computeResourceFlavours) {
94 this.computeResourceFlavours = computeResourceFlavours;
98 * @return the images to be used
100 public List<VimSoftwareImage> getSoftwareImages() {
101 return softwareImages;
105 * @param softwareImages the images to be used
107 public void setSoftwareImages(List<VimSoftwareImage> softwareImages) {
108 this.softwareImages = softwareImages;
112 * @return the zones to be used for the VNF
114 public List<ZoneInfo> getZones() {
119 * @param zones the zones to be used for the VNF
121 public void setZones(List<ZoneInfo> zones) {
126 * @return the instantiation level of the VNF
128 public String getInstantiationLevel() {
129 return instantiationLevel;
133 * @param instantiationLevel the instantiation level of the VNF
135 public void setInstantiationLevel(String instantiationLevel) {
136 this.instantiationLevel = instantiationLevel;
140 * @return the externally managed internal virtual links
142 public List<ExtManagedVirtualLinkData> getExtManagedVirtualLinks() {
143 return extManagedVirtualLinks;
147 * @param extManagedVirtualLinks the externally managed internal virtual links
149 public void setExtManagedVirtualLinks(List<ExtManagedVirtualLinkData> extManagedVirtualLinks) {
150 this.extManagedVirtualLinks = extManagedVirtualLinks;
154 * @return a binding of the extenal connection points by identifier to it's network addresses to be used
156 public Map<String, List<NetworkAddress>> getExternalConnectionPointAddresses() {
157 return externalConnectionPointAddresses;
161 * @param externalConnectionPointAddresses a binding of the extenal connection points by identifier to it's network addresses to be used
163 public void setExternalConnectionPointAddresses(Map<String, List<NetworkAddress>> externalConnectionPointAddresses) {
164 this.externalConnectionPointAddresses = externalConnectionPointAddresses;
167 public List<ExtVirtualLinkData> getExtVirtualLinks() {
168 return extVirtualLinks;
171 public void setExtVirtualLinks(List<ExtVirtualLinkData> extVirtualLinks) {
172 this.extVirtualLinks = extVirtualLinks;
176 //generated code. This is the recommended way to formulate equals
177 @SuppressWarnings({"squid:S00122", "squid:S1067"})
178 public boolean equals(Object o) {
179 if (this == o) return true;
180 if (o == null || getClass() != o.getClass()) return false;
181 AdditionalParameters that = (AdditionalParameters) o;
182 return vimType == that.vimType &&
183 Objects.equals(domain, that.domain) &&
184 Objects.equals(instantiationLevel, that.instantiationLevel) &&
185 Objects.equals(computeResourceFlavours, that.computeResourceFlavours) &&
186 Objects.equals(zones, that.zones) &&
187 Objects.equals(softwareImages, that.softwareImages) &&
188 Objects.equals(extManagedVirtualLinks, that.extManagedVirtualLinks) &&
189 Objects.equals(externalConnectionPointAddresses, that.externalConnectionPointAddresses) &&
190 Objects.equals(extVirtualLinks, that.extVirtualLinks) &&
191 Objects.equals(additionalParams, that.additionalParams);
195 public int hashCode() {
197 return Objects.hash(vimType, domain, instantiationLevel, computeResourceFlavours, zones, softwareImages, extManagedVirtualLinks, externalConnectionPointAddresses, extVirtualLinks, additionalParams);
201 public String toString() {
202 return "AdditionalParameters{" +
203 "vimType=" + vimType +
204 ", domain='" + domain + '\'' +
205 ", instantiationLevel='" + instantiationLevel + '\'' +
206 ", computeResourceFlavours=" + computeResourceFlavours +
208 ", softwareImages=" + softwareImages +
209 ", extManagedVirtualLinks=" + extManagedVirtualLinks +
210 ", externalConnectionPointAddresses=" + externalConnectionPointAddresses +
211 ", extVirtualLinks=" + extVirtualLinks +
212 ", additionalParams=" + additionalParams +