Interface Callback
-
public interface CallbackAn interface for which theDeviceAssurecan use to return an API response or error with.
// Sample callback public class ExampleCallback implements Callback { private final Activity parent; public ExampleCallback(CallingClass caller) { this.caller = caller; } @Override public void progressUpdate(Integer integer) { } @Override public void taskComplete(JSONObject jsonObject) { // Data is returned here. caller.update(jsonObject); } @Override public void handleError(String s) { } @Deprecated @Override public void statusUpdate(String s) { } @Deprecated @Override public void taskComplete() { } }
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidhandleError(java.lang.String errorStr)Sends any error message occurring during the validation back to the caller via callback function.voidprogressUpdate(java.lang.Integer percent)Report the device validation progress to the caller method.voidstatusUpdate(java.lang.String value)Deprecated.voidtaskComplete()Deprecated.voidtaskComplete(org.json.JSONObject result)Send the DeviceAssure result of the validation back to the caller via callback function.
-
-
-
Method Detail
-
progressUpdate
void progressUpdate(java.lang.Integer percent)
Report the device validation progress to the caller method.- Parameters:
percent- - Progress percentage
-
taskComplete
void taskComplete(org.json.JSONObject result)
Send the DeviceAssure result of the validation back to the caller via callback function.- Parameters:
result- JSONObject that contains the result of the validation
-
handleError
void handleError(java.lang.String errorStr)
Sends any error message occurring during the validation back to the caller via callback function.- Parameters:
errorStr- A String that is the message of the error.
-
statusUpdate
@Deprecated void statusUpdate(java.lang.String value)
Deprecated.A hook for the status update on the request.- Parameters:
value- Value associated with the status update.
-
taskComplete
@Deprecated void taskComplete()
Deprecated.A hook for when the task is complete.
-
-