swpchat.server
Class UserInfoHandler

java.lang.Object
  |
  +--swpchat.server.UserInfoHandler
All Implemented Interfaces:
ChatTokens, UserInfoTokens

public class UserInfoHandler
extends java.lang.Object
implements UserInfoTokens

encapsultaes methods for handleing userInfo relating commands

Version:
1.0
Author:
Rene Woerzberger, Leonid Ostwald

Field Summary
(package private) static java.lang.String CLS
           
private  java.lang.String sessionKey
           
private  NickNameCollection userCollection
           
 
Fields inherited from interface swpchat.protocol.UserInfoTokens
STR_CITY, STR_COLOR, STR_EMAIL, STR_FIRSTNAME, STR_HOMEPAGE, STR_LASTNAME, STR_MOTTO, STR_NICKNAME, STR_NULL_INFORMATION, STR_SEX, STR_SEX_DONTKNOW, STR_SEX_FEMALE, STR_SEX_MALE, STR_SHIP_STATUS, STR_STARTUPSEND, STR_STARTUPSEND_NEGATIVE, STR_STARTUPSEND_POSITIVE, STR_STREET, STR_USERINFO_PROP_BEGIN, STR_ZIP
 
Fields inherited from interface swpchat.protocol.ChatTokens
CHAR_ARG_SEP, CHAR_MSG_END, CHAR_MSG_EOL, CHAR_QUOTE, CHAR_STRING_DELIMITER, STR_ARG_SEP, STR_AUTHORIZE, STR_MSG_END, STR_MSG_EOL, STR_NEG_ARG, STR_NEGATIVE, STR_POS_ARG, STR_POSITIVE, STR_QUOTE, STR_REPLY, STR_STRING_DELIMITER, STR_WAIT
 
Constructor Summary
UserInfoHandler(NickNameCollection userCollection, java.lang.String sessionKey)
          constructor
 
Method Summary
 void setUserInfo(java.util.Vector tokenlist)
          method converts given vector and saves keyword and values into UserInfo of session
 java.lang.String userInfoToString(java.lang.String nickname)
          method converts the userInfo of to a sendable String
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

CLS

static final java.lang.String CLS

userCollection

private NickNameCollection userCollection

sessionKey

private java.lang.String sessionKey
Constructor Detail

UserInfoHandler

public UserInfoHandler(NickNameCollection userCollection,
                       java.lang.String sessionKey)
constructor
Parameters:
userCollection - the unique collection of the UserInfos
sessionKey - the unique sessionKey of the calling ProtocolHandler-Object
Method Detail

setUserInfo

public void setUserInfo(java.util.Vector tokenlist)
                 throws NoSuchMemberException
method converts given vector and saves keyword and values into UserInfo of session
Parameters:
tokenlist - the vector (tokenized by ChatStreamTokenizer)

userInfoToString

public java.lang.String userInfoToString(java.lang.String nickname)
                                  throws NoSuchMemberException
method converts the userInfo of to a sendable String
Parameters:
nickname - the nickname of the user, who's infos should be send
Returns:
String of this shape: keyword1:value1:keyword2:value2:....