|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.push.SyncScheduler
public class SyncScheduler
This class queues sync requests and perform basic requests merging that can be used for client to server push. The class provides the ability to manage a queue of requests and merge requests that are "equivalent", giving the user the ability to implement its own equivalence concept. A request is described by a SyncRequest which is a general interface that clients must implement. Each request is stored in the queue with an associated time at which the request shall be served. When a new request comes in, the scheduler checks if the this requests "contains" other requests already in the queue. In such a case the requests are combined. When requests are combined, the scheduler removes what was already in the queue, and store the new request in the proper position (depending only on its interval).
Constructor Summary | |
---|---|
SyncScheduler(SyncSchedulerListener ssListener)
Construct a scheduler with the given listener. |
Method Summary | |
---|---|
void |
addRequest(SyncRequest syncRequest)
Add a sync request to the SyncScheduler. |
void |
setListener(SyncSchedulerListener ssListener)
Set a Listener to the SyncScheduler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SyncScheduler(SyncSchedulerListener ssListener)
ssListener
- the listener. This cannot be null otherwise NPE
exceptions will be generated when trying to fire a syncMethod Detail |
---|
public void addRequest(SyncRequest syncRequest)
syncRequest
- object to be addedpublic void setListener(SyncSchedulerListener ssListener)
listenet
- to be added
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |