com.eruces.teagent.TEAgentConnection
The TEAgentConnection class opens a pure connection to a Key Service.
Inheritance
- Inherits com.eruces.teagent.TESystem
- Inherits Comparable
- Inherited by com.eruces.teagent.TEAgentAuthenticConnection
- Inherited by com.eruces.teagent.TEAgentSSLAuthenticConnection
- Inherited by com.eruces.teagent.TEAgentSSLMConnection
Public Member Functions
| Member | Description |
|---|---|
TEAgentConnection() | The TEAgentConnection constructor constructs a non-connected object. |
TEAgentConnection(String strServerName, int nPort) | The TEAgentConnection constructor constructs a connected object. |
boolean isConnected() | The isConnected method checks whether a socket is currently connected. |
int compareTo(Object o) | The compareTo method compares an object. |
synchronized void open(String strServerName, int nPort, String strUserName, String strPasswd) | The open method opens a connection to a Key Service and authenticates a user. |
synchronized void open(String strServerName, int nPort, AuthenticationContext ctx) | The open method opens a connection to a Key Service. |
synchronized void close() | The close method closes a connection. |
synchronized void encrypt(TEAgent agent) | The encrypt method encrypts data. |
synchronized void decrypt(TEAgent agent) | The decrypt method decrypts data. |
void setTimeout(int nTimeout) | The setTimeout method sets the length of a session before timeout. |
int getTimeout() | The getTimeout method gets the duration of a session before a timeout. |
long getLoginID() | The getLoginID method gets the principal ID of the currently logged in user. |
Member Function Documentation
TEAgentConnection()
The TEAgentConnection constructor constructs a non-connected object.
TEAgentConnection(String strServerName, int nPort)
The TEAgentConnection constructor constructs a connected object.
Parameters
| Parameter | Description |
|---|---|
strServerName | A string representing the name of a Key Server. |
nPort | An integer representing a Key Service port number. |
boolean isConnected()
The isConnected method checks whether a socket is currently connected.
Returns: Returns a boolean value representing the socket connection status; True = connected, False = not connected. This function is valid only in V1.4. It will return a value of True for all previous versions.
int compareTo(Object o)
The compareTo method compares an object.
Parameters
| Parameter | Description |
|---|---|
o | An object to compare to |
Remark: Specified by the compareTo method in java.util.Comparable.
synchronized void open(String strServerName, int nPort, String strUserName, String strPasswd)
The open method opens a connection to a Key Service and authenticates a user.
Parameters
| Parameter | Description |
|---|---|
strServerName | A string representing the name of a Key Server or IP |
nPort | An integer representing a the port of the Key Service. |
strUserName | A string representing a user's name. |
strPasswd | A string containing the user's password |
synchronized void open(String strServerName, int nPort, AuthenticationContext ctx)
The open method opens a connection to a Key Service.
Parameters
| Parameter | Description |
|---|---|
strServerName | A string representing the name of a Key Server or IP |
nPort | An integer representing a the port of the Key Service. |
ctx | An AuthenticationContext object. |
synchronized void close()
The close method closes a connection.
synchronized void encrypt(TEAgent agent)
The encrypt method encrypts data.
Parameters
| Parameter | Description |
|---|---|
agent | A TEAgent object to be encrypted. |
synchronized void decrypt(TEAgent agent)
The decrypt method decrypts data.
Parameters
| Parameter | Description |
|---|---|
agent | A TEAgent object to be decrypted |
void setTimeout(int nTimeout)
The setTimeout method sets the length of a session before timeout.
Parameters
| Parameter | Description |
|---|---|
nTimeout | An integer representing the length of a session, in milliseconds. |
int getTimeout()
The getTimeout method gets the duration of a session before a timeout.
Returns: Returns an integer representing the length of a session before a timeout, expressed in milliseconds.
long getLoginID()
The getLoginID method gets the principal ID of the currently logged in user.
Returns: Returns an integer representing the principal ID of the user.