|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Thread Sim_entity GridSimCore GridSim ReservationRequester
public class ReservationRequester
This class represents an entity that makes advance reservation requests. This entity initiates operations such as such as create, modify, cancel and query.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class GridSim |
---|
GRIDSIM_VERSION_STRING, PAUSE |
Fields inherited from class GridSimCore |
---|
input, NETWORK_TYPE, output |
Fields inherited from class Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
protected |
ReservationRequester(String name,
double baudRate)
Allocates a new object. |
protected |
ReservationRequester(String name,
Link link)
Allocates a new object. |
Method Summary | |
---|---|
boolean |
cancelReservation(int reservationId)
Cancels a given reservation. |
boolean |
commitReservation(int reservId)
Commits a reservation indicating that the user is willing to used it. |
Reservation |
createReservation(double startTime,
int duration,
int numPE,
int resID)
Creates a new reservation and sends the request to a resource. Immediate reservation can be used by this method by specifying startTime = 0, meaning do not care about start time or use current time as a reservation's start time. |
protected Reservation |
getReservation(int reservationId)
Gets a reservation object based on the given booking ID |
Reservation |
modifyReservation(int reservationId,
double startTime,
int duration,
int numPE)
Modifies an existing reservation. |
Collection<TimeSlot> |
queryFreeTime(double startTime,
int duration,
int resID)
Queries to a resource regarding to list of free time during a period of time. |
ReservationStatus |
queryReservation(int reservationId)
Queries the overall status of a reservation. |
protected ReservationMessage |
sendReservationMessage(ReservationMessage message)
Sends a reservation message and waits for a response. |
Methods inherited from class GridSimCore |
---|
finalizeGridSimulation, getLink, getPingResult, isNetworked, ping, ping, ping, ping, pingBlockingCall, pingBlockingCall, pingBlockingCall, pingBlockingCall, send, send, send, send, send, send, setBackgroundTraffic, setBackgroundTraffic, terminateIOEntities |
Methods inherited from class Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected ReservationRequester(String name, double baudRate) throws Exception
name
- this entity namebaudRate
- the bandwidth of this entity
Exception
- This happens when one of the following scenarios occur:
null
or empty
protected ReservationRequester(String name, Link link) throws Exception
name
- this entity namelink
- the link that this GridSim entity will use to communicate
with other GridSim or Network entities.
Exception
- This happens when one of the following scenarios occur:
null
or empty
Method Detail |
---|
protected Reservation getReservation(int reservationId)
reservationId
- a reservation booking ID
null
if an error occurspublic Reservation createReservation(double startTime, int duration, int numPE, int resID)
startTime
- reservation start time in secondsduration
- reservation end time in secondsnumPE
- number of PEs required for this reservationresID
- a resource ID
public boolean cancelReservation(int reservationId)
reservationId
- the id of the reservation to be cancelled
public Collection<TimeSlot> queryFreeTime(double startTime, int duration, int resID)
resID
- a resource IDstartTime
- the simulation start time in which
the requester is interestedduration
- duration time in seconds
public ReservationStatus queryReservation(int reservationId)
reservationId
- this reservation booking ID
public boolean commitReservation(int reservId)
reservId
- a reservation booking ID
true
if commit was successful; false
otherwise.public Reservation modifyReservation(int reservationId, double startTime, int duration, int numPE)
reservationId
- reservation booking IdstartTime
- reservation start time in secondsduration
- reservation end time in secondsnumPE
- number of PEs required for this reservation
null
if an error happened during the requestprotected ReservationMessage sendReservationMessage(ReservationMessage message)
message
- the message to be sent
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |