org.psepr.jClient
Class LeaseCollection

java.lang.Object
  extended by org.psepr.jClient.LeaseCollection

public class LeaseCollection
extends java.lang.Object

This handles the collection of leases for the connection. This abstracts the information from a data structure in the connection class into something that can be used by everyone who handles the incoming stream of messages - the parser and the queuer.

This is not used by any user of the library.

Author:
Robert.Adams@intel.com

Constructor Summary
LeaseCollection()
           
 
Method Summary
 void addLease(PsEPRLease ls)
           
 void forceRenegotiation()
          Called to force all of the leases to renegotiate.
 Payload parsePayload(java.lang.String ns, org.xmlpull.v1.XmlPullParser parser)
          Called when every payload is received.
 void receiveEvent(PsEPREvent ev)
          Called when every event is received.
 void releaseAllLeases()
           
 void releaseLease(PsEPRLease ls)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeaseCollection

public LeaseCollection()
Method Detail

addLease

public void addLease(PsEPRLease ls)

releaseLease

public void releaseLease(PsEPRLease ls)

releaseAllLeases

public void releaseAllLeases()

forceRenegotiation

public void forceRenegotiation()
Called to force all of the leases to renegotiate. This usually happens when the underlying XMPP connection has dropped and is re-establised.


parsePayload

public Payload parsePayload(java.lang.String ns,
                            org.xmlpull.v1.XmlPullParser parser)
Called when every payload is received. The caller expects this routine to find a parser for the payload and, if found, return the parsed payload. If no payload parser is found, return 'null'.

Parameters:
ns - the contents of xmlns of the payload
parser -
Returns:
the parsed payload or 'null' if no parser found

receiveEvent

public void receiveEvent(PsEPREvent ev)
Called when every event is received. This routine is to give the event to every receiver who can process it. This is not synchronized with the presumtion that lower level routines (the lease classes themselves) will handle locking.

Parameters:
ev - the PsEPREvent structure of the received event