aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprakash.e <prakash.e@huawei.com>2018-01-02 12:48:58 +0530
committerprakash.e <prakash.e@huawei.com>2018-01-02 12:48:58 +0530
commitdf299c18dc8c00878dccdf3086556a08ca202896 (patch)
tree2f2455bf0164406810a492034b66ac2a946aec9a
parented713dafb77bb57b62ed8eb7da4a1364dca0ad17 (diff)
Exception issue fix
Change-Id: I75eafe5267909dc1102287ef9bc8dffdb1d5dcba Issue-ID: CCSDK-151 Signed-off-by: prakash.e <prakash.e@huawei.com>
-rw-r--r--ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java35
1 files changed, 17 insertions, 18 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 89459bcd..b9df86ef 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
@@ -325,18 +325,16 @@ public class SdncUebCallback implements INotificationCallback {
archiveDir.mkdirs();
}
}
-
- String curFileName = "";
+
LOG.debug("Scanning {} - {} for downloaded files", incomingDir.getPath(), incomingDir.toPath());
try (DirectoryStream<Path> stream = Files.newDirectoryStream(incomingDir.toPath())) {
for (Path file: stream) {
- curFileName = file.toString();
handleSuccessfulDownload(null,null, null, null, file.toFile(), archiveDir);
}
- } catch (Exception x) {
+ } catch (IOException x) {
// IOException can never be thrown by the iteration.
// In this snippet, it can only be thrown by newDirectoryStream.
- LOG.warn("Cannot process spool file {}", curFileName, x);
+ LOG.warn("Cannot process spool file", x);
}
// Deploy scheduled deployments
@@ -856,23 +854,24 @@ 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));
+ 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));
+ }
} 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));
+ LOG.info("Pass for type "+type.getTag()+" is "+type.getPass()+" which is not <= "+deployList.length);
}
- } else {
- LOG.info("Pass for type "+type.getTag()+" is "+type.getPass()+" which is not <= "+deployList.length);
}
}