com.todoroo.astrid.sync
Class SyncProviderUtilities

java.lang.Object
  extended by com.todoroo.astrid.sync.SyncProviderUtilities

public abstract class SyncProviderUtilities
extends java.lang.Object

Sync Provider Utility class for accessing preferences


Constructor Summary
SyncProviderUtilities()
           
 
Method Summary
 void clearLastSyncDate()
          Deletes Last Successful Sync Date
abstract  java.lang.String getIdentifier()
           
 long getLastAttemptedSyncDate()
           
 java.lang.String getLastError()
           
 long getLastSyncDate()
           
abstract  java.lang.String getLoggedInUserName()
          Returns something like "Logged in as: user@gmail.com"
 int getSyncAutoSyncFrequency()
          Reads the frequency, in seconds, auto-sync should occur.
abstract  int getSyncIntervalKey()
           
 java.lang.String getToken()
          authentication token, or null if doesn't exist
 boolean isLoggedIn()
           
 boolean isOngoing()
           
 void recordSuccessfulSync()
          Set Last Successful Sync Date
 void recordSyncStart()
          Set Last Attempted Sync Date
 void setLastError(java.lang.String error)
          Set Last Successful Sync Date
 void setToken(java.lang.String setting)
          Sets the authentication token.
 boolean shouldShowToast()
           
 void stopOngoing()
          Set Ongoing
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncProviderUtilities

public SyncProviderUtilities()
Method Detail

getIdentifier

public abstract java.lang.String getIdentifier()
Returns:
your plugin identifier

getSyncIntervalKey

public abstract int getSyncIntervalKey()
Returns:
key for sync interval

shouldShowToast

public boolean shouldShowToast()
Returns:
true if we should show sync toast when synchronizing

isLoggedIn

public boolean isLoggedIn()
Returns:
true if we have a token for this user, false otherwise

getToken

public java.lang.String getToken()
authentication token, or null if doesn't exist


getLoggedInUserName

public abstract java.lang.String getLoggedInUserName()
Returns something like "Logged in as: user@gmail.com"


setToken

public void setToken(java.lang.String setting)
Sets the authentication token. Set to null to clear.


getLastSyncDate

public long getLastSyncDate()
Returns:
Last Successful Sync Date, or 0

getLastAttemptedSyncDate

public long getLastAttemptedSyncDate()
Returns:
Last Attempted Sync Date, or 0 if it was successful

getLastError

public java.lang.String getLastError()
Returns:
Last Error, or null if no last error

isOngoing

public boolean isOngoing()
Returns:
Last Error, or null if no last error

clearLastSyncDate

public void clearLastSyncDate()
Deletes Last Successful Sync Date


setLastError

public void setLastError(java.lang.String error)
Set Last Successful Sync Date


stopOngoing

public void stopOngoing()
Set Ongoing


recordSuccessfulSync

public void recordSuccessfulSync()
Set Last Successful Sync Date


recordSyncStart

public void recordSyncStart()
Set Last Attempted Sync Date


getSyncAutoSyncFrequency

public int getSyncAutoSyncFrequency()
Reads the frequency, in seconds, auto-sync should occur.

Returns:
seconds duration, or 0 if not desired