| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sourceforge.obby4j.Client
public class Client
The main application entry point for communicating with a obby-compatible server in an OOP fashion.
| Constructor Summary | |
|---|---|
Client()
Creates an unconnected client.  | 
|
| Method Summary | |
|---|---|
 void | 
addChatListener(ChatListener listener)
Register a listener to receive chat messages.  | 
 void | 
addUserListener(UserListener listener)
Register a listener to receive user join/part notifications.  | 
 void | 
commandReceived(Command command)
Handles protocol commands to sychronize the client's internal state with one on the server.  | 
 void | 
connect(java.net.InetAddress host,
        int port,
        java.lang.String username,
        java.awt.Color color)
Logs into the server as the given user.  | 
 Document | 
getDocumentById(java.lang.String documentId)
Searches for a document by its document ID.  | 
 java.util.List<Document> | 
getDocuments()
 | 
 Protocol | 
getProtocol()
 | 
 User | 
getSelf()
 | 
 ServerMetaData | 
getServerMetaData()
 | 
 User | 
getUserByNet6Id(int net6Id)
Searches for a user by his net6 user ID.  | 
 User | 
getUserByObbyId(int obbyId)
Searches for a user by his obby user ID.  | 
 java.util.List<User> | 
getUsers()
 | 
 void | 
removeChatListener(ChatListener listener)
Unregister a listener from receiving chat messages.  | 
 void | 
removeUserListener(UserListener listener)
Unregister a listener from receiving user join/part notifications.  | 
 void | 
sendMessage(java.lang.String message)
Sends a chat message to other users.  | 
 void | 
subscribe(Document document)
Subscribes this client to a document.  | 
 void | 
unsubscribe(Document document)
Unsubscribes this client from a document.  | 
| Methods inherited from class java.lang.Object | 
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public Client()
| Method Detail | 
|---|
public void addChatListener(ChatListener listener)
listener - the listener to registerpublic void addUserListener(UserListener listener)
listener - the listener to registerpublic void commandReceived(Command command)
commandReceived in interface ProtocolListenercommand - the command to handle
public void connect(java.net.InetAddress host,
                    int port,
                    java.lang.String username,
                    java.awt.Color color)
             throws java.io.IOException,
                    Net6LoginException
host - port - username - color - 
java.io.IOException
Net6LoginExceptionpublic Document getDocumentById(java.lang.String documentId)
documentId - 
java.util.NoSuchElementException - if no document could be found with the given IDpublic java.util.List<Document> getDocuments()
public Protocol getProtocol()
public User getSelf()
public ServerMetaData getServerMetaData()
public User getUserByNet6Id(int net6Id)
net6Id - 
java.util.NoSuchElementException - if no user could be found with the given IDpublic User getUserByObbyId(int obbyId)
obbyId - 
java.util.NoSuchElementException - if no user could be found with the given IDpublic java.util.List<User> getUsers()
public void removeChatListener(ChatListener listener)
listener - the listener to unregisterpublic void removeUserListener(UserListener listener)
listener - the listener to unregister
public void sendMessage(java.lang.String message)
                 throws java.io.IOException
message - the message to send
java.io.IOException
public void subscribe(Document document)
               throws java.io.IOException
document - the document to subscribe to
java.io.IOException
public void unsubscribe(Document document)
                 throws java.io.IOException
document - the document to unsubscribe from
java.io.IOException
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||