Package kr.ac.konkuk.ccslab.cm.entity
Class CMSessionInfo
java.lang.Object
kr.ac.konkuk.ccslab.cm.entity.CMSessionInfo
- Direct Known Subclasses:
CMSession
This class represents information of a session.
The session information is the session name, the session address and port number, and the current number of session members. The session name is the identifier of the session that is managed by a CM server that can be accessed by the session address and port number.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty CMSessionInfo object.CMSessionInfo
(String sname, String address, int port) Creates a CMSessionInfo object with the session name, the session address and the port number.CMSessionInfo
(String sname, String address, int port, int nUserNum) Creates a CMSessionInfo object with the session name, the session address and the port number, and the number of session members. -
Method Summary
Modifier and TypeMethodDescriptionGets the session address.int
getPort()
Gets the session port number.Gets the session name.int
Gets the current number of session members.void
setAddress
(String addr) Sets the session address.void
setPort
(int port) Sets the session port number.void
setSessionName
(String name) Sets the session name.void
setUserNum
(int num) Sets the current number of session members.
-
Field Details
-
m_strSessionName
-
m_strAddress
-
m_nPort
protected int m_nPort -
m_nUserNum
protected int m_nUserNum
-
-
Constructor Details
-
CMSessionInfo
public CMSessionInfo()Creates an empty CMSessionInfo object. -
CMSessionInfo
Creates a CMSessionInfo object with the session name, the session address and the port number.- Parameters:
sname
- - the session nameaddress
- - the session address (The IP address of a CM server that manages the session.)port
- - the session port number (The port number of a CM server that manages the session.)
-
CMSessionInfo
Creates a CMSessionInfo object with the session name, the session address and the port number, and the number of session members.- Parameters:
sname
- - the session nameaddress
- - the session address (The IP address of a CM server that manages the session.)port
- - the session port number (The port number of a CM server that manages the session.)nUserNum
- - the current number of users who belong to the session.
-
-
Method Details
-
setSessionName
Sets the session name.- Parameters:
name
- - the session name
-
setAddress
Sets the session address.- Parameters:
addr
- - the session address (The IP address of a CM server that manages the session.)
-
setPort
public void setPort(int port) Sets the session port number.- Parameters:
port
- - the session port number (The port number of a CM server that manages the session.)
-
setUserNum
public void setUserNum(int num) Sets the current number of session members.- Parameters:
num
- - the current number of users who belong to the session.
-
getSessionName
Gets the session name.- Returns:
- - the session name, or an empty string if the session name is not available.
-
getAddress
Gets the session address.- Returns:
- - the session address, or an empty string if the session address is not available.
-
getPort
public int getPort()Gets the session port number.- Returns:
- - the session port number, or -1 if the port number is not available.
-
getUserNum
public int getUserNum()Gets the current number of session members.- Returns:
- - the current number of session members, or -1 if the current number is not available.
-