Update license date and text
[aai/model-loader.git] / src / test / java / org / onap / aai / modelloader / notification / TestConfiguration.java
1 /**\r
2  * ============LICENSE_START==========================================\r
3  * org.onap.aai\r
4  * ===================================================================\r
5  * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.\r
6  * Copyright © 2017-2018 Amdocs\r
7  * ===================================================================\r
8  * Licensed under the Apache License, Version 2.0 (the "License");\r
9  * you may not use this file except in compliance with the License.\r
10  * You may obtain a copy of the License at\r
11  *\r
12  *        http://www.apache.org/licenses/LICENSE-2.0\r
13  *\r
14  * Unless required by applicable law or agreed to in writing, software\r
15  * distributed under the License is distributed on an "AS IS" BASIS,\r
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
17  * See the License for the specific language governing permissions and\r
18  * limitations under the License.\r
19  * ============LICENSE_END============================================\r
20  */\r
21 package org.onap.aai.modelloader.notification;\r
22 \r
23 import org.openecomp.sdc.api.consumer.IConfiguration;\r
24 \r
25 import java.util.ArrayList;\r
26 import java.util.List;\r
27 \r
28 public class TestConfiguration implements IConfiguration{\r
29 \r
30 \r
31     private String asdcAddress;\r
32     private String user;\r
33     private String password;\r
34     private int pollingInterval = 15;\r
35     private int pollingTimeout = 15;\r
36     private List<String> relevantArtifactTypes;\r
37     private String consumerGroup;\r
38     private String environmentName;\r
39     private String comsumerID;\r
40     private String keyStorePath;\r
41     private String keyStorePassword;\r
42     private boolean activateServerTLSAuth;\r
43     private boolean isFilterInEmptyResources;\r
44     private boolean useHttpsWithDmaap;\r
45 \r
46     public TestConfiguration(IConfiguration other) {\r
47         this.asdcAddress = other.getAsdcAddress();\r
48         this.comsumerID = other.getConsumerID();\r
49         this.consumerGroup = other.getConsumerGroup();\r
50         this.environmentName = other.getEnvironmentName();\r
51         this.password = other.getPassword();\r
52         this.pollingInterval = other.getPollingInterval();\r
53         this.pollingTimeout = other.getPollingTimeout();\r
54         this.relevantArtifactTypes = other.getRelevantArtifactTypes();\r
55         this.user = other.getUser();\r
56         this.keyStorePath = other.getKeyStorePath();\r
57         this.keyStorePassword = other.getKeyStorePassword();\r
58         this.activateServerTLSAuth = other.activateServerTLSAuth();\r
59         this.isFilterInEmptyResources = other.isFilterInEmptyResources();\r
60     }\r
61 \r
62     public TestConfiguration() {\r
63         this.asdcAddress = "localhost:8443";\r
64         this.comsumerID = "mso-123456";\r
65         this.consumerGroup = "mso-group";\r
66         this.environmentName = "PROD";\r
67         this.password = "password";\r
68         this.pollingInterval = 20;\r
69         this.pollingTimeout = 20;\r
70         this.relevantArtifactTypes = new ArrayList<String>();\r
71         this.relevantArtifactTypes.add("HEAT");\r
72         this.user = "mso-user";\r
73         this.keyStorePath = "etc/asdc-client.jks";\r
74         this.keyStorePassword = "Aa123456";\r
75         this.activateServerTLSAuth = false;\r
76         this.isFilterInEmptyResources = false;\r
77     }\r
78 \r
79     @Override\r
80     public String getAsdcAddress() {\r
81         return asdcAddress;\r
82     }\r
83 \r
84     @Override\r
85     public String getUser() {\r
86         return user;\r
87     }\r
88 \r
89     @Override\r
90     public String getPassword() {\r
91         return password;\r
92     }\r
93 \r
94     @Override\r
95     public int getPollingInterval() {\r
96         return pollingInterval;\r
97     }\r
98 \r
99     @Override\r
100     public int getPollingTimeout() {\r
101         return pollingTimeout;\r
102     }\r
103 \r
104     @Override\r
105     public List<String> getRelevantArtifactTypes() {\r
106         return relevantArtifactTypes;\r
107     }\r
108 \r
109     @Override\r
110     public String getConsumerGroup() {\r
111         return consumerGroup;\r
112     }\r
113 \r
114     @Override\r
115     public String getEnvironmentName() {\r
116         return environmentName;\r
117     }\r
118 \r
119     @Override\r
120     public String getConsumerID() {\r
121         return comsumerID;\r
122     }\r
123 \r
124     @Override\r
125     public String getKeyStorePath() {\r
126         return keyStorePath;\r
127     }\r
128 \r
129     @Override\r
130     public String getKeyStorePassword() {\r
131         return keyStorePassword;\r
132     }\r
133 \r
134     public String getComsumerID() {\r
135         return comsumerID;\r
136     }\r
137 \r
138     public void setComsumerID(String comsumerID) {\r
139         this.comsumerID = comsumerID;\r
140     }\r
141 \r
142     public void setAsdcAddress(String asdcAddress) {\r
143         this.asdcAddress = asdcAddress;\r
144     }\r
145 \r
146     public void setUser(String user) {\r
147         this.user = user;\r
148     }\r
149 \r
150     public void setPassword(String password) {\r
151         this.password = password;\r
152     }\r
153 \r
154     public void setPollingInterval(int pollingInterval) {\r
155         this.pollingInterval = pollingInterval;\r
156     }\r
157 \r
158     public void setPollingTimeout(int pollingTimeout) {\r
159         this.pollingTimeout = pollingTimeout;\r
160     }\r
161 \r
162     public void setRelevantArtifactTypes(List<String> relevantArtifactTypes) {\r
163         this.relevantArtifactTypes = relevantArtifactTypes;\r
164     }\r
165 \r
166     public void setConsumerGroup(String consumerGroup) {\r
167         this.consumerGroup = consumerGroup;\r
168     }\r
169 \r
170     public void setEnvironmentName(String environmentName) {\r
171         this.environmentName = environmentName;\r
172     }\r
173 \r
174     public void setKeyStorePath(String keyStorePath) {\r
175         this.keyStorePath = keyStorePath;\r
176     }\r
177 \r
178     public void setKeyStorePassword(String keyStorePassword) {\r
179         this.keyStorePassword = keyStorePassword;\r
180     }\r
181 \r
182     @Override\r
183     public int hashCode() {\r
184         final int prime = 31;\r
185         int result = 1;\r
186         result = prime * result + ((asdcAddress == null) ? 0 : asdcAddress.hashCode());\r
187         result = prime * result + ((comsumerID == null) ? 0 : comsumerID.hashCode());\r
188         result = prime * result + ((consumerGroup == null) ? 0 : consumerGroup.hashCode());\r
189         result = prime * result + ((environmentName == null) ? 0 : environmentName.hashCode());\r
190         result = prime * result + ((password == null) ? 0 : password.hashCode());\r
191         result = prime * result + pollingInterval;\r
192         result = prime * result + pollingTimeout;\r
193         result = prime * result + ((relevantArtifactTypes == null) ? 0 : relevantArtifactTypes.hashCode());\r
194         result = prime * result + ((user == null) ? 0 : user.hashCode());\r
195         return result;\r
196     }\r
197 \r
198     @Override\r
199     public boolean activateServerTLSAuth() {\r
200 \r
201         return activateServerTLSAuth;\r
202     }\r
203 \r
204     public void setactivateServerTLSAuth(boolean activateServerTLSAuth) {\r
205         this.activateServerTLSAuth = activateServerTLSAuth;\r
206     }\r
207 \r
208     @Override\r
209     public boolean equals(Object obj) {\r
210         if (this == obj)\r
211             return true;\r
212         if (obj == null)\r
213             return false;\r
214         if (getClass() != obj.getClass())\r
215             return false;\r
216         TestConfiguration other = (TestConfiguration) obj;\r
217         if (asdcAddress == null) {\r
218             if (other.asdcAddress != null)\r
219                 return false;\r
220         } else if (!asdcAddress.equals(other.asdcAddress))\r
221             return false;\r
222         if (comsumerID == null) {\r
223             if (other.comsumerID != null)\r
224                 return false;\r
225         } else if (!comsumerID.equals(other.comsumerID))\r
226             return false;\r
227         if (consumerGroup == null) {\r
228             if (other.consumerGroup != null)\r
229                 return false;\r
230         } else if (!consumerGroup.equals(other.consumerGroup))\r
231             return false;\r
232         if (environmentName == null) {\r
233             if (other.environmentName != null)\r
234                 return false;\r
235         } else if (!environmentName.equals(other.environmentName))\r
236             return false;\r
237         if (password == null) {\r
238             if (other.password != null)\r
239                 return false;\r
240         } else if (!password.equals(other.password))\r
241             return false;\r
242         if (pollingInterval != other.pollingInterval)\r
243             return false;\r
244         if (pollingTimeout != other.pollingTimeout)\r
245             return false;\r
246         if (relevantArtifactTypes == null) {\r
247             if (other.relevantArtifactTypes != null)\r
248                 return false;\r
249         } else if (!relevantArtifactTypes.equals(other.relevantArtifactTypes))\r
250             return false;\r
251         if (user == null) {\r
252             if (other.user != null)\r
253                 return false;\r
254         } else if (!user.equals(other.user))\r
255             return false;\r
256         if (keyStorePath == null) {\r
257             if (other.keyStorePath != null)\r
258                 return false;\r
259         } else if (!keyStorePath.equals(other.keyStorePath))\r
260             return false;\r
261         if (keyStorePassword == null) {\r
262             if (other.keyStorePassword != null)\r
263                 return false;\r
264         } else if (!keyStorePassword.equals(other.keyStorePassword))\r
265             return false;\r
266 \r
267         return true;\r
268     }\r
269 \r
270     @Override\r
271     public String toString() {\r
272         return "TestConfiguration [asdcAddress=" + asdcAddress + ", user=" + user + ", password=" + password +\r
273                 ", pollingInterval=" + pollingInterval + ", pollingTimeout=" + pollingTimeout +\r
274                 ", relevantArtifactTypes=" + relevantArtifactTypes + ", consumerGroup=" + consumerGroup +\r
275                 ", environmentName=" + environmentName + ", comsumerID=" + comsumerID + "]";\r
276     }\r
277 \r
278     @Override\r
279     public boolean isFilterInEmptyResources() {\r
280         return isFilterInEmptyResources;\r
281     }\r
282 \r
283 \r
284     public void setFilterInEmptyResources(boolean isFilterInEmptyResources) {\r
285         this.isFilterInEmptyResources = isFilterInEmptyResources;\r
286     }\r
287 \r
288     @Override\r
289     public Boolean isUseHttpsWithDmaap() {\r
290         return this.useHttpsWithDmaap;\r
291     }\r
292 }\r