Change: add OPEN-O seed code for VF-C
[vfc/nfvo/driver/vnfm/svnfm.git] / huawei / vnfmadapter / VnfmadapterService / service / src / main / java / org / openo / nfvo / vnfmadapter / common / RegisterConfigInfo.java
1 /*
2  * Copyright 2016 Huawei Technologies Co., Ltd.
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.openo.nfvo.vnfmadapter.common;
18
19 import java.util.Locale;
20 import java.util.ResourceBundle;
21
22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory;
24
25 /**
26  * Provide function for reading register parameter.
27  * <br/>
28  * <p>
29  * </p>
30  *
31  * @author
32  * @version     NFVO 0.5  Aug 25, 2016
33  */
34 public class RegisterConfigInfo {
35
36     private static final Logger LOGGER = LoggerFactory.getLogger(RegisterConfigInfo.class);
37
38     private String serviceName;
39
40     private String version;
41
42     private String url;
43
44     private String protocol;
45
46     private String ip;
47
48     private String port;
49
50     private String ttl;
51
52     private static RegisterConfigInfo regConfig = new RegisterConfigInfo();
53
54     private RegisterConfigInfo() {
55         ResourceBundle rb = ResourceBundle.getBundle("registerService", Locale.getDefault());
56         serviceName = rb.getString("serviceName");
57         version = rb.getString("version");
58         url = rb.getString("url");
59         protocol = rb.getString("protocol");
60         ip = rb.getString("ip");
61         port = rb.getString("port");
62         ttl = rb.getString("ttl");
63     }
64
65     public static RegisterConfigInfo getInstance() {
66         return regConfig;
67     }
68
69     public String getServiceName() {
70         return serviceName;
71     }
72
73     public String getVersion() {
74         return version;
75     }
76
77     public String getUrl() {
78         return url;
79     }
80
81     public String getProtocol() {
82         return protocol;
83     }
84
85     public String getIp() {
86         return ip;
87     }
88
89     public String getPort() {
90         return port;
91     }
92
93     public String getTtl() {
94         return ttl;
95     }
96 }