Interface Callback


  • public interface Callback
    An interface for which the DeviceAssure can 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
      void handleError​(java.lang.String errorStr)
      Sends any error message occurring during the validation back to the caller via callback function.
      void progressUpdate​(java.lang.Integer percent)
      Report the device validation progress to the caller method.
      void statusUpdate​(java.lang.String value)
      Deprecated.
      void taskComplete()
      Deprecated.
      void taskComplete​(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.