public class ConnectionData extends Object
Connection
Constructor | Description |
---|---|
ConnectionData(Socket sock,
ConnectionManager cm) |
Constructs a ConnectionData instance storing vital
information about a connection.
|
Modifier and Type | Method | Description |
---|---|---|
void |
activity() |
Sets a new timestamp to the actual time in millis
retrieved from the System.
|
Map<String,String> |
getEnvironment() |
Returns the hashmap for storing and
retrieving environment variables to be passed
between shells.
|
String |
getHostAddress() |
Returns the IP address of the connection.
|
String |
getHostName() |
Returns the fully qualified host name for the connection's IP address.
The name is cached on creation for performance reasons. |
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.
|
Locale |
getLocale() |
Returns the Locale object associated with the connection
by carrying out a simple domain match.
|
String |
getLoginShell() |
Returns the login shell name.
|
ConnectionManager |
getManager() |
Returns a reference to the ConnectionManager the
connection is associated with.
|
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.
|
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(String s) |
Sets the login shell name.
|
void |
setNegotiatedTerminalType(String termtype) |
Sets the terminal type that has been negotiated
between telnet client and telnet server, in form of
a String.
|
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. |
public ConnectionData(Socket sock, ConnectionManager cm)
sock
- Socket of the inbound connection.cm
- the connection managerpublic ConnectionManager getManager()
ConnectionManager
public Socket getSocket()
Socket
public int getPort()
public String getHostName()
public String getHostAddress()
public InetAddress getInetAddress()
public Locale getLocale()
public long getLastActivity()
public void activity()
public boolean isWarned()
public void setWarned(boolean bool)
bool
- true if a warning is to be issued,
false if to be removed.activity()
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 String getNegotiatedTerminalType()
public void setNegotiatedTerminalType(String termtype)
This method should not be called explicitly by the application (i.e. the its here for the io subsystem).
termtype
- the negotiated terminal type as String.public Map<String,String> getEnvironment()
public String getLoginShell()
public void setLoginShell(String s)
s
- the shell name as string.public boolean isLineMode()
public void setLineMode(boolean b)
b
- true if to be initialized in linemode,
false otherwise.Copyright © 2020. All rights reserved.