Skip to content

Commit cd13568

Browse files
authored
Merge pull request #5 from AppSecDev/set_progress_in_providers
Set progress in providers
2 parents 5aa357f + 52409ca commit cd13568

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

src/main/java/com/hcl/appscan/sdk/results/CloudResultsProvider.java

+6
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ public String getResultsFormat() {
127127
return m_reportFormat;
128128
}
129129

130+
@Override
131+
public void setProgress(IProgress progress) {
132+
m_progress = progress;
133+
m_scanProvider.setProgress(progress);
134+
}
135+
130136
/**
131137
* Specifies the format to use for reports.
132138
*

src/main/java/com/hcl/appscan/sdk/results/IResultsProvider.java

+8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import java.io.File;
1010
import java.util.Collection;
1111

12+
import com.hcl.appscan.sdk.logging.IProgress;
13+
1214
/**
1315
* Provides access to the results of a security scan.
1416
*/
@@ -80,4 +82,10 @@ public interface IResultsProvider {
8082
* @return The format of the results file.
8183
*/
8284
public String getResultsFormat();
85+
86+
/**
87+
* Sets the IProgress for tracking status.
88+
* @param progress The IProgress.
89+
*/
90+
public void setProgress(IProgress progress);
8391
}

src/main/java/com/hcl/appscan/sdk/scan/CloudScanServiceProvider.java

+5
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,9 @@ private boolean verifyApplication(String appId) {
144144
m_progress.setStatus(new Message(Message.ERROR, Messages.getMessage(ERROR_INVALID_APP, appId)));
145145
return false;
146146
}
147+
148+
@Override
149+
public void setProgress(IProgress progress) {
150+
m_progress = progress;
151+
}
147152
}

src/main/java/com/hcl/appscan/sdk/scan/IScanServiceProvider.java

+7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.apache.wink.json4j.JSONObject;
1515

1616
import com.hcl.appscan.sdk.auth.IAuthenticationProvider;
17+
import com.hcl.appscan.sdk.logging.IProgress;
1718

1819
/**
1920
* A provider of scanning services.
@@ -52,4 +53,10 @@ public interface IScanServiceProvider {
5253
* @return
5354
*/
5455
public IAuthenticationProvider getAuthenticationProvider();
56+
57+
/**
58+
* Sets the {@link IProgress} used to record status messages.
59+
* @param progress The {@link IProgress}.
60+
*/
61+
public void setProgress(IProgress progress);
5562
}

0 commit comments

Comments
 (0)