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 Object additionalParams;
35 private String domain;
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 flavours to be used for the VNF
72 public List<VimComputeResourceFlavour> getComputeResourceFlavours() {
73 return computeResourceFlavours;
77 * @param computeResourceFlavours the flavours to be used for the VNF
79 public void setComputeResourceFlavours(List<VimComputeResourceFlavour> computeResourceFlavours) {
80 this.computeResourceFlavours = computeResourceFlavours;
84 * @return the images to be used
86 public List<VimSoftwareImage> getSoftwareImages() {
87 return softwareImages;
91 * @param softwareImages the images to be used
93 public void setSoftwareImages(List<VimSoftwareImage> softwareImages) {
94 this.softwareImages = softwareImages;
98 * @return the zones to be used for the VNF
100 public List<ZoneInfo> getZones() {
105 * @param zones the zones to be used for the VNF
107 public void setZones(List<ZoneInfo> zones) {
112 * @return the instantiation level of the VNF
114 public String getInstantiationLevel() {
115 return instantiationLevel;
119 * @param instantiationLevel the instantiation level of the VNF
121 public void setInstantiationLevel(String instantiationLevel) {
122 this.instantiationLevel = instantiationLevel;
126 * @return the externally managed internal virtual links
128 public List<ExtManagedVirtualLinkData> getExtManagedVirtualLinks() {
129 return extManagedVirtualLinks;
133 * @param extManagedVirtualLinks the externally managed internal virtual links
135 public void setExtManagedVirtualLinks(List<ExtManagedVirtualLinkData> extManagedVirtualLinks) {
136 this.extManagedVirtualLinks = extManagedVirtualLinks;
140 * @return a binding of the extenal connection points by identifier to it's network addresses to be used
142 public Map<String, List<NetworkAddress>> getExternalConnectionPointAddresses() {
143 return externalConnectionPointAddresses;
147 * @param externalConnectionPointAddresses a binding of the extenal connection points by identifier to it's network addresses to be used
149 public void setExternalConnectionPointAddresses(Map<String, List<NetworkAddress>> externalConnectionPointAddresses) {
150 this.externalConnectionPointAddresses = externalConnectionPointAddresses;
153 public List<ExtVirtualLinkData> getExtVirtualLinks() {
154 return extVirtualLinks;
157 public void setExtVirtualLinks(List<ExtVirtualLinkData> extVirtualLinks) {
158 this.extVirtualLinks = extVirtualLinks;
162 //generated code. This is the recommended way to formulate equals
163 @SuppressWarnings({"squid:S00122", "squid:S1067"})
164 public boolean equals(Object o) {
165 if (this == o) return true;
166 if (o == null || getClass() != o.getClass()) return false;
167 AdditionalParameters that = (AdditionalParameters) o;
168 return vimType == that.vimType &&
169 Objects.equals(domain, that.domain) &&
170 Objects.equals(instantiationLevel, that.instantiationLevel) &&
171 Objects.equals(computeResourceFlavours, that.computeResourceFlavours) &&
172 Objects.equals(zones, that.zones) &&
173 Objects.equals(softwareImages, that.softwareImages) &&
174 Objects.equals(extManagedVirtualLinks, that.extManagedVirtualLinks) &&
175 Objects.equals(externalConnectionPointAddresses, that.externalConnectionPointAddresses) &&
176 Objects.equals(extVirtualLinks, that.extVirtualLinks) &&
177 Objects.equals(additionalParams, that.additionalParams);
181 public int hashCode() {
183 return Objects.hash(vimType, domain, instantiationLevel, computeResourceFlavours, zones, softwareImages, extManagedVirtualLinks, externalConnectionPointAddresses, extVirtualLinks, additionalParams);
187 public String toString() {
188 return "AdditionalParameters{" +
189 "vimType=" + vimType +
190 ", domain='" + domain + '\'' +
191 ", instantiationLevel='" + instantiationLevel + '\'' +
192 ", computeResourceFlavours=" + computeResourceFlavours +
194 ", softwareImages=" + softwareImages +
195 ", extManagedVirtualLinks=" + extManagedVirtualLinks +
196 ", externalConnectionPointAddresses=" + externalConnectionPointAddresses +
197 ", extVirtualLinks=" + extVirtualLinks +
198 ", additionalParams=" + additionalParams +
202 public String getDomain() {
206 public void setDomain(String domain) {
207 this.domain = domain;