org.psepr.jClient
Class PayloadLease
java.lang.Object
org.psepr.jClient.Payload
org.psepr.jClient.PayloadLease
- All Implemented Interfaces:
- PayloadParser
public class PayloadLease
- extends Payload
- implements PayloadParser
- Author:
- Robert.Adams@intel.com
|
Constructor Summary |
PayloadLease()
|
PayloadLease(java.lang.String ns)
|
PayloadLease(java.lang.String li,
java.lang.String lt,
java.lang.String lo,
long ld)
Create an initialized lease payload. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
leaseNamespace
public static final java.lang.String leaseNamespace
- See Also:
- Constant Field Values
leaseOpRegister
public static final java.lang.String leaseOpRegister
- See Also:
- Constant Field Values
leaseOpUnregister
public static final java.lang.String leaseOpUnregister
- See Also:
- Constant Field Values
leaseOpLease
public static final java.lang.String leaseOpLease
- See Also:
- Constant Field Values
PayloadLease
public PayloadLease()
PayloadLease
public PayloadLease(java.lang.String ns)
- Parameters:
ns -
PayloadLease
public PayloadLease(java.lang.String li,
java.lang.String lt,
java.lang.String lo,
long ld)
- Create an initialized lease payload.
- Parameters:
li - lease identifier (arbritrary alpha/numeric stringlt - type of messages we want to receive with this leaselo - operation: one of 'register', 'unregister'ld - duration of the requested lease in seconds
getLeaseIdentifier
public java.lang.String getLeaseIdentifier()
setLeaseIdentifier
public void setLeaseIdentifier(java.lang.String li)
getLeaseType
public java.lang.String getLeaseType()
setLeaseType
public void setLeaseType(java.lang.String lt)
getLeaseOp
public java.lang.String getLeaseOp()
setLeaseOp
public void setLeaseOp(java.lang.String lo)
getLeaseDuration
public long getLeaseDuration()
setLeaseDuration
public void setLeaseDuration(long ld)
parsePayload
public Payload parsePayload(java.lang.String ns,
org.xmlpull.v1.XmlPullParser parser)
- Parse the lease payload. We come in here with the parser positioned
on the element and we will exit with the parser positioned
on the element.
The routine will check to see if this is a namespace that it knows
how to parse. If not, null is returned. If it is, the payload will
be parsed the the proper payload object returned. Because of the
way the parser works, if anything goes wrong with the parsing, the
event becomes unparsable.
This is signaled by this routine throwing a PsEPRException.
- Specified by:
parsePayload in interface PayloadParser
- Parameters:
ns - the namespace of the payloadparser - the XML parser positioned at the payload element
- Returns:
- the parsed payload or null if no payload was parsed. If null is returned,
the parser's position will not have been moved.
- Throws:
PsEPRException - if parsing fails. Event is unusable after this.- See Also:
PayloadParser.parsePayload(java.lang.String, org.xmlpull.v1.XmlPullParser)
toXML
public java.lang.String toXML()
- Description copied from class:
Payload
- return the XML that represents the payload. This is the complete
payload element beginning and ending with ....
- Overrides:
toXML in class Payload
- Returns:
- XML of the complete payload