public class ChatRoom extends Object
Modifier and Type | Field and Description |
---|---|
static int |
INVALID_ROOM |
static int |
USER_ADDED |
static int |
USER_ALREADY_EXISTS |
static int |
USER_IS_BANNED |
Constructor and Description |
---|
ChatRoom(String strName,
String strDescription)
Creates a new ChatRoom object.
|
Modifier and Type | Method and Description |
---|---|
void |
addChatEntry(ChatEntry entry,
ChatUser userRecipient)
Adds an entry to this chat room
|
void |
addChatEntry(ChatUser userSender,
ChatEntry entry,
ChatUser userRecipient)
Adds an entry to this chat room
|
int |
addUser(ChatUser user)
Checks if the user specified in parameter is not already existent in the room and if it is not banned.
|
void |
banUser(String strPseudo,
String strComment)
Bannes a user from the room and comments it.
|
int |
changePseudo(String strPseudo,
String strNewNickname)
Modifies the nick name of the user
|
void |
debanUser(String strIpAddress)
Removes an ip address from the list of those which are banned from the room
|
String |
getAdminPassword()
The password of the admin
|
Enumeration |
getBannedUsers()
Returns the list of the users banned from this room
|
String |
getBgColor()
Returns the background color of the room
|
String |
getButtonBgColor()
Returns the background color of the button
|
String |
getButtonFgColor()
Returns the foreground color of the button
|
String |
getDescription()
Retruns the description of this room
|
String |
getFieldBgColor()
Returns the background color of the text field
|
String |
getName()
The name of this room
|
Vector |
getRoomEntries()
The list of the entries of the room
|
ChatUser |
getUser(String strPseudo)
Returns the ChatUser object whose pseudo is specified in parameter
|
int |
getUserCount()
Returns the numbers of users in the room
|
Enumeration |
getUsers()
Returns the list of the users of this room
|
void |
removeOldPseudo(String strPseudo)
Removes the user which has this pseudo in the room.
|
void |
removeUser(String strPseudo)
Removes the user which has this pseudo in the room.
|
void |
setAdminPassword(String strAdminPassword)
Sets the password of the room
|
void |
setBgColor(String strBgColor)
Sets the background color of the room
|
void |
setButtonBgColor(String strButtonBgColor)
Sets the button background color
|
void |
setButtonFgColor(String strButtonFgColor)
Sets the foreground color of the button
|
void |
setDescription(String strDescription)
Sets the description of this room whith the specified string
|
void |
setFieldBgColor(String strFieldBgColor)
Sets the background color of the text field
|
void |
setLastAccessTime(String strPseudo)
Sets the last access to the room of the user which corresponds to the pseudo specified in parameter
|
public static final int INVALID_ROOM
public static final int USER_ADDED
public static final int USER_ALREADY_EXISTS
public static final int USER_IS_BANNED
public void addChatEntry(ChatEntry entry, ChatUser userRecipient)
entry
- The chat entry to add to the roomuserRecipient
- The user which receives the messagepublic void addChatEntry(ChatUser userSender, ChatEntry entry, ChatUser userRecipient)
userSender
- The user which sends the messageentry
- The chat entry to add to the roomuserRecipient
- The user which receives the messagepublic int addUser(ChatUser user)
user
- The user to add to the roompublic int changePseudo(String strPseudo, String strNewNickname)
strPseudo
- The old pseudostrNewNickname
- The new pseudopublic void removeOldPseudo(String strPseudo)
strPseudo
- The pseudo of the user to delete from the roompublic int getUserCount()
public void removeUser(String strPseudo)
strPseudo
- The pseudo of the user to delete from the roompublic void banUser(String strPseudo, String strComment)
strPseudo
- The pseudo to banstrComment
- The comment to add to this banpublic void debanUser(String strIpAddress)
strIpAddress
- The ip address to authorize againpublic Enumeration getUsers()
public Vector getRoomEntries()
public Enumeration getBannedUsers()
public String getDescription()
public String getName()
public void setLastAccessTime(String strPseudo)
strPseudo
- The user's pseudopublic ChatUser getUser(String strPseudo)
strPseudo
- The pseudo of the user to getpublic void setAdminPassword(String strAdminPassword)
strAdminPassword
- The new password of the adminpublic String getAdminPassword()
public void setDescription(String strDescription)
strDescription
- The description of the roompublic void setBgColor(String strBgColor)
strBgColor
- The background colorpublic String getBgColor()
public void setButtonBgColor(String strButtonBgColor)
strButtonBgColor
- The button's background colorpublic String getButtonBgColor()
public void setButtonFgColor(String strButtonFgColor)
strButtonFgColor
- The button's foreground colorpublic String getButtonFgColor()
public void setFieldBgColor(String strFieldBgColor)
strFieldBgColor
- The text field's background colorpublic String getFieldBgColor()
Copyright © 2018 City of Paris. All rights reserved.