Skip to main content

com.eruces.teagent.TEAgentConnection

The TEAgentConnection class opens a pure connection to a Key Service.

Inheritance

Public Member Functions

MemberDescription
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

ParameterDescription
strServerNameA string representing the name of a Key Server.
nPortAn 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

ParameterDescription
oAn 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

ParameterDescription
strServerNameA string representing the name of a Key Server or IP
nPortAn integer representing a the port of the Key Service.
strUserNameA string representing a user's name.
strPasswdA 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

ParameterDescription
strServerNameA string representing the name of a Key Server or IP
nPortAn integer representing a the port of the Key Service.
ctxAn AuthenticationContext object.

synchronized void close()

The close method closes a connection.

synchronized void encrypt(TEAgent agent)

The encrypt method encrypts data.

Parameters

ParameterDescription
agentA TEAgent object to be encrypted.

synchronized void decrypt(TEAgent agent)

The decrypt method decrypts data.

Parameters

ParameterDescription
agentA TEAgent object to be decrypted

void setTimeout(int nTimeout)

The setTimeout method sets the length of a session before timeout.

Parameters

ParameterDescription
nTimeoutAn 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.