2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright © 2017 AT&T Intellectual Property.
\r
6 * Copyright © 2017 Amdocs
\r
7 * All rights reserved.
\r
8 * ================================================================================
\r
9 * Licensed under the Apache License, Version 2.0 (the "License");
\r
10 * you may not use this file except in compliance with the License.
\r
11 * You may obtain a copy of the License at
\r
13 * http://www.apache.org/licenses/LICENSE-2.0
\r
15 * Unless required by applicable law or agreed to in writing, software
\r
16 * distributed under the License is distributed on an "AS IS" BASIS,
\r
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
18 * See the License for the specific language governing permissions and
\r
19 * limitations under the License.
\r
20 * ============LICENSE_END=========================================================
\r
22 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
\r
24 package org.onap.aai.modelloader.notification;
\r
26 import org.openecomp.sdc.api.consumer.IConfiguration;
\r
28 import java.util.ArrayList;
\r
29 import java.util.List;
\r
31 public class TestConfiguration implements IConfiguration{
\r
34 private String asdcAddress;
\r
35 private String user;
\r
36 private String password;
\r
37 private int pollingInterval = 15;
\r
38 private int pollingTimeout = 15;
\r
39 private List<String> relevantArtifactTypes;
\r
40 private String consumerGroup;
\r
41 private String environmentName;
\r
42 private String comsumerID;
\r
43 private String keyStorePath;
\r
44 private String keyStorePassword;
\r
45 private boolean activateServerTLSAuth;
\r
46 private boolean isFilterInEmptyResources;
\r
47 private boolean useHttpsWithDmaap;
\r
49 public TestConfiguration(IConfiguration other) {
\r
50 this.asdcAddress = other.getAsdcAddress();
\r
51 this.comsumerID = other.getConsumerID();
\r
52 this.consumerGroup = other.getConsumerGroup();
\r
53 this.environmentName = other.getEnvironmentName();
\r
54 this.password = other.getPassword();
\r
55 this.pollingInterval = other.getPollingInterval();
\r
56 this.pollingTimeout = other.getPollingTimeout();
\r
57 this.relevantArtifactTypes = other.getRelevantArtifactTypes();
\r
58 this.user = other.getUser();
\r
59 this.keyStorePath = other.getKeyStorePath();
\r
60 this.keyStorePassword = other.getKeyStorePassword();
\r
61 this.activateServerTLSAuth = other.activateServerTLSAuth();
\r
62 this.isFilterInEmptyResources = other.isFilterInEmptyResources();
\r
65 public TestConfiguration() {
\r
66 this.asdcAddress = "localhost:8443";
\r
67 this.comsumerID = "mso-123456";
\r
68 this.consumerGroup = "mso-group";
\r
69 this.environmentName = "PROD";
\r
70 this.password = "password";
\r
71 this.pollingInterval = 20;
\r
72 this.pollingTimeout = 20;
\r
73 this.relevantArtifactTypes = new ArrayList<String>();
\r
74 this.relevantArtifactTypes.add("HEAT");
\r
75 this.user = "mso-user";
\r
76 this.keyStorePath = "etc/asdc-client.jks";
\r
77 this.keyStorePassword = "Aa123456";
\r
78 this.activateServerTLSAuth = false;
\r
79 this.isFilterInEmptyResources = false;
\r
83 public String getAsdcAddress() {
\r
88 public String getUser() {
\r
93 public String getPassword() {
\r
98 public int getPollingInterval() {
\r
99 return pollingInterval;
\r
103 public int getPollingTimeout() {
\r
104 return pollingTimeout;
\r
108 public List<String> getRelevantArtifactTypes() {
\r
109 return relevantArtifactTypes;
\r
113 public String getConsumerGroup() {
\r
114 return consumerGroup;
\r
118 public String getEnvironmentName() {
\r
119 return environmentName;
\r
123 public String getConsumerID() {
\r
128 public String getKeyStorePath() {
\r
129 return keyStorePath;
\r
133 public String getKeyStorePassword() {
\r
134 return keyStorePassword;
\r
137 public String getComsumerID() {
\r
141 public void setComsumerID(String comsumerID) {
\r
142 this.comsumerID = comsumerID;
\r
145 public void setAsdcAddress(String asdcAddress) {
\r
146 this.asdcAddress = asdcAddress;
\r
149 public void setUser(String user) {
\r
153 public void setPassword(String password) {
\r
154 this.password = password;
\r
157 public void setPollingInterval(int pollingInterval) {
\r
158 this.pollingInterval = pollingInterval;
\r
161 public void setPollingTimeout(int pollingTimeout) {
\r
162 this.pollingTimeout = pollingTimeout;
\r
165 public void setRelevantArtifactTypes(List<String> relevantArtifactTypes) {
\r
166 this.relevantArtifactTypes = relevantArtifactTypes;
\r
169 public void setConsumerGroup(String consumerGroup) {
\r
170 this.consumerGroup = consumerGroup;
\r
173 public void setEnvironmentName(String environmentName) {
\r
174 this.environmentName = environmentName;
\r
177 public void setKeyStorePath(String keyStorePath) {
\r
178 this.keyStorePath = keyStorePath;
\r
181 public void setKeyStorePassword(String keyStorePassword) {
\r
182 this.keyStorePassword = keyStorePassword;
\r
186 public int hashCode() {
\r
187 final int prime = 31;
\r
189 result = prime * result + ((asdcAddress == null) ? 0 : asdcAddress.hashCode());
\r
190 result = prime * result + ((comsumerID == null) ? 0 : comsumerID.hashCode());
\r
191 result = prime * result + ((consumerGroup == null) ? 0 : consumerGroup.hashCode());
\r
192 result = prime * result + ((environmentName == null) ? 0 : environmentName.hashCode());
\r
193 result = prime * result + ((password == null) ? 0 : password.hashCode());
\r
194 result = prime * result + pollingInterval;
\r
195 result = prime * result + pollingTimeout;
\r
196 result = prime * result + ((relevantArtifactTypes == null) ? 0 : relevantArtifactTypes.hashCode());
\r
197 result = prime * result + ((user == null) ? 0 : user.hashCode());
\r
202 public boolean activateServerTLSAuth() {
\r
204 return activateServerTLSAuth;
\r
207 public void setactivateServerTLSAuth(boolean activateServerTLSAuth) {
\r
208 this.activateServerTLSAuth = activateServerTLSAuth;
\r
212 public boolean equals(Object obj) {
\r
217 if (getClass() != obj.getClass())
\r
219 TestConfiguration other = (TestConfiguration) obj;
\r
220 if (asdcAddress == null) {
\r
221 if (other.asdcAddress != null)
\r
223 } else if (!asdcAddress.equals(other.asdcAddress))
\r
225 if (comsumerID == null) {
\r
226 if (other.comsumerID != null)
\r
228 } else if (!comsumerID.equals(other.comsumerID))
\r
230 if (consumerGroup == null) {
\r
231 if (other.consumerGroup != null)
\r
233 } else if (!consumerGroup.equals(other.consumerGroup))
\r
235 if (environmentName == null) {
\r
236 if (other.environmentName != null)
\r
238 } else if (!environmentName.equals(other.environmentName))
\r
240 if (password == null) {
\r
241 if (other.password != null)
\r
243 } else if (!password.equals(other.password))
\r
245 if (pollingInterval != other.pollingInterval)
\r
247 if (pollingTimeout != other.pollingTimeout)
\r
249 if (relevantArtifactTypes == null) {
\r
250 if (other.relevantArtifactTypes != null)
\r
252 } else if (!relevantArtifactTypes.equals(other.relevantArtifactTypes))
\r
254 if (user == null) {
\r
255 if (other.user != null)
\r
257 } else if (!user.equals(other.user))
\r
259 if (keyStorePath == null) {
\r
260 if (other.keyStorePath != null)
\r
262 } else if (!keyStorePath.equals(other.keyStorePath))
\r
264 if (keyStorePassword == null) {
\r
265 if (other.keyStorePassword != null)
\r
267 } else if (!keyStorePassword.equals(other.keyStorePassword))
\r
274 public String toString() {
\r
275 return "TestConfiguration [asdcAddress=" + asdcAddress + ", user=" + user + ", password=" + password +
\r
276 ", pollingInterval=" + pollingInterval + ", pollingTimeout=" + pollingTimeout +
\r
277 ", relevantArtifactTypes=" + relevantArtifactTypes + ", consumerGroup=" + consumerGroup +
\r
278 ", environmentName=" + environmentName + ", comsumerID=" + comsumerID + "]";
\r
282 public boolean isFilterInEmptyResources() {
\r
283 return isFilterInEmptyResources;
\r
287 public void setFilterInEmptyResources(boolean isFilterInEmptyResources) {
\r
288 this.isFilterInEmptyResources = isFilterInEmptyResources;
\r
292 public Boolean isUseHttpsWithDmaap() {
\r
293 return this.useHttpsWithDmaap;
\r