|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--swpchat.server.Channel
The Communicative context of a client in the server.
Field Summary | |
private java.lang.String |
channelName
|
(package private) static java.lang.String |
CLS
|
private java.util.Iterator |
iterator
|
private java.util.HashMap |
markedMembers
|
private ConnectionCollection |
receiverCollection
|
private ConnectionCollection |
senderCollection
|
private java.lang.String |
strRecPasswd
|
private java.lang.String |
strSendPasswd
|
private java.lang.String |
strTopic
|
Constructor Summary | |
Channel()
|
Method Summary | |
boolean |
authorizeRec(java.lang.String passwd)
|
boolean |
authorizeSend(java.lang.String passwd)
|
boolean |
containsReceiver(java.lang.String sessionKey)
tests iff receiver is contained in receiverCollection |
boolean |
containsSender(java.lang.String sessionKey)
tests iff sender is contained in senderCollection |
void |
emotion(java.lang.String strFrom,
java.lang.String target,
java.lang.String emo)
sends "emotion:strFrom:target:emotion" to every ClientConnection in receiverCollection |
java.lang.String |
getChannelName()
returns the channel name of the actual channel |
java.lang.String |
getTopic()
Returns topic |
boolean |
hasRecPasswd()
Returns true if receiving is restricted |
boolean |
hasSendPasswd()
Returns true if sending is restricted |
boolean |
isMemberMarked(java.lang.String sessionKey)
|
void |
markMember(java.lang.String sessionKey)
|
java.util.HashMap |
members()
|
void |
play(java.lang.String strFrom,
java.lang.String audioKey)
sends "play:strFrom:audioKey" to every ClientConnection in receiverCollection |
void |
removeReceiverConnection(java.lang.String strgNick)
remove a ClientConnection from receiverCollection |
void |
removeSenderConnection(java.lang.String strgNick)
remove a ClientConnection from senderCollection |
void |
send(java.lang.String strFrom,
java.lang.String strMessage)
send strFrom and strMessage to every ClientConnection in receiverCollection |
void |
setChannelName(java.lang.String name)
sets the channel name for the actual channel |
void |
setRecPasswd(java.lang.String passwd)
|
void |
setSendPasswd(java.lang.String passwd)
|
void |
setTopic(java.lang.String topic)
Sets topic for a channel |
void |
ship(java.lang.String strFrom,
java.lang.String receiver,
boolean status)
ship not really implemented yet |
void |
topicChanged(java.lang.String strFrom,
java.lang.String topic)
sends "topicchanged:strFrom:topic" to every ClientConnection in receiverCollection |
boolean |
tryToAddReceiverConnection(java.lang.String strgKey,
ClientConnection clientConnection)
Method tries to add ClientConnection to hashtable and is threadsave |
boolean |
tryToAddSenderConnection(java.lang.String strgNick,
ClientConnection clientConnection)
Try to add a ClientConnection with the key
specified in String to senderCollection. |
void |
whisper(java.lang.String receiverSessionKey,
java.lang.String SenderNickName,
java.lang.String Msg)
sends "whisper:receiverSessionKey:SenderNickName:Msg" to the ClientConnection corresponding to the receiverSessionKey |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final java.lang.String CLS
private java.util.HashMap markedMembers
private ConnectionCollection receiverCollection
private ConnectionCollection senderCollection
private java.util.Iterator iterator
private java.lang.String channelName
private java.lang.String strTopic
private java.lang.String strSendPasswd
private java.lang.String strRecPasswd
Constructor Detail |
public Channel()
Method Detail |
public void setTopic(java.lang.String topic)
topic
- the new topicpublic boolean hasSendPasswd()
public boolean hasRecPasswd()
public java.lang.String getTopic()
public void setSendPasswd(java.lang.String passwd)
public void setRecPasswd(java.lang.String passwd)
public boolean authorizeSend(java.lang.String passwd)
public boolean authorizeRec(java.lang.String passwd)
public void markMember(java.lang.String sessionKey)
public boolean isMemberMarked(java.lang.String sessionKey)
public boolean tryToAddReceiverConnection(java.lang.String strgKey, ClientConnection clientConnection)
strgKey
- connection
- public boolean tryToAddSenderConnection(java.lang.String strgNick, ClientConnection clientConnection)
ClientConnection
with the key
specified in String
to senderCollection. ThestrgNick
- the String
specifying the nicknameclientConnection
- the ClientConnection
to addpublic void removeReceiverConnection(java.lang.String strgNick) throws NoSuchMemberException
ClientConnection
from receiverCollectionstrgNick
- the String
specifying the nickname
of the ClientConnection to removepublic void removeSenderConnection(java.lang.String strgNick) throws NoSuchMemberException
ClientConnection
from senderCollectionstrgNick
- the String
specifying the nickname
of the ClientConnection to removepublic void send(java.lang.String strFrom, java.lang.String strMessage)
strFrom
- String
specifying the ClientConnection from
where the message was sent.strMessage
- String
specifying the message to sendpublic java.util.HashMap members()
public void topicChanged(java.lang.String strFrom, java.lang.String topic)
strFrom
- String
specifying the ClientConnection from
where the "settopic" was sent.topic
- String
specifying the topic to sendpublic void play(java.lang.String strFrom, java.lang.String audioKey)
strFrom
- String
specifying the ClientConnection from
where the "play" was sent.audioKey
- String
specifying the audioKey to sendpublic void whisper(java.lang.String receiverSessionKey, java.lang.String SenderNickName, java.lang.String Msg) throws NoSuchMemberException
receiverSessionKey
- String
specifying the ClientConnection ti which the whisper is sentSenderNickName
- String
specifying the ClientConnection the whisper was sent fromMsg
- String
the actually message to be whisperedNoSuchMemberException
- thrown if receiver is not in the channelpublic void emotion(java.lang.String strFrom, java.lang.String target, java.lang.String emo)
strFrom
- String
specifying the ClientConnection from
where the "play" was sent.target
- String
specifying target of the emotionemotion
- String
specifying the emotionpublic void ship(java.lang.String strFrom, java.lang.String receiver, boolean status)
public void setChannelName(java.lang.String name)
name
- String
specifying the name of this channelpublic java.lang.String getChannelName()
String
with the actual name of this channelpublic boolean containsSender(java.lang.String sessionKey)
{@link
- java.lang.String} identifying the searched Keypublic boolean containsReceiver(java.lang.String sessionKey)
{@link
- java.lang.String} identifying the searched Key
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |