edu.uiuc.cs.net.DPRPManager
Class DPRPLeaseEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--edu.uiuc.cs.net.DPRPManager.DPRPLeaseEvent
All Implemented Interfaces:
java.io.Serializable

public class DPRPLeaseEvent
extends java.util.EventObject

Represents a "Lease Event", which can either be lease creation, updation (?), or deletion. Additionally, for each type of lease event, there is a certain sub-type -- wheather or not this event represents a success or a failure.

Version:
1.1 - October 29th, 2001
Author:
Andy Reitz (areitz@cs.uiuc.edu)
See Also:
Serialized Form

Field Summary
protected  short errorcode
          The details about the error; only set when isError is true.
protected  boolean isError
          True if this event represents an error of some kind.
protected  boolean isNew
          True if this lease is genuinely new, false otherwise.
protected  char leaseCommand
          A letter-code giving a reason why this event was fired.
protected  DPRPLease sentLease
          The DPRPLease object that we are sending.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DPRPLeaseEvent(java.lang.Object so, DPRPLease lea, char reason)
          Creates a new DPRPLeaseEvent object, for notifying the controller of a "lease change event".
 
Method Summary
 char getCommand()
          Returns the reason that this event was fired.
 short getErrorcode()
          Gets the errorcode contained in this event.
 DPRPLease getLease()
          Returns the lease that is attached to this event.
 boolean isError()
          Checks to see if this is an error event.
 boolean isNew()
          Checks to see if this is an event for a newly-created lease.
 void markAsError()
          Marks this event as an error event.
 void markAsOld()
          Sets this lease to appear "not so new", as such.
static java.lang.String resolveLeaseCommand(char cmd)
          Stupid debugging method, used in-conjunction with this DPRPLeaseListener stuffs.
 void setCommand(char co)
          Sets the reason for firing this event.
 void setErrorcode(short e)
          Gives this event an errorcode to transmit.
 void setLease(DPRPLease l)
          Attaches a lease to this event.
 void setSource(java.lang.Object sou)
          Highly experimental and inflammatory.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

sentLease

protected DPRPLease sentLease
The DPRPLease object that we are sending.

leaseCommand

protected char leaseCommand
A letter-code giving a reason why this event was fired. This is really for the JTable's benefit, mostly.

isError

protected boolean isError
True if this event represents an error of some kind.

isNew

protected boolean isNew
True if this lease is genuinely new, false otherwise.

errorcode

protected short errorcode
The details about the error; only set when isError is true.
Constructor Detail

DPRPLeaseEvent

public DPRPLeaseEvent(java.lang.Object so,
                      DPRPLease lea,
                      char reason)
Creates a new DPRPLeaseEvent object, for notifying the controller of a "lease change event".
Parameters:
so - A reference to the source of this event.
lea - A reference to the lease to be sent in the event.
reason - A control code, designating the type of event.
Method Detail

setSource

public void setSource(java.lang.Object sou)
Highly experimental and inflammatory.

getLease

public DPRPLease getLease()
Returns the lease that is attached to this event.

setLease

public void setLease(DPRPLease l)
Attaches a lease to this event.

getCommand

public char getCommand()
Returns the reason that this event was fired.

setCommand

public void setCommand(char co)
Sets the reason for firing this event.

markAsError

public void markAsError()
Marks this event as an error event.

isError

public boolean isError()
Checks to see if this is an error event.

getErrorcode

public short getErrorcode()
Gets the errorcode contained in this event.

setErrorcode

public void setErrorcode(short e)
Gives this event an errorcode to transmit.

isNew

public boolean isNew()
Checks to see if this is an event for a newly-created lease.

markAsOld

public void markAsOld()
Sets this lease to appear "not so new", as such.

resolveLeaseCommand

public static java.lang.String resolveLeaseCommand(char cmd)
Stupid debugging method, used in-conjunction with this DPRPLeaseListener stuffs.