diff options
Diffstat (limited to 'ueb-listener')
-rw-r--r-- | ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java index c025f3b05..4f2de1cc1 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java @@ -34,13 +34,12 @@ public class SdncUebClient { private static final Logger LOG = LoggerFactory.getLogger(SdncUebConfiguration.class); public static void main(String[] args) { - IDistributionClient client = DistributionClientFactory.createDistributionClient(); SdncUebConfiguration config = new SdncUebConfiguration(); + IDistributionClient client = DistributionClientFactory.createDistributionClient(); SdncUebCallback cb = new SdncUebCallback(client, config); - LOG.info("Scanning for local distribution artifacts before starting client"); cb.deployDownloadedFiles(null, null, null); @@ -67,6 +66,21 @@ public class SdncUebClient { if (start.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) { keepWaiting = false; + } else { + LOG.info("SDC returned "+start.getDistributionActionResult().toString()+" - will retry"); + try { + client.stop(); + } catch(Exception e1) { + // Ignore exception on stop + } + client = DistributionClientFactory.createDistributionClient(); + cb = new SdncUebCallback(client, config); + LOG.info("Initializing ASDC distribution client"); + + result = client.init(config, cb); + + LOG.info("Initialized ASDC distribution client - results = {}", result.getDistributionMessageResult()); + } } catch(Exception e) { LOG.info("Client startup failure", e); |