Add SO APIs to Nokia VNFM adapter
[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 String instantiationLevel;
27     private List<VimComputeResourceFlavour> computeResourceFlavours = new ArrayList<>();
28     private List<ZoneInfo> zones = new ArrayList<>();
29     private List<VimSoftwareImage> softwareImages = new ArrayList<>();
30     private List<ExtManagedVirtualLinkData> extManagedVirtualLinks = new ArrayList<>();
31     private Map<String, List<NetworkAddress>> externalConnectionPointAddresses = new HashMap<>();
32     private List<ExtVirtualLinkData> extVirtualLinks = new ArrayList<>();
33     private List<VnfProperty> extensions = new ArrayList<>();
34     private Object additionalParams;
35
36     public AdditionalParameters() {
37         //only used through reflection (gson)
38     }
39
40     /**
41      * @return the additional parameters of the instantiation
42      */
43     public Object getAdditionalParams() {
44         return additionalParams;
45     }
46
47     /**
48      * @param additionalParams the additional parameters of the instantiation
49      */
50     public void setAdditionalParams(Object additionalParams) {
51         this.additionalParams = additionalParams;
52     }
53
54     /**
55      * @return the flavours to be used for the VNF
56      */
57     public List<VimComputeResourceFlavour> getComputeResourceFlavours() {
58         return computeResourceFlavours;
59     }
60
61     /**
62      * @param computeResourceFlavours the flavours to be used for the VNF
63      */
64     public void setComputeResourceFlavours(List<VimComputeResourceFlavour> computeResourceFlavours) {
65         this.computeResourceFlavours = computeResourceFlavours;
66     }
67
68     /**
69      * @return the images to be used
70      */
71     public List<VimSoftwareImage> getSoftwareImages() {
72         return softwareImages;
73     }
74
75     /**
76      * @param softwareImages the images to be used
77      */
78     public void setSoftwareImages(List<VimSoftwareImage> softwareImages) {
79         this.softwareImages = softwareImages;
80     }
81
82     /**
83      * @return the zones to be used for the VNF
84      */
85     public List<ZoneInfo> getZones() {
86         return zones;
87     }
88
89     /**
90      * @param zones the zones to be used for the VNF
91      */
92     public void setZones(List<ZoneInfo> zones) {
93         this.zones = zones;
94     }
95
96     /**
97      * @return the instantiation level of the VNF
98      */
99     public String getInstantiationLevel() {
100         return instantiationLevel;
101     }
102
103     /**
104      * @param instantiationLevel the instantiation level of the VNF
105      */
106     public void setInstantiationLevel(String instantiationLevel) {
107         this.instantiationLevel = instantiationLevel;
108     }
109
110     /**
111      * @return the externally managed internal virtual links
112      */
113     public List<ExtManagedVirtualLinkData> getExtManagedVirtualLinks() {
114         return extManagedVirtualLinks;
115     }
116
117     /**
118      * @param extManagedVirtualLinks the externally managed internal virtual links
119      */
120     public void setExtManagedVirtualLinks(List<ExtManagedVirtualLinkData> extManagedVirtualLinks) {
121         this.extManagedVirtualLinks = extManagedVirtualLinks;
122     }
123
124     /**
125      * @return a binding of the extenal connection points by identifier to it's network addresses to be used
126      */
127     public Map<String, List<NetworkAddress>> getExternalConnectionPointAddresses() {
128         return externalConnectionPointAddresses;
129     }
130
131     /**
132      * @param externalConnectionPointAddresses a binding of the extenal connection points by identifier to it's network addresses to be used
133      */
134     public void setExternalConnectionPointAddresses(Map<String, List<NetworkAddress>> externalConnectionPointAddresses) {
135         this.externalConnectionPointAddresses = externalConnectionPointAddresses;
136     }
137
138     public List<ExtVirtualLinkData> getExtVirtualLinks() {
139         return extVirtualLinks;
140     }
141
142     public void setExtVirtualLinks(List<ExtVirtualLinkData> extVirtualLinks) {
143         this.extVirtualLinks = extVirtualLinks;
144     }
145
146     /**
147      * @return the extensions of the VNF modifiable attributes
148      */
149     public List<VnfProperty> getExtensions() {
150         return extensions;
151     }
152
153     /**
154      * @param extensions the extensions of the VNF modifiable attributes
155      */
156     public void setExtensions(List<VnfProperty> extensions) {
157         this.extensions = extensions;
158     }
159
160     @Override
161     //generated code. This is the recommended way to formulate equals
162     @SuppressWarnings({"squid:S00122", "squid:S1067"})
163     public boolean equals(Object o) {
164         if (this == o) return true;
165         if (o == null || getClass() != o.getClass()) return false;
166         AdditionalParameters that = (AdditionalParameters) o;
167         return
168                 Objects.equals(instantiationLevel, that.instantiationLevel) &&
169                 Objects.equals(computeResourceFlavours, that.computeResourceFlavours) &&
170                 Objects.equals(zones, that.zones) &&
171                 Objects.equals(softwareImages, that.softwareImages) &&
172                 Objects.equals(extManagedVirtualLinks, that.extManagedVirtualLinks) &&
173                 Objects.equals(externalConnectionPointAddresses, that.externalConnectionPointAddresses) &&
174                 Objects.equals(extVirtualLinks, that.extVirtualLinks) &&
175                 Objects.equals(extensions, that.extensions) &&
176                 Objects.equals(additionalParams, that.additionalParams);
177     }
178
179     @Override
180     public int hashCode() {
181         return Objects.hash(instantiationLevel, computeResourceFlavours, zones, softwareImages, extManagedVirtualLinks, externalConnectionPointAddresses, extVirtualLinks, extensions, additionalParams);
182     }
183
184     @Override
185     public String toString() {
186         return "AdditionalParameters{" +
187                 ", instantiationLevel='" + instantiationLevel + '\'' +
188                 ", computeResourceFlavours=" + computeResourceFlavours +
189                 ", zones=" + zones +
190                 ", softwareImages=" + softwareImages +
191                 ", extManagedVirtualLinks=" + extManagedVirtualLinks +
192                 ", externalConnectionPointAddresses=" + externalConnectionPointAddresses +
193                 ", extVirtualLinks=" + extVirtualLinks +
194                 ", extensions=" + extensions +
195                 ", additionalParams=" + additionalParams +
196                 '}';
197     }
198 }