Class PollingService

java.lang.Object
com.exxothermic.audioeverywheresdk.helper.logic.PollingService

public abstract class PollingService extends Object
Class which wraps a polling service
Since:
12/11/13
  • Constructor Details

    • PollingService

      public PollingService(android.content.Context context, long timeInterval)
      Default constructor
      Parameters:
      context - The application's context
      timeInterval - the time interval for this polling
  • Method Details

    • getId

      public long getId()
      Getter for the polling service id which is the unix timestamp upon the object's creation
      Returns:
      The polling service id
    • isRunning

      public boolean isRunning()
      Getter to identify if the polling service is running
      Returns:
      A boolean indicating if the polling service is running
    • isUpdating

      public boolean isUpdating()
      Getter which indicates if the polling service is performing the update operation on background
      Returns:
      A boolean indicating if the polling service is performing the update operation on background
    • setResponseHandler

      public void setResponseHandler(AudioEverywhereResponseHandler responseHandler)
      Method that will set the current response handler for this polling service cycle
      Parameters:
      responseHandler - the response handler to set
    • getResponseHandler

      public AudioEverywhereResponseHandler getResponseHandler()
    • start

      public void start()
      Method which starts the polling service
    • forcePolling

      public void forcePolling()
      Method which force a poll action
    • stop

      public void stop()
      Method which stops the polling service
    • pollInBackground

      public abstract void pollInBackground()
      Abstract method which is intended to execute the polling operation logic
    • scheduleNextPoll

      public void scheduleNextPoll()
      Method which schedules a polling event. Likewise updates the current interval considering an exponential backoff algorithm, if the previous poll was not useful the current interval should increment, if it was useful the current increment should be reset to the min interval
    • getCurrentDeviceType

      public int getCurrentDeviceType()
    • getmCurrentDeviceType

      public int getmCurrentDeviceType()
    • setCurrentDeviceType

      public void setCurrentDeviceType(int mCurrentDeviceType)