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.
17 package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm;
19 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.core.SelfRegistrationManager;
20 import org.springframework.beans.factory.annotation.Value;
21 import org.springframework.stereotype.Component;
23 import java.util.Objects;
26 * Wraps the properties supplied to the servlet
29 public class DriverProperties {
30 public static final String BASE_SUFFIX = "/" + SelfRegistrationManager.SERVICE_NAME + "/v1";
31 public static final String BASE_URL = "/api" + BASE_SUFFIX;
32 public static final String LCN_URL = "/lcn";
34 @Value("${cbamCatalogUrl}")
35 private String cbamCatalogUrl;
36 @Value("${cbamLcnUrl}")
37 private String cbamLcnUrl;
39 private String vnfmId;
42 * @return the URL on which the CBAM catalog API can be accessed (ex. https://1.2.3.4:443/api/catalog/adapter )
44 public String getCbamCatalogUrl() {
45 return cbamCatalogUrl;
49 * @param cbamCatalogUrl the URL on which the CBAM catalog API can be accessed (ex. https://1.2.3.4:443/api/catalog/adapter )
51 public void setCbamCatalogUrl(String cbamCatalogUrl) {
52 this.cbamCatalogUrl = cbamCatalogUrl;
56 * @return the URL on which the CBAM LCN subscription API can be accessed (ex. https://1.2.3.4:443/vnfm/lcn/v3 )
58 public String getCbamLcnUrl() {
63 * @param cbamLcnUrl the URL on which the CBAM LCN subscription API can be accessed (ex. https://1.2.3.4:443/vnfm/lcn/v3 )
65 public void setCbamLcnUrl(String cbamLcnUrl) {
66 this.cbamLcnUrl = cbamLcnUrl;
70 * @return the identifier of the VNFM
72 public String getVnfmId() {
77 * @param vnfmId the identifier of the VNFM
79 public void setVnfmId(String vnfmId) {
84 public String toString() {
85 return "DriverProperties{" +
86 ", cbamCatalogUrl='" + cbamCatalogUrl + '\'' +
87 ", cbamLcnUrl='" + cbamLcnUrl + '\'' +
88 ", vnfmId='" + vnfmId + '\'' +
93 //generated code. This is the recommended way to formulate equals
94 @SuppressWarnings({"squid:S00122", "squid:S1067"})
95 public boolean equals(Object o) {
96 if (this == o) return true;
97 if (o == null || getClass() != o.getClass()) return false;
98 DriverProperties that = (DriverProperties) o;
99 return Objects.equals(cbamCatalogUrl, that.cbamCatalogUrl) &&
100 Objects.equals(cbamLcnUrl, that.cbamLcnUrl) &&
101 Objects.equals(vnfmId, that.vnfmId);
105 public int hashCode() {
106 return Objects.hash(cbamCatalogUrl, cbamLcnUrl, vnfmId);