chat
Class ChatCallback

java.lang.Object
  extended by chat.ChatCallback
All Implemented Interfaces:
IOAcknowledge, IOCallback

public class ChatCallback
extends java.lang.Object
implements IOCallback, IOAcknowledge


Constructor Summary
ChatCallback(ChatCallbackAdapter callback)
           
 
Method Summary
 void ack(java.lang.Object... data)
          Acknowledges a socket.io message.
 void on(java.lang.String event, IOAcknowledge ack, java.lang.Object... data)
          On [Event].
 void onConnect()
          On connect.
 void onDisconnect()
          On disconnect.
 void onError(SocketIOException socketIOException)
          On error.
 void onMessage(org.json.JSONObject json, IOAcknowledge ack)
          On message.
 void onMessage(java.lang.String message, IOAcknowledge ack)
          On message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChatCallback

public ChatCallback(ChatCallbackAdapter callback)
Method Detail

ack

public void ack(java.lang.Object... data)
Description copied from interface: IOAcknowledge
Acknowledges a socket.io message.

Specified by:
ack in interface IOAcknowledge
Parameters:
data - may be all types which can be serialized by JSONArray.put(Object)

on

public void on(java.lang.String event,
               IOAcknowledge ack,
               java.lang.Object... data)
Description copied from interface: IOCallback
On [Event]. Called when server emits an event.

Specified by:
on in interface IOCallback
Parameters:
event - Name of the event
ack - an IOAcknowledge instance, may be null if there's none
data - Arguments of the event

onMessage

public void onMessage(java.lang.String message,
                      IOAcknowledge ack)
Description copied from interface: IOCallback
On message. Called when the server sends String data.

Specified by:
onMessage in interface IOCallback
Parameters:
message - the data.
ack - an IOAcknowledge instance, may be null if there's none

onMessage

public void onMessage(org.json.JSONObject json,
                      IOAcknowledge ack)
Description copied from interface: IOCallback
On message. Called when the server sends JSON data.

Specified by:
onMessage in interface IOCallback
Parameters:
json - JSON object sent by server.
ack - an IOAcknowledge instance, may be null if there's none

onConnect

public void onConnect()
Description copied from interface: IOCallback
On connect. Called when the socket becomes ready so it is now able to receive data

Specified by:
onConnect in interface IOCallback

onDisconnect

public void onDisconnect()
Description copied from interface: IOCallback
On disconnect. Called when the socket disconnects and there are no further attempts to reconnect

Specified by:
onDisconnect in interface IOCallback

onError

public void onError(SocketIOException socketIOException)
Description copied from interface: IOCallback
On error. Called when socket is in an undefined state. No reconnect attempts will be made.

Specified by:
onError in interface IOCallback
Parameters:
socketIOException - the last exception describing the error