5895108ffd4077444e544f57e18f0fe708e654c9
[vfc/nfvo/driver/vnfm/svnfm.git] / nokiav2 / driver / src / main / java / org / onap / vfc / nfvo / driver / vnfm / svnfm / nokia / vnfm / AdditionalParameters.java
1 /*
2  * Copyright 2016-2017, Nokia Corporation
3  *
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm;
17
18 import com.nokia.cbam.lcm.v32.model.*;
19 import com.nokia.cbam.lcm.v32.model.VimInfo.VimInfoTypeEnum;
20 import java.util.*;
21
22 /**
23  * Represents the additional parameters to be sent during instantiation from VF-C to the driver
24  */
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;
37
38     public AdditionalParameters() {
39         //only used through reflection (gson)
40     }
41
42     /**
43      * @return the additional parameters of the instantiation
44      */
45     public Object getAdditionalParams() {
46         return additionalParams;
47     }
48
49     /**
50      * @param additionalParams the additional parameters of the instantiation
51      */
52     public void setAdditionalParams(Object additionalParams) {
53         this.additionalParams = additionalParams;
54     }
55
56     /**
57      * @return the type of the VIM
58      */
59     public VimInfoTypeEnum getVimType() {
60         return vimType;
61     }
62
63     /**
64      * @param vimType the type of the VIM
65      */
66     public void setVimType(VimInfoTypeEnum vimType) {
67         this.vimType = vimType;
68     }
69
70     /**
71      * @return the flavours to be used for the VNF
72      */
73     public List<VimComputeResourceFlavour> getComputeResourceFlavours() {
74         return computeResourceFlavours;
75     }
76
77     /**
78      * @param computeResourceFlavours the flavours to be used for the VNF
79      */
80     public void setComputeResourceFlavours(List<VimComputeResourceFlavour> computeResourceFlavours) {
81         this.computeResourceFlavours = computeResourceFlavours;
82     }
83
84     /**
85      * @return the images to be used
86      */
87     public List<VimSoftwareImage> getSoftwareImages() {
88         return softwareImages;
89     }
90
91     /**
92      * @param softwareImages the images to be used
93      */
94     public void setSoftwareImages(List<VimSoftwareImage> softwareImages) {
95         this.softwareImages = softwareImages;
96     }
97
98     /**
99      * @return the zones to be used for the VNF
100      */
101     public List<ZoneInfo> getZones() {
102         return zones;
103     }
104
105     /**
106      * @param zones the zones to be used for the VNF
107      */
108     public void setZones(List<ZoneInfo> zones) {
109         this.zones = zones;
110     }
111
112     /**
113      * @return the instantiation level of the VNF
114      */
115     public String getInstantiationLevel() {
116         return instantiationLevel;
117     }
118
119     /**
120      * @param instantiationLevel the instantiation level of the VNF
121      */
122     public void setInstantiationLevel(String instantiationLevel) {
123         this.instantiationLevel = instantiationLevel;
124     }
125
126     /**
127      * @return the externally managed internal virtual links
128      */
129     public List<ExtManagedVirtualLinkData> getExtManagedVirtualLinks() {
130         return extManagedVirtualLinks;
131     }
132
133     /**
134      * @param extManagedVirtualLinks the externally managed internal virtual links
135      */
136     public void setExtManagedVirtualLinks(List<ExtManagedVirtualLinkData> extManagedVirtualLinks) {
137         this.extManagedVirtualLinks = extManagedVirtualLinks;
138     }
139
140     /**
141      * @return a binding of the extenal connection points by identifier to it's network addresses to be used
142      */
143     public Map<String, List<NetworkAddress>> getExternalConnectionPointAddresses() {
144         return externalConnectionPointAddresses;
145     }
146
147     /**
148      * @param externalConnectionPointAddresses a binding of the extenal connection points by identifier to it's network addresses to be used
149      */
150     public void setExternalConnectionPointAddresses(Map<String, List<NetworkAddress>> externalConnectionPointAddresses) {
151         this.externalConnectionPointAddresses = externalConnectionPointAddresses;
152     }
153
154     public List<ExtVirtualLinkData> getExtVirtualLinks() {
155         return extVirtualLinks;
156     }
157
158     public void setExtVirtualLinks(List<ExtVirtualLinkData> extVirtualLinks) {
159         this.extVirtualLinks = extVirtualLinks;
160     }
161
162     public String getDomain() {
163         return domain;
164     }
165
166     public void setDomain(String domain) {
167         this.domain = domain;
168     }
169
170     /**
171      * @return the extensions of the VNF modifiable attributes
172      */
173     public List<VnfProperty> getExtensions() {
174         return extensions;
175     }
176
177     /**
178      * @param extensions the extensions of the VNF modifiable attributes
179      */
180     public void setExtensions(List<VnfProperty> extensions) {
181         this.extensions = extensions;
182     }
183
184     @Override
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);
202     }
203
204     @Override
205     public int hashCode() {
206         return Objects.hash(vimType, domain, instantiationLevel, computeResourceFlavours, zones, softwareImages, extManagedVirtualLinks, externalConnectionPointAddresses, extVirtualLinks, extensions, additionalParams);
207     }
208
209     @Override
210     public String toString() {
211         return "AdditionalParameters{" +
212                 "vimType=" + vimType +
213                 ", instantiationLevel='" + instantiationLevel + '\'' +
214                 ", computeResourceFlavours=" + computeResourceFlavours +
215                 ", zones=" + zones +
216                 ", softwareImages=" + softwareImages +
217                 ", extManagedVirtualLinks=" + extManagedVirtualLinks +
218                 ", externalConnectionPointAddresses=" + externalConnectionPointAddresses +
219                 ", extVirtualLinks=" + extVirtualLinks +
220                 ", extensions=" + extensions +
221                 ", additionalParams=" + additionalParams +
222                 ", domain='" + domain + '\'' +
223                 '}';
224     }
225 }