|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.wimpi.telnetd.net.ConnectionData
public class ConnectionData
An utility class that is used to store and allow retrieval of all data associated with a connection.
Connection| Constructor Summary | |
|---|---|
ConnectionData(java.net.Socket sock,
ConnectionManager cm)
Constructs a ConnectionData instance storing vital information about a connection. |
|
| Method Summary | |
|---|---|
void |
activity()
Sets a new timestamp to the actual time in millis retrieved from the System. |
java.util.HashMap |
getEnvironment()
Returns the hashmap for storing and retrieving environment variables to be passed between shells. |
java.lang.String |
getHostAddress()
Returns the IP address of the connection. |
java.lang.String |
getHostName()
Returns the fully qualified host name for the connection's IP address. The name is cached on creation for performance reasons. |
java.net.InetAddress |
getInetAddress()
Returns the InetAddress object associated with the connection. |
long |
getLastActivity()
Returns a timestamp of the last activity that happened on the associated connection. |
java.util.Locale |
getLocale()
Returns the Locale object associated with the connection by carrying out a simple domain match. |
java.lang.String |
getLoginShell()
Returns the login shell name. |
ConnectionManager |
getManager()
Returns a reference to the ConnectionManager the connection is associated with. |
java.lang.String |
getNegotiatedTerminalType()
Returns the terminal type that has been negotiated between the telnet client and the telnet server, in of a String. |
int |
getPort()
Returns the remote port to which the socket is connected. |
java.net.Socket |
getSocket()
Returns a reference to the socket the Connection is associated with. |
int |
getTerminalColumns()
Returns the width of the terminal in columns for convenience. |
int[] |
getTerminalGeometry()
Returns the terminal geometry in an array of two integers. |
int |
getTerminalRows()
Returns the height of the terminal in rows for convenience. |
boolean |
isLineMode()
Tests if in line mode. |
boolean |
isTerminalGeometryChanged()
Returns the state of the terminal geometry changed flag, which will be true if it has been set, and false if not. |
boolean |
isWarned()
Returns the state of the idle warning flag, which will be true if a warning has been issued, and false if not. |
void |
setLineMode(boolean b)
Sets the line mode flag for the connection. |
void |
setLoginShell(java.lang.String s)
Sets the login shell name. |
void |
setNegotiatedTerminalType(java.lang.String termtype)
Sets the terminal type that has been negotiated between telnet client and telnet server, in form of a String. This method should not be called explicitly by the application (i.e. |
void |
setTerminalGeometry(int width,
int height)
Sets the terminal geometry data. This method should not be called explicitly by the application (i.e. |
void |
setWarned(boolean bool)
Sets the state of the idle warning flag. Note that this method will also update the the timestamp if the idle warning flag is removed, which means its kind of a second way to achieve the same thing as with the activity method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConnectionData(java.net.Socket sock,
ConnectionManager cm)
sock - Socket of the inbound connection.| Method Detail |
|---|
public ConnectionManager getManager()
ConnectionManagerpublic java.net.Socket getSocket()
Socketpublic int getPort()
public java.lang.String getHostName()
public java.lang.String getHostAddress()
public java.net.InetAddress getInetAddress()
public java.util.Locale getLocale()
public long getLastActivity()
public void activity()
public void setWarned(boolean bool)
bool - true if a warning is to be issued,
false if to be removed.activity()public boolean isWarned()
public void setTerminalGeometry(int width,
int height)
width - of the terminal in columns.height - of the terminal in rows.public int[] getTerminalGeometry()
public int getTerminalColumns()
public int getTerminalRows()
public boolean isTerminalGeometryChanged()
public void setNegotiatedTerminalType(java.lang.String termtype)
termtype - the negotiated terminal type as String.public java.lang.String getNegotiatedTerminalType()
public java.util.HashMap getEnvironment()
public void setLoginShell(java.lang.String s)
s - the shell name as string.public java.lang.String getLoginShell()
public boolean isLineMode()
public void setLineMode(boolean b)
b - true if to be initialized in linemode,
false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||