cca.net.jostl
Class TOCAdapter

java.lang.Object
  extended by cca.net.jostl.TOCAdapter
All Implemented Interfaces:
TOCListener, java.util.EventListener

public class TOCAdapter
extends java.lang.Object
implements TOCListener


Constructor Summary
TOCAdapter()
           
 
Method Summary
 void adminFormatStatus(int status, java.lang.String[] args)
          Event received when client attempts to change the format of their name
 void adminPasswordStatus(int status, java.lang.String[] args)
          Event received when client attempts to change their password
 void aimError(int error, java.lang.String[] args)
          Error usually happens with bad command parameters, but could sometimes be the server's fault.
 void buddyAdded(TOCBuddy buddy)
          Buddy was added successfully
 void buddyArt(TOCBuddy buddy, java.lang.String unknown)
          Info about a buddy's icon?
 void buddyAway(TOCBuddy buddy)
          Buddy is now away alert
 void buddyListReceived(java.util.Iterator buddies)
          Buddy list was received from the server.
 void buddyRemoved(java.lang.String name)
          buddy removed successfully
 void buddyReturned(TOCBuddy buddy)
          Buddy returned from away status
 void buddySignedOff(TOCBuddy buddy)
          Buddy signed off alert
 void buddySignedOn(TOCBuddy buddy)
          Buddy signed on alert
 void chatroomDropped(java.lang.String chatroomID)
          Client was dropped from chatroom, either kicked, connection dropped, or left
 void chatroomInvite(java.lang.String chatroomID, java.lang.String chatroomName, java.lang.String sender, java.lang.String message)
          Client is being invited to join a chatroom
 void chatroomJoined(java.lang.String chatroomID, java.lang.String chatroomName)
          Client joined a chatroom
 void chatroomMessageReceived(java.lang.String chatroomID, java.lang.String sender, java.lang.String message, boolean whisper)
          Message was received in this chatroom DEPRECATED
 void chatroomMessageReceived(java.lang.String chatroomID, java.lang.String sender, java.lang.String message, boolean whisper, java.lang.String language, java.lang.String unknown)
          Message was received in this chatroom
 void chatroomUpdate(java.lang.String chatroomID, java.lang.String buddy, boolean inside)
          When users enter or leave a chatroom
 void clientEvent(TOCBuddy buddy, int status)
          client event tells a buddy's typing status
 void connected()
          Successfully connected
 void dirStatus(int status, java.lang.String[] args)
          Event received when client attempts to set their directory info
 void disconnected()
          disconnected from server
 void isPaused(boolean state)
          For whatever reason, the server may choose to pause communication.
 void messageReceived(TOCBuddy buddy, java.lang.String message, boolean isBuddy, boolean auto)
          incoming message DEPRECATED
 void messageReceived(TOCBuddy buddy, java.lang.String message, boolean isBuddy, boolean auto, java.lang.String language)
          incoming message
 void rvousPropose(TOCBuddy buddy, java.lang.String UUID, java.lang.String cookie, int seq, java.lang.String rip, java.lang.String pip, java.lang.String vip, java.lang.String port, java.lang.String tlv)
          Someone is proposing a rendezvous to perform a specific action.
 void urlReceived(java.lang.String windowName, java.lang.String url)
          Event received when client requests a user's profile info or directory info Use the server address and port the client connected to, followed by the directory name passed here.
 void warned(TOCBuddy buddy, java.lang.String amount)
          Client has been warned
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TOCAdapter

public TOCAdapter()
Method Detail

connected

public void connected()
Description copied from interface: TOCListener
Successfully connected

Specified by:
connected in interface TOCListener

disconnected

public void disconnected()
Description copied from interface: TOCListener
disconnected from server

Specified by:
disconnected in interface TOCListener

buddyRemoved

public void buddyRemoved(java.lang.String name)
Description copied from interface: TOCListener
buddy removed successfully

Specified by:
buddyRemoved in interface TOCListener
Parameters:
name - the name of the buddy who was removed

messageReceived

public void messageReceived(TOCBuddy buddy,
                            java.lang.String message,
                            boolean isBuddy,
                            boolean auto)
Description copied from interface: TOCListener
incoming message DEPRECATED

Specified by:
messageReceived in interface TOCListener
Parameters:
buddy - who the message is from
message - the actual message, including html
isBuddy - true if this person is on your buddy list
auto - true if this message is an auto response (away message)

messageReceived

public void messageReceived(TOCBuddy buddy,
                            java.lang.String message,
                            boolean isBuddy,
                            boolean auto,
                            java.lang.String language)
Description copied from interface: TOCListener
incoming message

Specified by:
messageReceived in interface TOCListener
Parameters:
buddy - who the message is from
message - the actual message, including html
isBuddy - true if this person is on your buddy list
auto - true if this message is an auto response (away message)

clientEvent

public void clientEvent(TOCBuddy buddy,
                        int status)
Description copied from interface: TOCListener
client event tells a buddy's typing status

Specified by:
clientEvent in interface TOCListener
Parameters:
buddy - who the status refers to
status - 3 possible numbers, refer to the TOCConstants
See Also:
TOCConstants.CLIENT_EVENT_STOPPED, TOCConstants.CLIENT_EVENT_ENTERED, TOCConstants.CLIENT_EVENT_TYPING

buddyArt

public void buddyArt(TOCBuddy buddy,
                     java.lang.String unknown)
Description copied from interface: TOCListener
Info about a buddy's icon?

Specified by:
buddyArt in interface TOCListener
Parameters:
buddy - this response pertains to
unknown - string with a variable length of parameters that appear to be delimited by spaces

buddySignedOn

public void buddySignedOn(TOCBuddy buddy)
Description copied from interface: TOCListener
Buddy signed on alert

Specified by:
buddySignedOn in interface TOCListener

buddySignedOff

public void buddySignedOff(TOCBuddy buddy)
Description copied from interface: TOCListener
Buddy signed off alert

Specified by:
buddySignedOff in interface TOCListener

buddyAway

public void buddyAway(TOCBuddy buddy)
Description copied from interface: TOCListener
Buddy is now away alert

Specified by:
buddyAway in interface TOCListener

buddyReturned

public void buddyReturned(TOCBuddy buddy)
Description copied from interface: TOCListener
Buddy returned from away status

Specified by:
buddyReturned in interface TOCListener

buddyAdded

public void buddyAdded(TOCBuddy buddy)
Description copied from interface: TOCListener
Buddy was added successfully

Specified by:
buddyAdded in interface TOCListener

aimError

public void aimError(int error,
                     java.lang.String[] args)
Description copied from interface: TOCListener
Error usually happens with bad command parameters, but could sometimes be the server's fault.

Specified by:
aimError in interface TOCListener
Parameters:
error - the error code
args - optional arguments to go with this error

chatroomJoined

public void chatroomJoined(java.lang.String chatroomID,
                           java.lang.String chatroomName)
Description copied from interface: TOCListener
Client joined a chatroom

Specified by:
chatroomJoined in interface TOCListener
Parameters:
chatroomID - id to indentify this chatroom. Needed for other chat commands.
chatroomName - Name of this chatroom

chatroomMessageReceived

public void chatroomMessageReceived(java.lang.String chatroomID,
                                    java.lang.String sender,
                                    java.lang.String message,
                                    boolean whisper)
Description copied from interface: TOCListener
Message was received in this chatroom DEPRECATED

Specified by:
chatroomMessageReceived in interface TOCListener
Parameters:
chatroomID - ID for this chatroom
sender - name of who sent this message
message - the message, including html tags
whisper - true if only this client can see the message, false if its a public message.

chatroomMessageReceived

public void chatroomMessageReceived(java.lang.String chatroomID,
                                    java.lang.String sender,
                                    java.lang.String message,
                                    boolean whisper,
                                    java.lang.String language,
                                    java.lang.String unknown)
Description copied from interface: TOCListener
Message was received in this chatroom

Specified by:
chatroomMessageReceived in interface TOCListener
Parameters:
chatroomID - ID for this chatroom
sender - name of who sent this message
message - the message, including html tags
whisper - true if only this client can see the message, false if its a public message.

chatroomUpdate

public void chatroomUpdate(java.lang.String chatroomID,
                           java.lang.String buddy,
                           boolean inside)
Description copied from interface: TOCListener
When users enter or leave a chatroom

Specified by:
chatroomUpdate in interface TOCListener
Parameters:
chatroomID - ID for this chatroom
buddy - name of person whose status changed
inside - true if person joined room, false if left the room

chatroomInvite

public void chatroomInvite(java.lang.String chatroomID,
                           java.lang.String chatroomName,
                           java.lang.String sender,
                           java.lang.String message)
Description copied from interface: TOCListener
Client is being invited to join a chatroom

Specified by:
chatroomInvite in interface TOCListener
Parameters:
chatroomID - ID for this chatroom
chatroomName - name for this chatroom
sender - the person who sent the invite
message - optional greeting message

chatroomDropped

public void chatroomDropped(java.lang.String chatroomID)
Description copied from interface: TOCListener
Client was dropped from chatroom, either kicked, connection dropped, or left

Specified by:
chatroomDropped in interface TOCListener
Parameters:
chatroomID - ID of chatroom the client left

adminFormatStatus

public void adminFormatStatus(int status,
                              java.lang.String[] args)
Description copied from interface: TOCListener
Event received when client attempts to change the format of their name

Specified by:
adminFormatStatus in interface TOCListener
Parameters:
status - status code, 0 mean success
args - optional arguments if status is not 0

adminPasswordStatus

public void adminPasswordStatus(int status,
                                java.lang.String[] args)
Description copied from interface: TOCListener
Event received when client attempts to change their password

Specified by:
adminPasswordStatus in interface TOCListener
Parameters:
status - status code, 0 mean success
args - optional arguments if status is not 0

urlReceived

public void urlReceived(java.lang.String windowName,
                        java.lang.String url)
Description copied from interface: TOCListener
Event received when client requests a user's profile info or directory info Use the server address and port the client connected to, followed by the directory name passed here.

Specified by:
urlReceived in interface TOCListener
Parameters:
windowName - suggested window name to use
url - a directory name

buddyListReceived

public void buddyListReceived(java.util.Iterator buddies)
Description copied from interface: TOCListener
Buddy list was received from the server. This usually happens once just after connection. This list is of all the buddies on a client's buddylist

Specified by:
buddyListReceived in interface TOCListener
Parameters:
buddies - an Iterator of TOCBuddy objects

dirStatus

public void dirStatus(int status,
                      java.lang.String[] args)
Description copied from interface: TOCListener
Event received when client attempts to set their directory info

Specified by:
dirStatus in interface TOCListener
Parameters:
status - status code, 0 mean success
args - optional arguments if status is not 0

warned

public void warned(TOCBuddy buddy,
                   java.lang.String amount)
Description copied from interface: TOCListener
Client has been warned

Specified by:
warned in interface TOCListener
amount - the client's new warning percentage

isPaused

public void isPaused(boolean state)
Description copied from interface: TOCListener
For whatever reason, the server may choose to pause communication. Any commands sent to the server at that point will be dropped, and sometimes so will the connection. Communication can resume again once it is unpaused.

Specified by:
isPaused in interface TOCListener
Parameters:
state - true if communication is pause, false if not

rvousPropose

public void rvousPropose(TOCBuddy buddy,
                         java.lang.String UUID,
                         java.lang.String cookie,
                         int seq,
                         java.lang.String rip,
                         java.lang.String pip,
                         java.lang.String vip,
                         java.lang.String port,
                         java.lang.String tlv)
Description copied from interface: TOCListener
Someone is proposing a rendezvous to perform a specific action. This can be sending of buddy list, file transfer, etc...

Specified by:
rvousPropose in interface TOCListener
Parameters:
buddy - the person who sent the proposal
UUID - action to perform. This is the same as the capabilities UUID's
cookie - cookie used for other communication pertaining to this action
seq - sequence number
rip - IP address to rendezvous at (connect at)
pip - proposer's IP address
vip - proposer's verified IP address
port - port to connect to at rip
tlv - separated by colons and values are base64 encoded