From fd856f34f589714c82b112a05771e27413b36801 Mon Sep 17 00:00:00 2001 From: Matt Murphy Date: Fri, 15 Sep 2017 09:32:51 -0400 Subject: [PATCH 1/3] set IProgress in IResultsProvider --- .../com/hcl/appscan/sdk/results/CloudResultsProvider.java | 5 +++++ .../com/hcl/appscan/sdk/results/IResultsProvider.java | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/main/java/com/hcl/appscan/sdk/results/CloudResultsProvider.java b/src/main/java/com/hcl/appscan/sdk/results/CloudResultsProvider.java index 4e5011da..39bf75a0 100644 --- a/src/main/java/com/hcl/appscan/sdk/results/CloudResultsProvider.java +++ b/src/main/java/com/hcl/appscan/sdk/results/CloudResultsProvider.java @@ -127,6 +127,11 @@ public String getResultsFormat() { return m_reportFormat; } + @Override + public void setProgress(IProgress progress) { + m_progress = progress; + } + /** * Specifies the format to use for reports. * diff --git a/src/main/java/com/hcl/appscan/sdk/results/IResultsProvider.java b/src/main/java/com/hcl/appscan/sdk/results/IResultsProvider.java index 56cbf3b5..547b79f2 100644 --- a/src/main/java/com/hcl/appscan/sdk/results/IResultsProvider.java +++ b/src/main/java/com/hcl/appscan/sdk/results/IResultsProvider.java @@ -9,6 +9,8 @@ import java.io.File; import java.util.Collection; +import com.hcl.appscan.sdk.logging.IProgress; + /** * Provides access to the results of a security scan. */ @@ -80,4 +82,10 @@ public interface IResultsProvider { * @return The format of the results file. */ public String getResultsFormat(); + + /** + * Sets the IProgress for tracking status. + * @param progress The IProgress. + */ + public void setProgress(IProgress progress); } \ No newline at end of file From 5f4f95dcb847dfa6b42fe395d837b46605fdad3f Mon Sep 17 00:00:00 2001 From: Matt Murphy Date: Fri, 15 Sep 2017 19:27:52 -0400 Subject: [PATCH 2/3] set progress in providers --- .../com/hcl/appscan/sdk/scan/CloudScanServiceProvider.java | 5 +++++ .../com/hcl/appscan/sdk/scan/IScanServiceProvider.java | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/main/java/com/hcl/appscan/sdk/scan/CloudScanServiceProvider.java b/src/main/java/com/hcl/appscan/sdk/scan/CloudScanServiceProvider.java index 16aee028..812281e1 100644 --- a/src/main/java/com/hcl/appscan/sdk/scan/CloudScanServiceProvider.java +++ b/src/main/java/com/hcl/appscan/sdk/scan/CloudScanServiceProvider.java @@ -144,4 +144,9 @@ private boolean verifyApplication(String appId) { m_progress.setStatus(new Message(Message.ERROR, Messages.getMessage(ERROR_INVALID_APP, appId))); return false; } + + @Override + public void setProgress(IProgress progress) { + m_progress = progress; + } } diff --git a/src/main/java/com/hcl/appscan/sdk/scan/IScanServiceProvider.java b/src/main/java/com/hcl/appscan/sdk/scan/IScanServiceProvider.java index 9f8177a3..c703bf46 100644 --- a/src/main/java/com/hcl/appscan/sdk/scan/IScanServiceProvider.java +++ b/src/main/java/com/hcl/appscan/sdk/scan/IScanServiceProvider.java @@ -14,6 +14,7 @@ import org.apache.wink.json4j.JSONObject; import com.hcl.appscan.sdk.auth.IAuthenticationProvider; +import com.hcl.appscan.sdk.logging.IProgress; /** * A provider of scanning services. @@ -52,4 +53,10 @@ public interface IScanServiceProvider { * @return */ public IAuthenticationProvider getAuthenticationProvider(); + + /** + * Sets the {@link IProgress} used to record status messages. + * @param progress The {@link IProgress}. + */ + public void setProgress(IProgress progress); } From 52409ca8bf63de8f90e953af75c99cbc2540a5ea Mon Sep 17 00:00:00 2001 From: Matt Murphy Date: Fri, 15 Sep 2017 19:41:01 -0400 Subject: [PATCH 3/3] set progress for IScanServiceProvider with CloudResultsProvider --- .../java/com/hcl/appscan/sdk/results/CloudResultsProvider.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/hcl/appscan/sdk/results/CloudResultsProvider.java b/src/main/java/com/hcl/appscan/sdk/results/CloudResultsProvider.java index 39bf75a0..4af8bba7 100644 --- a/src/main/java/com/hcl/appscan/sdk/results/CloudResultsProvider.java +++ b/src/main/java/com/hcl/appscan/sdk/results/CloudResultsProvider.java @@ -130,6 +130,7 @@ public String getResultsFormat() { @Override public void setProgress(IProgress progress) { m_progress = progress; + m_scanProvider.setProgress(progress); } /**