|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object aigames.soccer.application.Message
This class describes message passed from communication module. It should be compatible with AI Soccer protocol.
Field Summary | |
static int |
CONFIRMATION
CONFIRMATION message type |
static int |
GAME_OVER
GAME_OVER message type |
static int |
HELLO
HELLO message type |
static int |
LOG
LOG message type |
static int |
MOVE
MOVE message type |
static int |
PARAMS
PARAMS message type |
static int |
UNKNOWN
UNKNOWN message type |
Constructor Summary | |
Message(UserId userId,
org.dom4j.Document message)
Message constructor. |
Method Summary | |
java.lang.String |
getLastValidationReason()
Returns validation result - can be used after calling validate(Validator) method. |
org.dom4j.Document |
getMessage()
Returns Document with message body. |
int |
getMessageId()
Returns unique message id. |
java.lang.String |
getMessageIdAsString()
Returns string representation of user id. |
int |
getMessageType()
Return message type. |
Move |
getMove()
Returns move. |
java.util.Date |
getSendDate()
Returns date when the message was sent. |
UserId |
getUserId()
Returns user id of a user which send the message. |
void |
incResendCounter()
Increases counter which shows how many times message was resend. |
void |
setSendDate(java.util.Date sendDate)
Sets message send date. |
boolean |
validate(Validator validator)
Validates message with given validator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int HELLO
public static final int MOVE
public static final int PARAMS
public static final int LOG
public static final int GAME_OVER
public static final int CONFIRMATION
public static final int UNKNOWN
Constructor Detail |
public Message(UserId userId, org.dom4j.Document message)
userId
- Id of user which sent the message.message
- Sent message.Method Detail |
public java.lang.String getLastValidationReason()
validate(Validator)
method.
public int getMessageId()
public int getMessageType()
public org.dom4j.Document getMessage()
public boolean validate(Validator validator)
validator
- Validator that should be used to validate message.
public UserId getUserId()
public java.lang.String getMessageIdAsString()
public java.util.Date getSendDate()
public void setSendDate(java.util.Date sendDate)
sendDate
- The send date to set.public void incResendCounter()
public Move getMove()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |