Package kr.ac.konkuk.ccslab.cm.entity
Class CMUser
java.lang.Object
kr.ac.konkuk.ccslab.cm.entity.CMObject
kr.ac.konkuk.ccslab.cm.entity.CMUser
This class represents the information of a CM user (client).
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns a list of blocking socket channel to this user.Returns the current group of the user.Returns the current session of the user.getHost()
Returns IP address of the user host.int
getID()
int
long
getName()
Returns user name.Returns a list of non-blocking socket channel to this user.Returns user login password.int
Returns port number for server socket channel(SSC) of the user.int
getState()
Returns the current state of the user.int
Returns UDP port number of the user.void
void
setAttachDownloadScheme
(int scheme) void
setCurrentGroup
(String gName) void
setCurrentSession
(String sName) void
void
setID
(int id) void
setKeepAliveTime
(int nSecond) void
setLastEventTransTime
(long lTime) void
setLastLoginDate
(Calendar date) void
void
void
void
void
setSSCPort
(int port) void
setState
(int state) void
setUDPPort
(int port)
-
Constructor Details
-
CMUser
public CMUser()Creates an instance of the CMUser class. -
CMUser
Creates an instance of the CMUser class.- Parameters:
name
- - the user name.passwd
- - the login password.host
- - the IP address of the user host.
-
-
Method Details
-
setID
public void setID(int id) -
setName
-
setPasswd
-
setHost
-
setUDPPort
public void setUDPPort(int port) -
setSSCPort
public void setSSCPort(int port) -
setPosition
-
setCurrentSession
-
setCurrentGroup
-
setState
public void setState(int state) -
setAttachDownloadScheme
public void setAttachDownloadScheme(int scheme) -
setAttachAccessHistoryList
-
setLastLoginDate
-
setLastEventTransTime
public void setLastEventTransTime(long lTime) -
setMyLastEventTransTimeHashtable
-
setKeepAliveTime
public void setKeepAliveTime(int nSecond) -
getID
public int getID() -
getName
Returns user name.- Returns:
- the user name.
-
getPasswd
Returns user login password.The password is encrypted by CM.
- Returns:
- the login password.
-
getHost
Returns IP address of the user host.- Returns:
- the IP address.
-
getUDPPort
public int getUDPPort()Returns UDP port number of the user.The user uses UDP port number to receives a UDP packet a datagram channel.
- Returns:
- the UDP port number.
-
getSSCPort
public int getSSCPort()Returns port number for server socket channel(SSC) of the user.The user uses this port number to receive a file directly from a sender user (P2P file-transfer).
- Returns:
- the SSC port number.
-
getPosition
-
getCurrentSession
Returns the current session of the user.- Returns:
- the session name.
If the user is not in a session, the method returns "?".
-
getCurrentGroup
Returns the current group of the user.- Returns:
- the group name.
If the user is not in a group, the method returns "?".
-
getState
public int getState()Returns the current state of the user. The CMUser object can has a following state.CMInfo.CM_INIT : The user object has been created.
CMInfo.CM_CONNECT : The user has connected to the default server.
CMInfo.CM_LOGIN : The user has logged in to the default server.
CMInfo.CM_JOIN_SESSION : The user has entered a session or a group.- Returns:
- the user state.
-
getNonBlockSocketChannelInfo
Returns a list of non-blocking socket channel to this user.When a server application has a CMUser reference, it can get the list of non-blocking socket channel.
- Returns:
- the socket channel list.
-
getBlockSocketChannelInfo
Returns a list of blocking socket channel to this user.When a server application has a CMUser reference, it can get the list of blocking socket channel.
- Returns:
- the socket channel list.
-
getAttachDownloadScheme
public int getAttachDownloadScheme() -
getAttachAccessHistoryList
-
getLastLoginDate
-
getLastEventTransTime
public long getLastEventTransTime() -
getMyLastEventTransTimeHashtable
-
getKeepAliveTime
public int getKeepAliveTime()
-