org.jogre.common.comm
Class CommError

java.lang.Object
  extended byorg.jogre.common.comm.CommGameMessage
      extended byorg.jogre.common.comm.CommError
All Implemented Interfaces:
ITransmittable

public class CommError
extends CommGameMessage

Communications class which is used to send an error from the server to a client or vice-versa.

Version:
Alpha 0.2.3
Author:
Bob Marks

Field Summary
static int GAME_NOT_SUPPORTED
          Server doesn't support game.
static int GENERAL_ERROR
          General error.
static int SERVER_FULL
          Server full.
static int USER_ALREADY_CONNECTED
          Status code for a user is already connected.
static int USER_LOGON_INCORRECT
          Status code for a user login is incorrect (username / password).
static int USER_NOT_CONNECTED
          Status code for a user who is not connected but is trying to send a message.
 
Fields inherited from class org.jogre.common.comm.CommGameMessage
status, username, usernameTo, XML_ATT_STATUS, XML_ATT_USERNAME, XML_ATT_USERNAME_TO
 
Constructor Summary
CommError(int errorCode)
          Constructor to an error message.
CommError(XMLElement message)
          Constructor which creates a CommError object from the flatten () method of another CommError object.
 
Method Summary
 XMLElement flatten()
          This method flattens an ITransmittable object into a XMLElement which can be transmitted.
 
Methods inherited from class org.jogre.common.comm.CommGameMessage
flatten, getStatus, getUsername, getUsernameTo, isUsernameSet, isUsernameToSet, setUsername, setUsernameTo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GENERAL_ERROR

public static final int GENERAL_ERROR
General error.

See Also:
Constant Field Values

SERVER_FULL

public static final int SERVER_FULL
Server full.

See Also:
Constant Field Values

GAME_NOT_SUPPORTED

public static final int GAME_NOT_SUPPORTED
Server doesn't support game.

See Also:
Constant Field Values

USER_ALREADY_CONNECTED

public static final int USER_ALREADY_CONNECTED
Status code for a user is already connected.

See Also:
Constant Field Values

USER_NOT_CONNECTED

public static final int USER_NOT_CONNECTED
Status code for a user who is not connected but is trying to send a message.

See Also:
Constant Field Values

USER_LOGON_INCORRECT

public static final int USER_LOGON_INCORRECT
Status code for a user login is incorrect (username / password).

See Also:
Constant Field Values
Constructor Detail

CommError

public CommError(int errorCode)
Constructor to an error message.

Parameters:
errorCode -

CommError

public CommError(XMLElement message)
Constructor which creates a CommError object from the flatten () method of another CommError object.

Parameters:
message - Communication message as XML.
Method Detail

flatten

public XMLElement flatten()
Description copied from interface: ITransmittable
This method flattens an ITransmittable object into a XMLElement which can be transmitted. The object can then be recreated again using a single XMLElement parameter constructor.

Returns:
XML version of the state of an object which can be constructed again.
See Also:
ITransmittable.flatten()