orca.shirako.api
Interface IResourceReservation

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

public interface IResourceReservation
extends IReservation

IResourceReservation extends IReservation with the notions of resource and term.


Field Summary
 
Fields inherited from interface orca.shirako.api.IReservation
CategoryAll, CategoryAuthority, CategoryBroker, CategoryClient, PropertyClass, PropertyID
 
Method Summary
 void count(ResourceCount rc, java.util.Date when)
          Tallies up resources in the reservation.
 void fail(java.lang.String message)
          Marks an operation failure.
 void fail(java.lang.String message, java.lang.Exception e)
          Marks an operation failure.
 void failWarn(java.lang.String message)
          Marks an operation failure.
 int forecastUnits(java.util.Date when)
          Estimates the resource units controlled by the reservation at some time which may be in the future.
 ResourceSet getApprovedResources()
          Returns the resources approved for this reservation by the last policy decision.
 Term getApprovedTerm()
          Returns the term approved for the reservation by the last policy decision.
 ResourceType getApprovedType()
          Returns the resource type approved for this reservation by the last policy decision.
 int getApprovedUnits()
          Returns the number of units approved by the last policy decision.
 int getLeasedAbstractUnits()
          Returns the number of abstract units leased by the reservation.
 int getLeasedUnits()
          Returns the number of concrete units leased by the reservation.
 ResourceSet getPreviousResources()
          Returns the resources represented by/allocated to the reservation at the time before the last update.
 Term getPreviousTerm()
          Returns the previously allocated term for the reservation.
 ResourceSet getRequestedResources()
          Returns the resources requested for the reservation.
 Term getRequestedTerm()
          Returns the last requested term.
 ResourceType getRequestedType()
          Returns the requested resource type.
 int getRequestedUnits()
          Returns the number of requested units.
 ResourceSet getResources()
          Returns the resources represented by/allocated to the reservation.
 Term getTerm()
          Returns the currently allocated term for the reservation.
 ResourceType getType()
          Returns the resource type allocated to the reservation.
 int getUnits()
          Returns the currently assigned resource units.
 long holding(java.util.Date when)
          Returns the resource units known committed to the reservation at some time which may be in the future.
 boolean isApproved()
          Checks if the policy has made a decision for the reservation.
 boolean isBidPending()
          Returns marker value set by setBidPending.
 boolean isRenewable()
          Checks if the reservation is renewable.
 void setApproved()
          Indicates that the policy has made a decision for the reservation.
 void setApproved(Term approvedTerm, ResourceSet approvedResources)
          Sets the term and resources approved by the policy.
 void setApprovedResources(ResourceSet approvedResources)
          Sets the resources approved for this reservation by the policy.
 void setApprovedTerm(Term term)
          Sets the term approved for the
 void setBidPending(boolean inbid)
          Sets marker for whether this reservation is awaiting some external action such as an auction before it can complete a request.
 
Methods inherited from interface orca.shirako.api.IReservation
awaitActive, awaitClosed, awaitTicketed, clearDirty, getActor, getCategory, getCloseTime, getPendingState, getPendingStateName, getPreviousReservationState, getReservationID, getReservationState, getSlice, getState, getStateName, hasUncommittedTransition, isDirty, registerListener, setCloseTime, setDirty, setSlice, unregisterListener
 
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
 

Method Detail

count

void count(ResourceCount rc,
           java.util.Date when)
Tallies up resources in the reservation.

Note: "just a hint" unless the kernel lock is held. An exception to our rule of not touching ResourceSet fields. Determines count based on time.

Parameters:
ResourceCount - holder for counts

forecastUnits

int forecastUnits(java.util.Date when)
Estimates the resource units controlled by the reservation at some time which may be in the future.

Parameters:
when - the date to forecast
Returns:
number of resources units controlled by the reservation

holding

long holding(java.util.Date when)
Returns the resource units known committed to the reservation at some time which may be in the future.

Parameters:
then - the date to forecast
Returns:
unit forecast

fail

void fail(java.lang.String message)
Marks an operation failure. Transitions the reservation to the failed state and logs the message as an error.
NoteDoes not throw exception.

Parameters:
message - the error message

fail

void fail(java.lang.String message,
          java.lang.Exception e)
Marks an operation failure. Transitions the reservation to the failed state and logs the message as an error.
NoteDoes not throw exception.

Parameters:
message - the error message
e - The exception

failWarn

void failWarn(java.lang.String message)
Marks an operation failure. Transitions the reservation to the failed state and logs the message as an error.
NoteDoes not throw exception.

Parameters:
message - the error message

getPreviousResources

ResourceSet getPreviousResources()
Returns the resources represented by/allocated to the reservation at the time before the last update. Can be null.

Returns:
resource represented by the reservation at the time before the last update. Can be null.

getResources

ResourceSet getResources()
Returns the resources represented by/allocated to the reservation. If no resources have yet been allocated to the reservation, this method will return null.

Returns:
resources represented by the reservation. null if no resources have been allocated to the reservation.

getRequestedResources

ResourceSet getRequestedResources()
Returns the resources requested for the reservation. If the kernel has not yet issued the resource request this method will return null.

Returns:
resources requested for the reservation. null if no request has been made yet.

getApprovedResources

ResourceSet getApprovedResources()
Returns the resources approved for this reservation by the last policy decision. If the policy has never made a decision about the reservation, this method will return null.

Returns:
resources last approved for the reservation. null if no resources have ever been approved.

setApprovedResources

void setApprovedResources(ResourceSet approvedResources)
Sets the resources approved for this reservation by the policy.

Parameters:
approvedResources - resources the policy approved

getTerm

Term getTerm()
Returns the currently allocated term for the reservation. If no resources have yet been allocated, this method will return null.

Returns:
currently allocated term. null if resources have not yet been allocated.

getPreviousTerm

Term getPreviousTerm()
Returns the previously allocated term for the reservation. Can be null.

Returns:
previously allocated term. null if reservation has not yet been extended.

getRequestedTerm

Term getRequestedTerm()
Returns the last requested term. If the kernel has not yet issued the resource request this method will return null.

Returns:
last requested term. null if no request has been made yet.

getApprovedTerm

Term getApprovedTerm()
Returns the term approved for the reservation by the last policy decision. If the policy has never made a decision about the reservation, this method will return null.

Returns:
term last approved for the reservation. null if no resources have ever been approved.

setApprovedTerm

void setApprovedTerm(Term term)
Sets the term approved for the

Parameters:
term -

getType

ResourceType getType()
Returns the resource type allocated to the reservation. If no resources have yet been allocated to the reservation, this method will return null.

Returns:
resource type allocated to the reservation. null if no resources have been allocated to the reservation.

getRequestedType

ResourceType getRequestedType()
Returns the requested resource type.

Returns:
requested resource type

getApprovedType

ResourceType getApprovedType()
Returns the resource type approved for this reservation by the last policy decision. If the policy has never made a decision about the reservation, this method will return null.

Returns:
resource type last approved for the reservation. null if no resources have ever been approved.

getUnits

int getUnits()
Returns the currently assigned resource units. If the reservation has not yet been assigned units, the method will return 0.

Returns:
number of assigned resource units

getRequestedUnits

int getRequestedUnits()
Returns the number of requested units. If no units have yet been requested, the method will return 0.

Returns:
number of requested units

getApprovedUnits

int getApprovedUnits()
Returns the number of units approved by the last policy decision. If the policy has never made a decision about this reservation, the method will return 0.

Returns:
number of units approved by the last policy decision

getLeasedUnits

int getLeasedUnits()
Returns the number of concrete units leased by the reservation. If the reservation does not represent leased resources or has not yet leased any resources, e.g., holds only a ticket, the method will return 0.

Note: This call will always return 0 for reservations that have not recreated their concrete sets, e.g., reservations fetched from the database as a result of a query. For such reservations use #getLeasedAbstractUnits() or obtain the actual reservation object.

Returns:
number of leased units

getLeasedAbstractUnits

int getLeasedAbstractUnits()
Returns the number of abstract units leased by the reservation. If the reservation does not represent leased resources or has not yet leased any resources, e.g., holds only a ticket, the method will return 0.

Returns:
number of abstract units leased

setApproved

void setApproved(Term approvedTerm,
                 ResourceSet approvedResources)
Sets the term and resources approved by the policy. Marks the approved flag.

Parameters:
approvedTerm - term the policy approved
approvedResources - resources the policy approved

setApproved

void setApproved()
Indicates that the policy has made a decision for the reservation.


isApproved

boolean isApproved()
Checks if the policy has made a decision for the reservation.

Returns:
true if the policy has made a decision for the reservation

setBidPending

void setBidPending(boolean inbid)
Sets marker for whether this reservation is awaiting some external action such as an auction before it can complete a request.

Parameters:
inbid - true if waiting, false otherwise

isBidPending

boolean isBidPending()
Returns marker value set by setBidPending.

Returns:
marker: true if awaiting policy decision

isRenewable

boolean isRenewable()
Checks if the reservation is renewable.

Returns:
true if the reservation is renewable


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