io.socket
Class IOMessage

java.lang.Object
  extended by io.socket.IOMessage

 class IOMessage
extends java.lang.Object

The Class IOMessage.


Field Summary
static int FIELD_DATA
          Index of the data field in a message
static int FIELD_ENDPOINT
          Index of the end point field in a message
static int FIELD_ID
          Index of the id field in a message
static int FIELD_TYPE
          Index of the type field in a message
static int NUM_FIELDS
          Number of fields in a message.
static int TYPE_ACK
          Message type acknowledge
static int TYPE_CONNECT
          Message type connect
static int TYPE_DISCONNECT
          Message type disconnect
static int TYPE_ERROR
          Message type error
static int TYPE_EVENT
          Message type event
static int TYPE_HEARTBEAT
          Message type heartbeat
static int TYPE_JSON_MESSAGE
          Message type JSON message
static int TYPE_MESSAGE
          Message type message
static int TYPE_NOOP
          Message type noop
 
Constructor Summary
IOMessage(int type, java.lang.String namespace, java.lang.String data)
          Instantiates a new IOMessage by given data.
IOMessage(int type, java.lang.String id, java.lang.String namespace, java.lang.String data)
          Instantiates a new IOMessage by given data.
IOMessage(java.lang.String message)
          Instantiates a new IOMessage from a String representation.
 
Method Summary
 java.lang.String getData()
          Returns the data of this IOMessage.
 java.lang.String getEndpoint()
          Returns the endpoint of this IOMessage.
 java.lang.String getId()
          Returns the id of this IOMessage.
 int getType()
          Returns the type of this IOMessage.
 void setId(java.lang.String id)
          Sets the id of this IOMessage
 java.lang.String toString()
          Generates a String representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_DISCONNECT

public static final int TYPE_DISCONNECT
Message type disconnect

See Also:
Constant Field Values

TYPE_CONNECT

public static final int TYPE_CONNECT
Message type connect

See Also:
Constant Field Values

TYPE_HEARTBEAT

public static final int TYPE_HEARTBEAT
Message type heartbeat

See Also:
Constant Field Values

TYPE_MESSAGE

public static final int TYPE_MESSAGE
Message type message

See Also:
Constant Field Values

TYPE_JSON_MESSAGE

public static final int TYPE_JSON_MESSAGE
Message type JSON message

See Also:
Constant Field Values

TYPE_EVENT

public static final int TYPE_EVENT
Message type event

See Also:
Constant Field Values

TYPE_ACK

public static final int TYPE_ACK
Message type acknowledge

See Also:
Constant Field Values

TYPE_ERROR

public static final int TYPE_ERROR
Message type error

See Also:
Constant Field Values

TYPE_NOOP

public static final int TYPE_NOOP
Message type noop

See Also:
Constant Field Values

FIELD_TYPE

public static final int FIELD_TYPE
Index of the type field in a message

See Also:
Constant Field Values

FIELD_ID

public static final int FIELD_ID
Index of the id field in a message

See Also:
Constant Field Values

FIELD_ENDPOINT

public static final int FIELD_ENDPOINT
Index of the end point field in a message

See Also:
Constant Field Values

FIELD_DATA

public static final int FIELD_DATA
Index of the data field in a message

See Also:
Constant Field Values

NUM_FIELDS

public static final int NUM_FIELDS
Number of fields in a message.

See Also:
Constant Field Values
Constructor Detail

IOMessage

public IOMessage(int type,
                 java.lang.String id,
                 java.lang.String namespace,
                 java.lang.String data)
Instantiates a new IOMessage by given data.

Parameters:
type - the type
id - the id
namespace - the namespace
data - the data

IOMessage

public IOMessage(int type,
                 java.lang.String namespace,
                 java.lang.String data)
Instantiates a new IOMessage by given data.

Parameters:
type - the type
namespace - the name space
data - the data

IOMessage

public IOMessage(java.lang.String message)
Instantiates a new IOMessage from a String representation. If the String is not well formated, the result is undefined.

Parameters:
message - the message
Method Detail

toString

public java.lang.String toString()
Generates a String representation of this object.

Overrides:
toString in class java.lang.Object

getType

public int getType()
Returns the type of this IOMessage.

Returns:
the type

getId

public java.lang.String getId()
Returns the id of this IOMessage.

Returns:
the id

setId

public void setId(java.lang.String id)
Sets the id of this IOMessage

Parameters:
id -

getEndpoint

public java.lang.String getEndpoint()
Returns the endpoint of this IOMessage.

Returns:
the endpoint

getData

public java.lang.String getData()
Returns the data of this IOMessage.

Returns:
the data