orca.shirako.api
Interface IReservation

All Superinterfaces:
IRecover, IReservationStatus, ISerialize
All Known Subinterfaces:
IAuthorityReservation, IBrokerReservation, IClientReservation, IResourceReservation, IServerReservation, IServiceManagerReservation
All Known Implementing Classes:
AuthorityReservation, BrokerReservation, CodBarrierReservation, CodPredecessorReservation, CodReservation, Reservation, ReservationClient, ReservationServer, ResourceReservation

public interface IReservation
extends ISerialize, IRecover, IReservationStatus

IReservation defines the the core API for a Shirako reservation. Most of the methods described in the interface allow the programmer to inspect the state of the reservation, access some of its core objects, and wait for the occurrence of a particular event.


Field Summary
static int CategoryAll
          Unspecified reservation category.
static int CategoryAuthority
          Site authority-side reservations.
static int CategoryBroker
          Broker-side reservations.
static int CategoryClient
          Client-side reservations.
static java.lang.String PropertyClass
          Serialization property name: reservation class name.
static java.lang.String PropertyID
          Serialization property name: reservation identifier.
 
Method Summary
 void awaitActive()
          Waits for this reservation to become active.
 void awaitClosed()
          Waits for the reservation to close.
 void awaitTicketed()
          Waits for this reservation to be ticketed.
 void clearDirty()
          Marks that the reservation has no uncommitted updates and state transitions.
 IActor getActor()
          Returns the actor in control of the reservation.
 int getCategory()
          Returns the reservation category.
 long getCloseTime()
          Returns the time the reservation is scheduled to be closed.
 int getPendingState()
          Returns the current pending reservation state
 java.lang.String getPendingStateName()
          Returns the name of the current pending reservation state
 ReservationState getPreviousReservationState()
          Returns the previous composite reservation state.
 ReservationID getReservationID()
          Returns the reservation identifier.
 ReservationState getReservationState()
          Returns the current composite reservation state.
 Slice getSlice()
          Returns the slice the reservation belongs to.
 int getState()
          Returns the current reservation state.
 java.lang.String getStateName()
          Returns the name of the current reservation state.
 boolean hasUncommittedTransition()
          Checks if the reservation has uncommitted state transitions.
 boolean isDirty()
          Checks if the reservation has uncommitted updates.
 void registerListener(IStateChangeListener l)
          Registers a listener.
 void setCloseTime(long closeTime)
          Returns the time the reservation is scheduled to be closed.
 void setDirty()
          Marks the reservation as containing uncommitted updates.
 void setSlice(Slice slice)
          Sets the slice the reservation belongs to.
 void unregisterListener(IStateChangeListener l)
          Unregisters the listener.
 
Methods inherited from interface orca.shirako.api.ISerialize
reset, save, save
 
Methods inherited from interface orca.shirako.api.IRecover
revisit
 
Methods inherited from interface orca.shirako.api.IReservationStatus
isActive, isActiveTicketed, isClosed, isClosing, isExpired, isExpired, isExtended, isExtendingLease, isExtendingTicket, isFailed, isNascent, isNoPending, isPriming, isRedeeming, isTerminal, isTicketed, isTicketing, setExpired
 

Field Detail

CategoryAll

static final int CategoryAll
Unspecified reservation category.

See Also:
Constant Field Values

CategoryClient

static final int CategoryClient
Client-side reservations.

See Also:
Constant Field Values

CategoryBroker

static final int CategoryBroker
Broker-side reservations.

See Also:
Constant Field Values

CategoryAuthority

static final int CategoryAuthority
Site authority-side reservations.

See Also:
Constant Field Values

PropertyID

static final java.lang.String PropertyID
Serialization property name: reservation identifier.

See Also:
Constant Field Values

PropertyClass

static final java.lang.String PropertyClass
Serialization property name: reservation class name.

See Also:
Constant Field Values
Method Detail

awaitActive

void awaitActive()
                 throws java.lang.InterruptedException
Waits for this reservation to become active.

Throws:
java.lang.InterruptedException

awaitClosed

void awaitClosed()
                 throws java.lang.InterruptedException
Waits for the reservation to close.

Throws:
java.lang.InterruptedException

awaitTicketed

void awaitTicketed()
                   throws java.lang.InterruptedException
Waits for this reservation to be ticketed.

Throws:
java.lang.InterruptedException

registerListener

void registerListener(IStateChangeListener l)
Registers a listener.

Parameters:
l - listener object

unregisterListener

void unregisterListener(IStateChangeListener l)
Unregisters the listener.

Parameters:
l - listener

getActor

IActor getActor()
Returns the actor in control of the reservation.

Returns:
the actor in control of the reservation

getSlice

Slice getSlice()
Returns the slice the reservation belongs to.

Returns:
slice the reservation belongs to

setSlice

void setSlice(Slice slice)
Sets the slice the reservation belongs to.

Parameters:
slice - slice the reservation belongs to

getCategory

int getCategory()
Returns the reservation category.

Returns:
reservation category

getReservationID

ReservationID getReservationID()
Returns the reservation identifier.

Returns:
reservation identifier

getState

int getState()
Returns the current reservation state.

Returns:
current reservation state

getStateName

java.lang.String getStateName()
Returns the name of the current reservation state.

Returns:
name of current reservation state

getPendingState

int getPendingState()
Returns the current pending reservation state

Returns:
current pending reservation state

getPendingStateName

java.lang.String getPendingStateName()
Returns the name of the current pending reservation state

Returns:
name of current pending reservation state

getReservationState

ReservationState getReservationState()
Returns the current composite reservation state.

Returns:
composite reservation state

getPreviousReservationState

ReservationState getPreviousReservationState()
Returns the previous composite reservation state.

Returns:
previous composite reservation state

isDirty

boolean isDirty()
Checks if the reservation has uncommitted updates.

Returns:
true if the reservation has uncommitted updates

hasUncommittedTransition

boolean hasUncommittedTransition()
Checks if the reservation has uncommitted state transitions.

Returns:
true if the reservation has an uncommitted transition

clearDirty

void clearDirty()
Marks that the reservation has no uncommitted updates and state transitions.


setDirty

void setDirty()
Marks the reservation as containing uncommitted updates.


getCloseTime

long getCloseTime()
Returns the time the reservation is scheduled to be closed.

Returns:
the time the reservation is scheduled to be closed

setCloseTime

void setCloseTime(long closeTime)
Returns the time the reservation is scheduled to be closed.

Parameters:
the - time the reservation is scheduled to be closed


Copyright © 2007 Network/Internet Computing Lab. All Rights Reserved.