com.funambol.push
Class SyncScheduler

java.lang.Object
  extended by com.funambol.push.SyncScheduler

public class SyncScheduler
extends java.lang.Object

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

SyncScheduler

public SyncScheduler(SyncSchedulerListener ssListener)
Construct a scheduler with the given listener.

Parameters:
ssListener - the listener. This cannot be null otherwise NPE exceptions will be generated when trying to fire a sync
Method Detail

addRequest

public void addRequest(SyncRequest syncRequest)
Add a sync request to the SyncScheduler.

Parameters:
syncRequest - object to be added

setListener

public void setListener(SyncSchedulerListener ssListener)
Set a Listener to the SyncScheduler.

Parameters:
listenet - to be added


Copyright © 2001-2009 Funambol.