Class CMUser

java.lang.Object
kr.ac.konkuk.ccslab.cm.entity.CMObject
kr.ac.konkuk.ccslab.cm.entity.CMUser

public class CMUser extends CMObject
This class represents the information of a CM user (client).
  • Constructor Details

    • CMUser

      public CMUser()
      Creates an instance of the CMUser class.
    • CMUser

      public CMUser(String name, String passwd, String host)
      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

      public void setName(String name)
    • setPasswd

      public void setPasswd(String passwd)
    • setHost

      public void setHost(String host)
    • setUDPPort

      public void setUDPPort(int port)
    • setSSCPort

      public void setSSCPort(int port)
    • setPosition

      public void setPosition(CMPosition pq)
    • setCurrentSession

      public void setCurrentSession(String sName)
    • setCurrentGroup

      public void setCurrentGroup(String gName)
    • setState

      public void setState(int state)
    • setAttachDownloadScheme

      public void setAttachDownloadScheme(int scheme)
    • setAttachAccessHistoryList

      public void setAttachAccessHistoryList(CMSNSAttachAccessHistoryList list)
    • setLastLoginDate

      public void setLastLoginDate(Calendar date)
    • setLastEventTransTime

      public void setLastEventTransTime(long lTime)
    • setMyLastEventTransTimeHashtable

      public void setMyLastEventTransTimeHashtable(Hashtable<String,Long> ht)
    • setKeepAliveTime

      public void setKeepAliveTime(int nSecond)
    • getID

      public int getID()
    • getName

      public String getName()
      Returns user name.
      Returns:
      the user name.
    • getPasswd

      public String getPasswd()
      Returns user login password.

      The password is encrypted by CM.

      Returns:
      the login password.
    • getHost

      public String 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

      public CMPosition getPosition()
    • getCurrentSession

      public String getCurrentSession()
      Returns the current session of the user.
      Returns:
      the session name.
      If the user is not in a session, the method returns "?".
    • getCurrentGroup

      public String 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

      public CMChannelInfo<Integer> 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

      public CMChannelInfo<Integer> 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

      public CMSNSAttachAccessHistoryList getAttachAccessHistoryList()
    • getLastLoginDate

      public Calendar getLastLoginDate()
    • getLastEventTransTime

      public long getLastEventTransTime()
    • getMyLastEventTransTimeHashtable

      public Hashtable<String,Long> getMyLastEventTransTimeHashtable()
    • getKeepAliveTime

      public int getKeepAliveTime()