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;
 
  36     public AdditionalParameters() {
 
  37         //only used through reflection (gson)
 
  41      * @return the additional parameters of the instantiation
 
  43     public Object getAdditionalParams() {
 
  44         return additionalParams;
 
  48      * @param additionalParams the additional parameters of the instantiation
 
  50     public void setAdditionalParams(Object additionalParams) {
 
  51         this.additionalParams = additionalParams;
 
  55      * @return the type of the VIM
 
  57     public VimInfoTypeEnum getVimType() {
 
  62      * @param vimType the type of the VIM
 
  64     public void setVimType(VimInfoTypeEnum vimType) {
 
  65         this.vimType = vimType;
 
  69      * @return the flavours to be used for the VNF
 
  71     public List<VimComputeResourceFlavour> getComputeResourceFlavours() {
 
  72         return computeResourceFlavours;
 
  76      * @param computeResourceFlavours the flavours to be used for the VNF
 
  78     public void setComputeResourceFlavours(List<VimComputeResourceFlavour> computeResourceFlavours) {
 
  79         this.computeResourceFlavours = computeResourceFlavours;
 
  83      * @return the images to be used
 
  85     public List<VimSoftwareImage> getSoftwareImages() {
 
  86         return softwareImages;
 
  90      * @param softwareImages the images to be used
 
  92     public void setSoftwareImages(List<VimSoftwareImage> softwareImages) {
 
  93         this.softwareImages = softwareImages;
 
  97      * @return the zones to be used for the VNF
 
  99     public List<ZoneInfo> getZones() {
 
 104      * @param zones the zones to be used for the VNF
 
 106     public void setZones(List<ZoneInfo> zones) {
 
 111      * @return the instantiation level of the VNF
 
 113     public String getInstantiationLevel() {
 
 114         return instantiationLevel;
 
 118      * @param instantiationLevel the instantiation level of the VNF
 
 120     public void setInstantiationLevel(String instantiationLevel) {
 
 121         this.instantiationLevel = instantiationLevel;
 
 125      * @return the externally managed internal virtual links
 
 127     public List<ExtManagedVirtualLinkData> getExtManagedVirtualLinks() {
 
 128         return extManagedVirtualLinks;
 
 132      * @param extManagedVirtualLinks the externally managed internal virtual links
 
 134     public void setExtManagedVirtualLinks(List<ExtManagedVirtualLinkData> extManagedVirtualLinks) {
 
 135         this.extManagedVirtualLinks = extManagedVirtualLinks;
 
 139      * @return a binding of the extenal connection points by identifier to it's network addresses to be used
 
 141     public Map<String, List<NetworkAddress>> getExternalConnectionPointAddresses() {
 
 142         return externalConnectionPointAddresses;
 
 146      * @param externalConnectionPointAddresses a binding of the extenal connection points by identifier to it's network addresses to be used
 
 148     public void setExternalConnectionPointAddresses(Map<String, List<NetworkAddress>> externalConnectionPointAddresses) {
 
 149         this.externalConnectionPointAddresses = externalConnectionPointAddresses;
 
 152     public List<ExtVirtualLinkData> getExtVirtualLinks() {
 
 153         return extVirtualLinks;
 
 156     public void setExtVirtualLinks(List<ExtVirtualLinkData> extVirtualLinks) {
 
 157         this.extVirtualLinks = extVirtualLinks;
 
 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 vimType == that.vimType &&
 
 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(additionalParams, that.additionalParams);
 
 179     public int hashCode() {
 
 181         return Objects.hash(vimType, instantiationLevel, computeResourceFlavours, zones, softwareImages, extManagedVirtualLinks, externalConnectionPointAddresses, extVirtualLinks, additionalParams);
 
 185     public String toString() {
 
 186         return "AdditionalParameters{" +
 
 187                 "vimType=" + vimType +
 
 188                 ", instantiationLevel='" + instantiationLevel + '\'' +
 
 189                 ", computeResourceFlavours=" + computeResourceFlavours +
 
 191                 ", softwareImages=" + softwareImages +
 
 192                 ", extManagedVirtualLinks=" + extManagedVirtualLinks +
 
 193                 ", externalConnectionPointAddresses=" + externalConnectionPointAddresses +
 
 194                 ", extVirtualLinks=" + extVirtualLinks +
 
 195                 ", additionalParams=" + additionalParams +