|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javagroups.Header
org.javagroups.service.lease.LeaseResponseHeader
Message header representing service response. Presence of this header in message means that previous request succeeded. Header type determines what type of request was satisfied. If this header represents new lease or lease renewal, granted lease duration is passed within. Also each header contains entity that requested factory operation.
Field Summary | |
static java.lang.String |
HEADER_KEY
|
static int |
LEASE_CANCELED
|
static int |
LEASE_GRANTED
|
static int |
LEASE_RENEWED
|
static int |
NONE
|
Fields inherited from class org.javagroups.Header |
HDR_OVERHEAD |
Constructor Summary | |
LeaseResponseHeader()
Create uninitialized instance of this class. |
|
LeaseResponseHeader(int headerType,
long duration,
boolean isAbsolute,
java.lang.Object tenant)
Create instance of this class of type either LEASE_GRANTED
or LEASE_RENEWED . |
|
LeaseResponseHeader(int headerType,
java.lang.Object tenant)
Create instance of this class of type LEASE_CANCELED
or LEASE_RENEWED . |
Method Summary | |
long |
getDuration()
Get requested duration of a lease. |
java.lang.Object |
getTenant()
Get tenant, to which this request is addressed to. |
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. |
void |
writeExternal(java.io.ObjectOutput out)
Write state of this object into object output. |
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 NONE
public static final int LEASE_GRANTED
public static final int LEASE_RENEWED
public static final int LEASE_CANCELED
Constructor Detail |
public LeaseResponseHeader()
Externalizable
interface. There
is no other way to set state of this object except reading it from
object input using readExternal(java.io.ObjectInput)
method.
public LeaseResponseHeader(int headerType, java.lang.Object tenant)
LEASE_CANCELED
or LEASE_RENEWED
.
public LeaseResponseHeader(int headerType, long duration, boolean isAbsolute, java.lang.Object tenant)
LEASE_GRANTED
or LEASE_RENEWED
.
Method Detail |
public int getType()
public long getDuration()
public boolean isAbsolute()
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 |