-
-
Save secondsun/df6724e89d7ae06cbb64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface SynchronizeEventListener<T> { | |
/** | |
* This is called whenever the underlying Synchronizer has new data. | |
* | |
* @param newData | |
*/ | |
void dataUpdated(T newData); | |
/** | |
* | |
* This is called when there is a data conflict. | |
* | |
* The system will save the returned data. | |
* | |
* @param clientData | |
* @param serverData | |
* @return | |
*/ | |
T resolveConflicts(T clientData, T serverData); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Synchronizer<T> { | |
/** | |
* A listener listens for data on this synchronizer. | |
* | |
* @param listener | |
*/ | |
public void addListener(SynchronizeEventListener<T> listener); | |
/** | |
* A listener listens for data on this synchronizer. | |
* | |
* @param listener | |
*/ | |
public void removeListener(SynchronizeEventListener<T> listener); | |
/** | |
* Does what ever is necessary to start syncing | |
*/ | |
public void beginSync(Context appContext); | |
/** | |
* Sync no more | |
*/ | |
public void syncNoMore(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment