org.psepr.jClient
Class PsEPRLease

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

public class PsEPRLease
extends java.lang.Object

Manage a lease on a channel. This deals with the "internal" part of the lease -- the parsing, reception and management of the lease. One of these is created for each of the user's leases and this holds the objects that are parsing, receiving and managing the lease. * @author Robert.Adams@intel.com


Constructor Summary
PsEPRLease()
           
PsEPRLease(java.lang.String chan, PayloadParser xpp, EventReceiver xpr, LeaseManager lm)
          Create a new lease.
 
Method Summary
 java.lang.String getChannel()
           
 EventReceiver getEventReceiver()
           
 LeaseManager getLeaseManager()
           
 java.lang.String getNamespace()
           
 PayloadParser getPayloadParser()
           
 Payload parsePayload(java.lang.String ns, org.xmlpull.v1.XmlPullParser parser)
          Called by the connection for every message that comes in.
 boolean receiveEvent(PsEPREvent ev)
           
 void setChannel(java.lang.String ch)
           
 void setEventReceiver(EventReceiver xpp)
           
 void setLeaseManager(LeaseManager xlm)
           
 void setNamespace(java.lang.String ns)
           
 void setPayloadParser(PayloadParser xpp)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PsEPRLease

public PsEPRLease()

PsEPRLease

public PsEPRLease(java.lang.String chan,
                  PayloadParser xpp,
                  EventReceiver xpr,
                  LeaseManager lm)
Create a new lease.

Parameters:
chan -
xpp -
xpr -
lm -
Method Detail

getNamespace

public java.lang.String getNamespace()

setNamespace

public void setNamespace(java.lang.String ns)

getChannel

public java.lang.String getChannel()

setChannel

public void setChannel(java.lang.String ch)

getPayloadParser

public PayloadParser getPayloadParser()

setPayloadParser

public void setPayloadParser(PayloadParser xpp)

getEventReceiver

public EventReceiver getEventReceiver()

setEventReceiver

public void setEventReceiver(EventReceiver xpp)

getLeaseManager

public LeaseManager getLeaseManager()

setLeaseManager

public void setLeaseManager(LeaseManager xlm)

parsePayload

public Payload parsePayload(java.lang.String ns,
                            org.xmlpull.v1.XmlPullParser parser)
Called by the connection for every message that comes in. We see if it's for us and return the parsed payload if so.

Parameters:
ns - the namespace found in the payload element
parser - pointed into the payload element. Returned after.
Returns:
a Payload object or 'null' if we didn't parse it

receiveEvent

public boolean receiveEvent(PsEPREvent ev)