diff options
Diffstat (limited to 'appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/onap/appc/sdc/listener/SdcListener.java')
-rw-r--r-- | appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/onap/appc/sdc/listener/SdcListener.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/onap/appc/sdc/listener/SdcListener.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/onap/appc/sdc/listener/SdcListener.java index d786247c6..c67535e11 100644 --- a/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/onap/appc/sdc/listener/SdcListener.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/onap/appc/sdc/listener/SdcListener.java @@ -2,16 +2,16 @@ * ============LICENSE_START======================================================= * ONAP : APPC * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Copyright (C) 2017 Amdocs * ============================================================================= * 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. @@ -55,6 +55,8 @@ public class SdcListener { private CountDownLatch latch; private Thread startThread = null; + private String ukey; + private String uval; @SuppressWarnings("unused") public void start() throws Exception { @@ -65,7 +67,10 @@ public class SdcListener { Configuration configuration = ConfigurationFactory.getConfiguration(); Properties props = configuration.getProperties(); config = new SdcConfig(props); - logger.debug(String.format("[%d] created SDC config", timeStamp)); + ukey = props.getProperty("appc.sdc.provider.user"); + uval = props.getProperty("appc.sdc.provider.pass"); + logger.debug(String.format("[%d] created SDC config provider URL [%s]", timeStamp, config.getStoreOpURI().toString())); + client = DistributionClientFactory.createDistributionClient(); logger.debug(String.format("[%d] created SDC client", timeStamp)); @@ -196,6 +201,8 @@ public class SdcListener { config.getUser(), url, saltedPass[1])); ProviderOperations providerOperations = new ProviderOperations(); + ProviderOperations.setDefaultUrl(config.getStoreOpURI().toURL()); + ProviderOperations.setAuthentication(ukey, uval); ProviderResponse result = providerOperations.post(url, json, headers); return result.getStatus() == 200; } catch (Exception e) { |