|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object ReservationMessage
public class ReservationMessage
This class represents a single message exchanged between users and a resource providers to negotiate an advance reservation.
Reservation
Constructor Summary | |
---|---|
ReservationMessage(int sourceId)
Instantiates a new object. |
|
ReservationMessage(int sourceId,
int destId)
Instantiates a new object. |
|
ReservationMessage(int sourceId,
int destId,
Reservation reservation)
Instantiates a new object. |
|
ReservationMessage(int sourceId,
Reservation reservation)
Instantiates a new object. |
Method Summary | |
---|---|
ReservationMessage |
createResponse()
Creates a response for this message. |
int |
getDestinationID()
Gets the destination ID |
ErrorType |
getErrorCode()
Gets the error code of this message |
int |
getMessageID()
Gets the message's ID |
int |
getMessageSize()
Returns the size in bytes for this message. |
MessageType |
getMessageType()
Gets the message's type |
int |
getNegotiationID()
Gets the id of the reservation this message is related to |
double |
getPrice()
Returns the price |
Reservation |
getReservation()
Gets the reservation to which this message refers |
int |
getReservationID()
Gets the ID of reservation to which this message refers |
int |
getSourceID()
Gets the source id |
boolean |
setDestinationID(int destId)
Sets the destination's id |
void |
setErrorCode(ErrorType code)
Sets the error code of this message |
void |
setMessageType(MessageType type)
Sets the message type |
boolean |
setPrice(double price)
Sets the price negotiated |
boolean |
setSourceID(int sourceId)
Sets the source's id |
String |
toString()
Converts the negotiation message to a String. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ReservationMessage(int sourceId, int destId)
sourceId
- the id of entity that is the source of this messagedestId
- the id of the entity that is the recipient of this message
IllegalArgumentException
- is thrown if the IDs are < 0public ReservationMessage(int sourceId)
sourceId
- the id of entity that is the source of this message
IllegalArgumentException
- is thrown if the ID is < 0public ReservationMessage(int sourceId, Reservation reservation)
sourceId
- the id of entity that is the source of this messagereservation
- the reservation to which this message refers
IllegalArgumentException
- is thrown if the IDs are < 0 or
the reservation object is null
public ReservationMessage(int sourceId, int destId, Reservation reservation)
sourceId
- the id of entity that is the source of this messagedestId
- the id of the entity that is the recipient of this messagereservation
- the reservation to which this message refers
IllegalArgumentException
- is thrown if the IDs are < 0 or
the reservation object is null
Method Detail |
---|
public boolean setSourceID(int sourceId)
sourceId
- the id of the source entity
true
if it has been set successfully;
false
otherwisepublic boolean setDestinationID(int destId)
destId
- the id of the destination entity
true
if it has been set successfully;
false
otherwisepublic void setMessageType(MessageType type)
type
- the message typepublic void setErrorCode(ErrorType code)
code
- the error codepublic int getSourceID()
public int getDestinationID()
public int getMessageID()
public MessageType getMessageType()
public ErrorType getErrorCode()
public Reservation getReservation()
public int getReservationID()
-1
if not foundpublic int getNegotiationID()
-1
if the reservation is unknownpublic boolean setPrice(double price)
price
- the price negotiated
true
if successfully or false
otherwisepublic double getPrice()
public int getMessageSize()
public ReservationMessage createResponse()
public String toString()
toString
in class Object
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |