2 * ============LICENSE_START==========================================
\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
12 * http://www.apache.org/licenses/LICENSE-2.0
\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
21 package org.onap.aai.modelloader.notification;
\r
23 import org.openecomp.sdc.api.consumer.IConfiguration;
\r
25 import java.util.ArrayList;
\r
26 import java.util.List;
\r
28 public class TestConfiguration implements IConfiguration{
\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
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
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
80 public String getAsdcAddress() {
\r
85 public String getUser() {
\r
90 public String getPassword() {
\r
95 public int getPollingInterval() {
\r
96 return pollingInterval;
\r
100 public int getPollingTimeout() {
\r
101 return pollingTimeout;
\r
105 public List<String> getRelevantArtifactTypes() {
\r
106 return relevantArtifactTypes;
\r
110 public String getConsumerGroup() {
\r
111 return consumerGroup;
\r
115 public String getEnvironmentName() {
\r
116 return environmentName;
\r
120 public String getConsumerID() {
\r
125 public String getKeyStorePath() {
\r
126 return keyStorePath;
\r
130 public String getKeyStorePassword() {
\r
131 return keyStorePassword;
\r
134 public String getComsumerID() {
\r
138 public void setComsumerID(String comsumerID) {
\r
139 this.comsumerID = comsumerID;
\r
142 public void setAsdcAddress(String asdcAddress) {
\r
143 this.asdcAddress = asdcAddress;
\r
146 public void setUser(String user) {
\r
150 public void setPassword(String password) {
\r
151 this.password = password;
\r
154 public void setPollingInterval(int pollingInterval) {
\r
155 this.pollingInterval = pollingInterval;
\r
158 public void setPollingTimeout(int pollingTimeout) {
\r
159 this.pollingTimeout = pollingTimeout;
\r
162 public void setRelevantArtifactTypes(List<String> relevantArtifactTypes) {
\r
163 this.relevantArtifactTypes = relevantArtifactTypes;
\r
166 public void setConsumerGroup(String consumerGroup) {
\r
167 this.consumerGroup = consumerGroup;
\r
170 public void setEnvironmentName(String environmentName) {
\r
171 this.environmentName = environmentName;
\r
174 public void setKeyStorePath(String keyStorePath) {
\r
175 this.keyStorePath = keyStorePath;
\r
178 public void setKeyStorePassword(String keyStorePassword) {
\r
179 this.keyStorePassword = keyStorePassword;
\r
183 public int hashCode() {
\r
184 final int prime = 31;
\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
199 public boolean activateServerTLSAuth() {
\r
201 return activateServerTLSAuth;
\r
204 public void setactivateServerTLSAuth(boolean activateServerTLSAuth) {
\r
205 this.activateServerTLSAuth = activateServerTLSAuth;
\r
209 public boolean equals(Object obj) {
\r
214 if (getClass() != obj.getClass())
\r
216 TestConfiguration other = (TestConfiguration) obj;
\r
217 if (asdcAddress == null) {
\r
218 if (other.asdcAddress != null)
\r
220 } else if (!asdcAddress.equals(other.asdcAddress))
\r
222 if (comsumerID == null) {
\r
223 if (other.comsumerID != null)
\r
225 } else if (!comsumerID.equals(other.comsumerID))
\r
227 if (consumerGroup == null) {
\r
228 if (other.consumerGroup != null)
\r
230 } else if (!consumerGroup.equals(other.consumerGroup))
\r
232 if (environmentName == null) {
\r
233 if (other.environmentName != null)
\r
235 } else if (!environmentName.equals(other.environmentName))
\r
237 if (password == null) {
\r
238 if (other.password != null)
\r
240 } else if (!password.equals(other.password))
\r
242 if (pollingInterval != other.pollingInterval)
\r
244 if (pollingTimeout != other.pollingTimeout)
\r
246 if (relevantArtifactTypes == null) {
\r
247 if (other.relevantArtifactTypes != null)
\r
249 } else if (!relevantArtifactTypes.equals(other.relevantArtifactTypes))
\r
251 if (user == null) {
\r
252 if (other.user != null)
\r
254 } else if (!user.equals(other.user))
\r
256 if (keyStorePath == null) {
\r
257 if (other.keyStorePath != null)
\r
259 } else if (!keyStorePath.equals(other.keyStorePath))
\r
261 if (keyStorePassword == null) {
\r
262 if (other.keyStorePassword != null)
\r
264 } else if (!keyStorePassword.equals(other.keyStorePassword))
\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
279 public boolean isFilterInEmptyResources() {
\r
280 return isFilterInEmptyResources;
\r
284 public void setFilterInEmptyResources(boolean isFilterInEmptyResources) {
\r
285 this.isFilterInEmptyResources = isFilterInEmptyResources;
\r
289 public Boolean isUseHttpsWithDmaap() {
\r
290 return this.useHttpsWithDmaap;
\r