|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines the API to the Chat Receiver protocol on
the server side. Login and logout is initiated by the client and
does not show up here. The server does initate reception on the
client side, so there is a receive
method. See
also the counterpart ReceiverClient
.
Method Summary | |
void |
emotion(java.lang.String channel,
java.lang.String from,
java.lang.String target,
java.lang.String emo)
|
java.lang.String |
getNick()
|
void |
play(java.lang.String channel,
java.lang.String from,
java.lang.String audiokey)
Have the client receive the request from the sender to play the audio with the given key . |
void |
receive(java.lang.String channel,
java.lang.String from,
java.lang.String message)
Have the client receive the data as coming from the sender. |
void |
receiveUserInfo(java.lang.String nickName,
java.lang.String strInfo)
|
void |
serve(java.net.Socket clientSocket,
ClientConnection clientConnection,
java.io.InputStream inputStream)
Handle login and logout requests given by the client through the clientSocket. |
void |
shipReceive(java.lang.String channel,
java.lang.String from,
java.lang.String receiver,
boolean status)
shipReceive-method invoked by ClientConnection, responsible for transferring messages to this listening client |
void |
topicChanged(java.lang.String channel,
java.lang.String from,
java.lang.String topic)
method to pass topicChanged |
void |
whispreceive(java.lang.String channel,
java.lang.String from,
java.lang.String message)
Have the client receive the whispered message. |
Method Detail |
public void serve(java.net.Socket clientSocket, ClientConnection clientConnection, java.io.InputStream inputStream) throws TimeoutException, java.io.IOException, java.security.InvalidParameterException
clientSocket
- the socket the client is connected to.channel
- the communication context in which this client
participates. After a successful login, it is registered as a
receiver there and in the end, it is removed from it. The
channel may also invoke (via the ClientConnection
)
this object's receive
method.clientConnection
- the connection this handler is running
in. It is to be inserted into the connectionCollection.
//X<TimeoutException
- thrown if an answer cannot be sent
to the client in time. This is an abstraction from a InterruptedIOException
.java.io.IOException
- General I/O-Exceptions that may have
been raised by lower levels.java.security.InvalidParameterException
- Thrown if clientSocket is
null or otherwise useless.
//X>public void receive(java.lang.String channel, java.lang.String from, java.lang.String message) throws java.io.IOException, java.security.InvalidParameterException
serve
is listening to logout requests.from
- The nickname of the sender.message
- The actual message to be sent.
//X<java.io.IOException
- General I/O-Exceptions that may have
been raised by lower levels.java.security.InvalidParameterException
- Thrown if any parameter
is null.
//X>public void whispreceive(java.lang.String channel, java.lang.String from, java.lang.String message) throws java.io.IOException, java.security.InvalidParameterException
serve
is listening to logout requests.from
- The nickname of the sender.message
- The actual message to be sent.
//X<java.io.IOException
- General I/O-Exceptions that may have
been raised by lower levels.java.security.InvalidParameterException
- Thrown if any parameter
is null.
//X>public void play(java.lang.String channel, java.lang.String from, java.lang.String audiokey) throws java.io.IOException, java.security.InvalidParameterException
serve
is listening to logout requests.
There is no garanty, that the client will actually play anything or even know about a sound with the given key.
from
- The nickname of the sender.audiokey
- The name of the sound to play. The receiving
clients maps this name to a sound file and
plays that file. Default names include
Hello
plays a greeting,
Laugh
plays a laugh and
Bye
.
//X<java.io.IOException
- General I/O-Exceptions that may have
been raised by lower levels.java.security.InvalidParameterException
- Thrown if any parameter
is null.
//X>public void topicChanged(java.lang.String channel, java.lang.String from, java.lang.String topic) throws java.io.IOException, java.security.InvalidParameterException
channel
- the channel which distributes the topicChanged commandfrom
- the client's nick, who changed the topicaudioKey
- the topicpublic void receiveUserInfo(java.lang.String nickName, java.lang.String strInfo) throws java.io.IOException, java.security.InvalidParameterException
public java.lang.String getNick()
public void emotion(java.lang.String channel, java.lang.String from, java.lang.String target, java.lang.String emo) throws java.io.IOException
public void shipReceive(java.lang.String channel, java.lang.String from, java.lang.String receiver, boolean status) throws java.io.IOException, java.security.InvalidParameterException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |