|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.javagroups.Header | +--org.javagroups.service.lease.LeaseRequestHeader
Message header that represents lease request. Request has type. Requests for new lease or renew lease contain desired lease duration and entity requesting the lease, cancel requests does not contain lease duration, only entity cancelling lease. Resource identifier is sent as message payload.
Field Summary | |
---|---|
static int |
CANCEL_LEASE_REQUEST
|
static java.lang.String |
HEADER_KEY
|
static int |
NEW_LEASE_REQUEST
|
static int |
RENEW_LEASE_REQUEST
|
Fields inherited from class org.javagroups.Header |
---|
HDR_OVERHEAD |
Constructor Summary | |
---|---|
LeaseRequestHeader()
Constructs empty header. |
|
LeaseRequestHeader(int headerType,
long duration,
boolean isAbsolute,
java.lang.Object tenant)
Create lease request header of the specified type with specified duration. |
Method Summary | |
---|---|
long |
getDuration()
Get requested duration of a lease. |
java.lang.Object |
getTenant()
Get identifier of an object that requests the lease. |
int |
getType()
Get type of lease request. |
boolean |
isAbsolute()
Check if duration is relative or absolute. |
void |
readExternal(java.io.ObjectInput in)
Read state of this object from object input stream. |
void |
writeExternal(java.io.ObjectOutput out)
Write state of this object into object output stream. |
Methods inherited from class org.javagroups.Header |
---|
size, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String HEADER_KEY
public static final int NEW_LEASE_REQUEST
public static final int RENEW_LEASE_REQUEST
public static final int CANCEL_LEASE_REQUEST
Constructor Detail |
public LeaseRequestHeader()
Externalizable
implementation. If object was created using this method, there is no
other way to initialize this object except using
readExternal(ObjectInput)
method.
public LeaseRequestHeader(int headerType, long duration, boolean isAbsolute, java.lang.Object tenant)
Method Detail |
public int getType()
public long getDuration()
CANCEL_LEASE_REQUEST
value is ignored.
public boolean isAbsolute()
CANCEL_LEASE_REQUEST
value is ignored.
true
if duration is absolute, otherwise
false
.public java.lang.Object getTenant()
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
java.io.IOException
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |