com.funambol.push
Class SyncRequest
java.lang.Object
com.funambol.push.SyncRequest
public abstract class SyncRequest
- extends java.lang.Object
This class represents a request for synchronization that clients can ask to
the SyncScheduler.
Usually a client can generate a SyncRequest and pass it to the SyncScheduler
that will then enqueu it and trigger a sync when it is more appropriate.
A request contains two different information:
1) an opaque information which is passed to the listener once the request
expires. This is completely transparent to the APIs and just passed back
to the client.
2) a time at which the sync shall be started. This is expressed as an
interval from now.
The class is abstract an clients must extend it with the implementation of
the method "merge".
Constructor Summary |
SyncRequest(java.lang.Object syncObject,
long interval)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
contents
protected java.util.Vector contents
interval
protected long interval
SyncRequest
public SyncRequest(java.lang.Object syncObject,
long interval)
getInterval
public long getInterval()
- Returns:
- the time interval (in millisec) at which the sync shall be
started (the interval is relative to "now", the current time
getRequestContent
public java.lang.Object[] getRequestContent()
- Returns:
- the object represent the thinks to sync
addRequestContent
public void addRequestContent(java.lang.Object requestContent)
merge
public abstract SyncRequest merge(SyncRequest syncReq)
- This method checks if "this" request can be merged with another one.
It is used by the SyncScheduler to verify the possibility to delete the
old request and merge the old and the new one into a new request. Such a
new request will be rescheduled at the interval of the new request
For example if the queue contains a request to sync contacts, and
another request for contacts comes in, then the fisrt request is deleted.
- Parameters:
syncReq
- is the request already in queue
- Returns:
- a merged request if the two requests can be merged, null
otherwise
Copyright © 2001-2009 Funambol.