org.jgroups.service.lease

Class DenyResponseHeader

Implemented Interfaces:
Cloneable, Externalizable

public class DenyResponseHeader
extends Header

Message header that represents deny response. This header contains denial reason and entity that requested a lease. This allows redirect response on client side to that entity.

Author:
Roman Rokytskyy (rrokytskyy@acm.org)

Field Summary

static int
CANCEL_DENIED
static String
HEADER_KEY
static int
LEASE_DENIED
static int
NONE
static int
RENEW_DENIED

Fields inherited from class org.jgroups.Header

HDR_OVERHEAD

Constructor Summary

DenyResponseHeader()
Create uninitialized instance of this class.
DenyResponseHeader(int headerType, String denialReason, Object tenant)
Create instance of this class for specified denial type and denial reason.

Method Summary

String
getDenialReason()
Get reason why lease was denied.
Object
getTenant()
Get tenant to which this response is addressed to
int
getType()
Get type of lease request.
void
readExternal(ObjectInput in)
Read state of this object from object input.
void
writeExternal(ObjectOutput out)
Write state of this object into object output.

Methods inherited from class org.jgroups.Header

size, toString

Field Details

CANCEL_DENIED

public static final int CANCEL_DENIED

Field Value:
3


HEADER_KEY

public static final String HEADER_KEY


LEASE_DENIED

public static final int LEASE_DENIED

Field Value:
1


NONE

public static final int NONE

Field Value:
0


RENEW_DENIED

public static final int RENEW_DENIED

Field Value:
2

Constructor Details

DenyResponseHeader

public DenyResponseHeader()
Create uninitialized instance of this class. This constructor is used for implementation of java.io.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.


DenyResponseHeader

public DenyResponseHeader(int headerType,
                          String denialReason,
                          Object tenant)
Create instance of this class for specified denial type and denial reason.

Method Details

getDenialReason

public String getDenialReason()
Get reason why lease was denied.


getTenant

public Object getTenant()
Get tenant to which this response is addressed to


getType

public int getType()
Get type of lease request.


readExternal

public void readExternal(ObjectInput in)
            throws IOException,
                   ClassNotFoundException
Read state of this object from object input.


writeExternal

public void writeExternal(ObjectOutput out)
            throws IOException
Write state of this object into object output.


Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.