|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.epfl.lpd.ids.server.InternalClient
public class InternalClient
This class is the internal representation of a chat client for the
server. This class stores the username of the client and a IBlockingQueue that will be used by the
client to retrieve the different messages send by the other chat
clients.
| Field Summary | |
|---|---|
protected IBlockingQueue<IMessage> |
blockingQueue
The IBlockingQueue used for
retrieving the different messages sent by the other chat
clients. |
protected String |
username
The username of this internal client. |
| Constructor Summary | |
|---|---|
InternalClient(String username)
Creates a new instance of InternalClient. |
|
| Method Summary | |
|---|---|
IMessage |
getNextMessage()
Method used to retrieve the last element, not already taken, that is in the IBlockingQueue of
this internal client. |
String |
getUsername()
Method used to get the username of this internal client. |
void |
putMessage(IMessage msg)
Method used to put a new IMessage into the IBlockingQueue of this internal
client. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String username
protected IBlockingQueue<IMessage> blockingQueue
IBlockingQueue used for
retrieving the different messages sent by the other chat
clients.
| Constructor Detail |
|---|
public InternalClient(String username)
username - The username of this internal client.| Method Detail |
|---|
public String getUsername()
public void putMessage(IMessage msg)
IMessage into the IBlockingQueue of this internal
client. This method will be called by the server when it
receives a new message.
msg - The IMessage
to put in the queue.public IMessage getNextMessage()
IBlockingQueue of
this internal client.
IBlockingQueue of this internal client.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||