Upgrade sonar plugin
[vid.git] / vid-app-common / src / main / java / org / openecomp / vid / properties / AsdcClientConfiguration.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * VID\r
4  * ================================================================================\r
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  * \r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * \r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ============LICENSE_END=========================================================\r
19  */\r
20 \r
21 package org.openecomp.vid.properties;\r
22 \r
23 import org.springframework.beans.factory.annotation.Value;\r
24 import org.springframework.context.annotation.Bean;\r
25 import org.springframework.context.annotation.Configuration;\r
26 import org.springframework.context.annotation.PropertySource;\r
27 import org.springframework.context.annotation.PropertySources;\r
28 import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;\r
29 \r
30 /**\r
31  * The Class AsdcClientConfiguration.\r
32  */\r
33 @Configuration\r
34 \r
35 @PropertySources({\r
36                 @PropertySource(value="asdc.properties",  ignoreResourceNotFound = true),\r
37                 @PropertySource(value="${container.classpath:}/WEB-INF/conf/asdc.properties", ignoreResourceNotFound = true)\r
38 })\r
39 public class AsdcClientConfiguration {\r
40 \r
41     @Bean\r
42     public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {\r
43         return new PropertySourcesPlaceholderConfigurer();\r
44     }\r
45 \r
46         @Value("${asdc.client.type}")\r
47         private AsdcClientType asdcClientType;\r
48 \r
49         /** The asdc client host. */\r
50         @Value("${asdc.client.rest.host}")\r
51         private String asdcClientHost;\r
52 \r
53         /** The asdc client port. */\r
54         @Value("${asdc.client.rest.port}")\r
55         private int asdcClientPort;\r
56 \r
57         /** The asdc client auth. */\r
58         @Value("${asdc.client.rest.auth}")\r
59         public String asdcClientAuth;\r
60 \r
61         /** The asdc client protocol. */\r
62         @Value("${asdc.client.rest.protocol}")\r
63         public String asdcClientProtocol;\r
64 \r
65         /**\r
66          * Gets the asdc client type.\r
67          *\r
68          * @return the asdc client type\r
69          */\r
70         public AsdcClientType getAsdcClientType() {\r
71                 return asdcClientType;\r
72         }\r
73 \r
74         /**\r
75          * Gets the asdc client host.\r
76          *\r
77          * @return the asdc client host\r
78          */\r
79         public String getAsdcClientHost() {\r
80                 return asdcClientHost;\r
81         }\r
82 \r
83         /**\r
84          * Gets the asdc client port.\r
85          *\r
86          * @return the asdc client port\r
87          */\r
88         public int getAsdcClientPort() {\r
89                 return asdcClientPort;\r
90         }\r
91 \r
92         /**\r
93          * Gets the asdc client auth.\r
94          *\r
95          * @return the asdc client auth\r
96          */\r
97         public String getAsdcClientAuth() {\r
98                 return asdcClientAuth;\r
99         }\r
100 \r
101         /**\r
102          * Gets the asdc client protocol.\r
103          *\r
104          * @return the asdc client protocol\r
105          */\r
106         public String getAsdcClientProtocol() {\r
107                 return asdcClientProtocol;\r
108         }\r
109 \r
110         /**\r
111          * The Enum AsdcClientType.\r
112          */\r
113         public enum AsdcClientType {\r
114 \r
115                 /** The in memory. */\r
116                 IN_MEMORY,\r
117 \r
118                 /** The rest. */\r
119                 REST,\r
120 \r
121                 /** The local. */\r
122                 LOCAL\r
123         }\r
124 }\r