com.transjam.client
Class ClientAdapter

java.lang.Object
  |
  +--com.transjam.client.ClientAdapter
All Implemented Interfaces:
TransjamMessageListener

public class ClientAdapter
extends java.lang.Object
implements TransjamMessageListener

A message listener that parses the message and calls convenient methods.

Author:
(C) 1997-2001 Phil Burk, SoftSynth.com, All Rights Reserved

Constructor Summary
ClientAdapter()
           
 
Method Summary
 void addedMeeting(java.util.Date when, int numClients)
          The server has sent info on another meeting.
 void addedRoom(java.lang.String name, int numClients, int maxClients)
          Server has sent us another room that we can join.
 void addedUser(int uid, java.lang.String name)
          Another user has enter the same room.
 void askedForLock(java.lang.String name)
          The server is asking you for a lock on the named thing.
 void deletedRoom(java.lang.String name)
          Server has sent deleted a room that we can no longer join.
 void deletedUser(int uid, java.lang.String name)
          A user has left the room.
 void deniedLock(java.lang.String name, int uid)
          You have been denied a lock for a thing.
 void deniedRoom(java.lang.String name)
          Server has denied our request for entering a room.
 void endedList()
          The server has sent and end of list message.
 void enteredRoom(java.lang.String name, int level)
           
 void exitedRoom(java.lang.String name, int level)
           
 void gotTime(java.util.Date when)
          The server has sent it current UTC time in milliseconds.
 void gotUserLocation(int uid, double latitude, double longitude)
          The server has sent the latitude and longitude of the client.
 void grantedLock(java.lang.String name, int uid)
          You have been granted a lock for a thing.
 void grantedLogin(int uid)
          Server has granted us a login to a session.
 boolean handleMessage(Client client, TransjamMessage message)
          This gets called by the client when a message arrives.
 void modifiedThing(java.lang.String name, java.lang.String content)
          The state of a thing has been modified.
 void sentAll(int uid, java.lang.String text)
          This message was sent to everyone in the room.
 void sentBroadcast(java.lang.String text)
          The server administrator has sent an important message.
 void sentChat(int uid, int flags, java.lang.String text)
          Somebody sent us chat message.
 void sentOthers(int uid, java.lang.String text)
          This message was sent to everyone in the room except the sender.
 void sentSelf(java.lang.String text)
          You sent yourself message.
 void serverDown(Client client)
          The server listener has decided that the server is dead.
 void unlockedThing(java.lang.String name)
          Someone has unlocked a thing.
 void updatedRoom(java.lang.String name, int numClients, int maxClients)
          Server info has changed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientAdapter

public ClientAdapter()
Method Detail

grantedLogin

public void grantedLogin(int uid)
                  throws java.io.IOException
Server has granted us a login to a session.

addedRoom

public void addedRoom(java.lang.String name,
                      int numClients,
                      int maxClients)
               throws java.io.IOException
Server has sent us another room that we can join.

updatedRoom

public void updatedRoom(java.lang.String name,
                        int numClients,
                        int maxClients)
                 throws java.io.IOException
Server info has changed.

deletedRoom

public void deletedRoom(java.lang.String name)
                 throws java.io.IOException
Server has sent deleted a room that we can no longer join.

enteredRoom

public void enteredRoom(java.lang.String name,
                        int level)
                 throws java.io.IOException

exitedRoom

public void exitedRoom(java.lang.String name,
                       int level)
                throws java.io.IOException

deniedRoom

public void deniedRoom(java.lang.String name)
                throws java.io.IOException
Server has denied our request for entering a room.

sentChat

public void sentChat(int uid,
                     int flags,
                     java.lang.String text)
              throws java.io.IOException
Somebody sent us chat message.

sentBroadcast

public void sentBroadcast(java.lang.String text)
                   throws java.io.IOException
The server administrator has sent an important message. Listen up!

sentSelf

public void sentSelf(java.lang.String text)
              throws java.io.IOException
You sent yourself message. Only you know why.

sentAll

public void sentAll(int uid,
                    java.lang.String text)
             throws java.io.IOException
This message was sent to everyone in the room.

sentOthers

public void sentOthers(int uid,
                       java.lang.String text)
                throws java.io.IOException
This message was sent to everyone in the room except the sender.

addedUser

public void addedUser(int uid,
                      java.lang.String name)
               throws java.io.IOException
Another user has enter the same room.

deletedUser

public void deletedUser(int uid,
                        java.lang.String name)
                 throws java.io.IOException
A user has left the room.

modifiedThing

public void modifiedThing(java.lang.String name,
                          java.lang.String content)
                   throws java.io.IOException
The state of a thing has been modified.

grantedLock

public void grantedLock(java.lang.String name,
                        int uid)
                 throws java.io.IOException
You have been granted a lock for a thing.

deniedLock

public void deniedLock(java.lang.String name,
                       int uid)
                throws java.io.IOException
You have been denied a lock for a thing.

unlockedThing

public void unlockedThing(java.lang.String name)
                   throws java.io.IOException
Someone has unlocked a thing. It is up for grabs.

askedForLock

public void askedForLock(java.lang.String name)
                  throws java.io.IOException
The server is asking you for a lock on the named thing.

serverDown

public void serverDown(Client client)
The server listener has decided that the server is dead.
Specified by:
serverDown in interface TransjamMessageListener

endedList

public void endedList()
               throws java.io.IOException
The server has sent and end of list message.

gotTime

public void gotTime(java.util.Date when)
             throws java.io.IOException
The server has sent it current UTC time in milliseconds.

addedMeeting

public void addedMeeting(java.util.Date when,
                         int numClients)
                  throws java.io.IOException
The server has sent info on another meeting.

gotUserLocation

public void gotUserLocation(int uid,
                            double latitude,
                            double longitude)
                     throws java.io.IOException
The server has sent the latitude and longitude of the client.

handleMessage

public boolean handleMessage(Client client,
                             TransjamMessage message)
                      throws java.io.IOException
This gets called by the client when a message arrives. The message is parsed and one of the other handy methods like addedUser is called.
Specified by:
handleMessage in interface TransjamMessageListener