fr.paris.lutece.plugins.chat.business
Class ChatUser

java.lang.Object
  extended by fr.paris.lutece.plugins.chat.business.ChatUser

public class ChatUser
extends java.lang.Object

This class provides methods for the management of the chat users


Field Summary
static int MODE_BAN
           
static int MODE_DEBAN
           
static int MODE_OP
           
static int MODE_USER
           
static int MODE_VOICE
           
 
Constructor Summary
ChatUser(java.lang.String strNickname)
          Creates a new ChatUser object
 
Method Summary
 void addChatEntry(ChatEntry entry)
          Adds an entry to the ChatEntries Vector
 void addSentData(java.lang.String strText)
          Adds text to the user's list of sent data
 java.lang.String getAwayComment()
          Returns the absence comment
 java.util.Enumeration getChatEntries()
          Return the entries of the chat
 java.lang.String getHostName()
          Returns the host name of this user
 java.lang.String getIpAddress()
          Returns the ip address of this user
 long getJoinTime()
          Returns the time when this user entered the chat room
 java.lang.String getKickComment()
          Returns the comment shown when this user is kicked out of the chat room
 java.util.Date getLastAccessTime()
          Returns the date of the last access of this user to the chat room
 int getMode()
          Return the mode of this user
 java.lang.String getNickname()
          Returns the nickname of this user
 int getSentDataSizeSince(long lSeconds)
          Returns the amount of data sent for the last n seconds.
 boolean hasNewPseudo()
          Returns the boolean which define if the user has set a new pseudonym
 boolean isAway()
          Returns the attribute which define if this user is absent
 boolean isKicked()
          Returns the boolean which shows if this user has been kicked out the chat room
 void kick(java.lang.String strComment)
          Kicks this user out of the chat room
 void setAway(boolean bAway)
          Sets the attribute which define if this user is absent
 void setAway(java.lang.String strComment)
          Sets this user as absent and add a comment
 void setHostName(java.lang.String strHostName)
          Sets the host name of this user with the specified parameter
 void setIpAddress(java.lang.String strIpAddress)
          Sets the ip address of this user with the specified parameter
 void setLastAccessTime(java.util.Date dateLastAccess)
          Sets the host name of this user with the specified parameter
 void setMode(int nMode)
          Sets the mode of this user
 void setNewPseudo(boolean bNewPseudo)
          Set the boolean which define if the user has set a new pseudonym
 void setNickname(java.lang.String strNickname)
          Sets the nickname of this user with the specified parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_USER

public static final int MODE_USER
See Also:
Constant Field Values

MODE_VOICE

public static final int MODE_VOICE
See Also:
Constant Field Values

MODE_OP

public static final int MODE_OP
See Also:
Constant Field Values

MODE_BAN

public static final int MODE_BAN
See Also:
Constant Field Values

MODE_DEBAN

public static final int MODE_DEBAN
See Also:
Constant Field Values
Constructor Detail

ChatUser

public ChatUser(java.lang.String strNickname)
Creates a new ChatUser object

Parameters:
strNickname - The nick name of the user
Method Detail

setNickname

public final void setNickname(java.lang.String strNickname)
Sets the nickname of this user with the specified parameter. This method is declared final because it is called by the constructor.

Parameters:
strNickname - The type as an int

getNickname

public java.lang.String getNickname()
Returns the nickname of this user

Returns:
The nick name

setIpAddress

public void setIpAddress(java.lang.String strIpAddress)
Sets the ip address of this user with the specified parameter

Parameters:
strIpAddress - The String ip address

getIpAddress

public java.lang.String getIpAddress()
Returns the ip address of this user

Returns:
The String ip address

setHostName

public void setHostName(java.lang.String strHostName)
Sets the host name of this user with the specified parameter

Parameters:
strHostName - The String host name

getHostName

public java.lang.String getHostName()
Returns the host name of this user

Returns:
The String host name

setLastAccessTime

public void setLastAccessTime(java.util.Date dateLastAccess)
Sets the host name of this user with the specified parameter

Parameters:
dateLastAccess - The String host name

getLastAccessTime

public java.util.Date getLastAccessTime()
Returns the date of the last access of this user to the chat room

Returns:
The date last access

getJoinTime

public long getJoinTime()
Returns the time when this user entered the chat room

Returns:
The Long join time

addChatEntry

public void addChatEntry(ChatEntry entry)
Adds an entry to the ChatEntries Vector

Parameters:
entry - The ChatEntry object

getChatEntries

public java.util.Enumeration getChatEntries()
Return the entries of the chat

Returns:
The entries as an Enumeration object

setMode

public void setMode(int nMode)
Sets the mode of this user

Parameters:
nMode - nMode The mode of this user

getMode

public int getMode()
Return the mode of this user

Returns:
The user mode as an int

setAway

public void setAway(boolean bAway)
Sets the attribute which define if this user is absent

Parameters:
bAway - The new value

setAway

public void setAway(java.lang.String strComment)
Sets this user as absent and add a comment

Parameters:
strComment - the comment of the absence

isAway

public boolean isAway()
Returns the attribute which define if this user is absent

Returns:
The boolean attribute _bAway

getAwayComment

public java.lang.String getAwayComment()
Returns the absence comment

Returns:
The absence comment as a String

hasNewPseudo

public boolean hasNewPseudo()
Returns the boolean which define if the user has set a new pseudonym

Returns:
The boolean attribute _bNewPseudo

setNewPseudo

public void setNewPseudo(boolean bNewPseudo)
Set the boolean which define if the user has set a new pseudonym

Parameters:
bNewPseudo - the boolean which define if the user has set a new pseudonym

kick

public void kick(java.lang.String strComment)
Kicks this user out of the chat room

Parameters:
strComment - A comment about the kick

isKicked

public boolean isKicked()
Returns the boolean which shows if this user has been kicked out the chat room

Returns:
the boolean attribte _bKicked

getKickComment

public java.lang.String getKickComment()
Returns the comment shown when this user is kicked out of the chat room

Returns:
The comment as a String

addSentData

public void addSentData(java.lang.String strText)
Adds text to the user's list of sent data

Parameters:
strText - The text to add

getSentDataSizeSince

public int getSentDataSizeSince(long lSeconds)
Returns the amount of data sent for the last n seconds.

Parameters:
lSeconds - The number of seconds
Returns:
The size of the sent data


Copyright © 2010 Mairie de Paris. All Rights Reserved.