diff options
author | Dan Timoney <dtimoney@att.com> | 2018-01-08 14:52:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-01-08 14:52:45 +0000 |
commit | 4b3d9579edc94c174fd942c488f6efa57c9e24b7 (patch) | |
tree | aed1bc7c5f30dbeabfc7984b6eae465320a4fe7b | |
parent | ef57280a782d3d009bcaa2481c9f26b2b7e1b877 (diff) | |
parent | 25a55717cf3d16c3bbaf0efdf197e5ccd68123da (diff) |
Merge "Exception issue"
-rw-r--r-- | ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java index a876ec524..5041b4dc3 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java @@ -326,6 +326,15 @@ public class SdncUebCallback implements INotificationCallback { } } + // Deploy scheduled deployments + int numPasses = config.getMaxPasses(); + + deployList = new LinkedList[numPasses]; + + for (int i = 0 ; i < numPasses ; i++) { + deployList[i] = new LinkedList<>(); + } + LOG.debug("Scanning {} - {} for downloaded files", incomingDir.getPath(), incomingDir.toPath()); try (DirectoryStream<Path> stream = Files.newDirectoryStream(incomingDir.toPath())) { for (Path file: stream) { @@ -337,14 +346,6 @@ public class SdncUebCallback implements INotificationCallback { LOG.warn("Cannot process spool file", x); } - // Deploy scheduled deployments - int numPasses = config.getMaxPasses(); - - deployList = new LinkedList[numPasses]; - - for (int i = 0 ; i < numPasses ; i++) { - deployList[i] = new LinkedList<>(); - } for (int pass = 0 ; pass < config.getMaxPasses() ; pass++) { if (deployList[pass] != null) { @@ -850,24 +851,22 @@ public class SdncUebCallback implements INotificationCallback { } private void scheduleDeployment(SdncArtifactType type, String svcName, String resourceName, IArtifactInfo artifactInfo, String spoolFileName, File spoolFile) { - if (deployList != null) { - if (type.getPass() < deployList.length) { + if (type.getPass() < deployList.length) { - if (artifactInfo != null) { - LOG.debug("Scheduling "+artifactInfo.getArtifactName()+" version "+artifactInfo.getArtifactVersion()+" for deployment"); + if (artifactInfo != null) { + LOG.debug("Scheduling " + artifactInfo.getArtifactName() + " version " + artifactInfo.getArtifactVersion() + " for deployment"); - deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, artifactInfo, spoolFile)); - } else { - SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.SSS");//dd/MM/yyyy - Date now = new Date(); - String artifactVersion = sdfDate.format(now); - LOG.debug("Scheduling "+spoolFileName+" version "+artifactVersion+" for deployment"); - deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, spoolFileName, - artifactVersion, spoolFile)); - } + deployList[type.getPass()].add(new org.onap.ccsdk.sli.northbound.uebclient.SdncUebCallback.DeployableArtifact(type, svcName, resourceName, artifactInfo, spoolFile)); } else { - LOG.info("Pass for type "+type.getTag()+" is "+type.getPass()+" which is not <= "+deployList.length); + SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.SSS");//dd/MM/yyyy + Date now = new Date(); + String artifactVersion = sdfDate.format(now); + LOG.debug("Scheduling " + spoolFileName + " version " + artifactVersion + " for deployment"); + deployList[type.getPass()].add(new org.onap.ccsdk.sli.northbound.uebclient.SdncUebCallback.DeployableArtifact(type, svcName, resourceName, spoolFileName, + artifactVersion, spoolFile)); } + } else { + LOG.info("Pass for type " + type.getTag() + " is " + type.getPass() + " which is not <= " + deployList.length); } } |