Removing jackson to mitigate cve-2017-4995
[vfc/nfvo/driver/vnfm/svnfm.git] / nokiav2 / driver / src / main / java / org / onap / vfc / nfvo / driver / vnfm / svnfm / nokia / vnfm / DriverProperties.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
17 package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm;
18
19 import java.util.Objects;
20 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.core.SelfRegistrationManager;
21 import org.springframework.beans.factory.annotation.Value;
22 import org.springframework.stereotype.Component;
23
24 /**
25  * Wraps the properties supplied to the servlet
26  */
27 @Component
28 public class DriverProperties {
29     public static final String BASE_SUFFIX = "/" + SelfRegistrationManager.SERVICE_NAME + "/v1";
30     public static final String BASE_URL = "/api" + BASE_SUFFIX;
31     public static final String LCN_URL = "/lcn";
32
33     @Value("${cbamCatalogUrl}")
34     private String cbamCatalogUrl;
35     @Value("${cbamLcnUrl}")
36     private String cbamLcnUrl;
37     @Value("${vnfmId}")
38     private String vnfmId;
39
40     /**
41      * @return the URL on which the CBAM catalog API can be accessed (ex. https://1.2.3.4:443/api/catalog/adapter )
42      */
43     public String getCbamCatalogUrl() {
44         return cbamCatalogUrl;
45     }
46
47     /**
48      * @param cbamCatalogUrl the URL on which the CBAM catalog API can be accessed (ex. https://1.2.3.4:443/api/catalog/adapter )
49      */
50     public void setCbamCatalogUrl(String cbamCatalogUrl) {
51         this.cbamCatalogUrl = cbamCatalogUrl;
52     }
53
54     /**
55      * @return the URL on which the CBAM LCN subscription API can be accessed (ex. https://1.2.3.4:443/vnfm/lcn/v3 )
56      */
57     public String getCbamLcnUrl() {
58         return cbamLcnUrl;
59     }
60
61     /**
62      * @param cbamLcnUrl the URL on which the CBAM LCN subscription API can be accessed (ex. https://1.2.3.4:443/vnfm/lcn/v3 )
63      */
64     public void setCbamLcnUrl(String cbamLcnUrl) {
65         this.cbamLcnUrl = cbamLcnUrl;
66     }
67
68     /**
69      * @return the identifier of the VNFM
70      */
71     public String getVnfmId() {
72         return vnfmId;
73     }
74
75     /**
76      * @param vnfmId the identifier of the VNFM
77      */
78     public void setVnfmId(String vnfmId) {
79         this.vnfmId = vnfmId;
80     }
81
82     @Override
83     public String toString() {
84         return "DriverProperties{" +
85                 ", cbamCatalogUrl='" + cbamCatalogUrl + '\'' +
86                 ", cbamLcnUrl='" + cbamLcnUrl + '\'' +
87                 ", vnfmId='" + vnfmId + '\'' +
88                 '}';
89     }
90
91     @Override
92     //generated code. This is the recommended way to formulate equals
93     @SuppressWarnings({"squid:S00122", "squid:S1067"})
94     public boolean equals(Object o) {
95         if (this == o) return true;
96         if (o == null || getClass() != o.getClass()) return false;
97         DriverProperties that = (DriverProperties) o;
98         return Objects.equals(cbamCatalogUrl, that.cbamCatalogUrl) &&
99                 Objects.equals(cbamLcnUrl, that.cbamLcnUrl) &&
100                 Objects.equals(vnfmId, that.vnfmId);
101     }
102
103     @Override
104     public int hashCode() {
105         return Objects.hash(cbamCatalogUrl, cbamLcnUrl, vnfmId);
106     }
107 }