From ecc059f29f8da065356571ef00c6cad595e298b3 Mon Sep 17 00:00:00 2001 From: ramverma Date: Fri, 31 Aug 2018 17:16:01 +0100 Subject: Adding code for managing life cycle of SDC Client * Adding init/start/stop methods in SDCReceptionHandler for managing lifecycle of SDC Client. * Adding a handler status enum to hold all the possible status values. * Adding test cases to cover code changes fully. Change-Id: Ib6f370485ff330538bfada6030c592629ed3fd1c Issue-ID: POLICY-956 Signed-off-by: ramverma --- .../reception/handling/sdc/SdcConfiguration.java | 119 +++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcConfiguration.java (limited to 'plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcConfiguration.java') diff --git a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcConfiguration.java b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcConfiguration.java new file mode 100644 index 00000000..945670b9 --- /dev/null +++ b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcConfiguration.java @@ -0,0 +1,119 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Intel. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.distribution.reception.handling.sdc; + +import java.util.List; + +import org.onap.policy.distribution.reception.parameters.PssdConfigurationParametersGroup; +import org.onap.sdc.api.consumer.IConfiguration; + +/** + * This class represents the configurations needed for SDC Client. + * + */ +public class SdcConfiguration implements IConfiguration { + + private PssdConfigurationParametersGroup configParameters = null; + + /** + * Constructor for instantiating {@link SdcConfiguration}. + * + * @param configParameters the SDC Client configuration parameters + */ + public SdcConfiguration(final PssdConfigurationParametersGroup configParameters) { + this.configParameters = configParameters; + } + + @Override + public String getAsdcAddress() { + return configParameters.getAsdcAddress(); + } + + @Override + public List getMsgBusAddress() { + return configParameters.getMsgBusAddress(); + } + + @Override + public String getUser() { + return configParameters.getUser(); + } + + @Override + public String getPassword() { + return configParameters.getPassword(); + } + + @Override + public int getPollingInterval() { + return configParameters.getPollingInterval(); + } + + @Override + public int getPollingTimeout() { + return configParameters.getPollingTimeout(); + } + + @Override + public List getRelevantArtifactTypes() { + return configParameters.getArtifactTypes(); + } + + @Override + public String getConsumerGroup() { + return configParameters.getConsumerGroup(); + } + + @Override + public String getEnvironmentName() { + return configParameters.getEnvironmentName(); + } + + @Override + public String getConsumerID() { + return configParameters.getConsumerID(); + } + + @Override + public String getKeyStorePassword() { + return configParameters.getKeyStorePassword(); + } + + @Override + public String getKeyStorePath() { + return configParameters.getKeyStorePath(); + } + + @Override + public boolean activateServerTLSAuth() { + return configParameters.activateServerTLSAuth(); + } + + @Override + public boolean isFilterInEmptyResources() { + return configParameters.isFilterInEmptyResources(); + } + + @Override + public Boolean isUseHttpsWithDmaap() { + return configParameters.isUseHttpsWithDmaap(); + } +} -- cgit 1.2.3-korg