Skip to main content

com.eruces.teagent.TEAgentConnectionPool

The TEAgentConnectionPool class creates a connection pool.

Multiple property files may be used to create multiple connection pools.

Since: 1.0

© Pi Soft, 2018-2026 · Tricryption Engine 8.1

Public Member Functions

MemberDescription
TEAgentConnectionPool()The TEAgentConnectionPool constructor is the default constructor.
TEAgentConnectionPool(String strPropertyFile)The TEAgentConnectionPool constructor specifies a property file name.
synchronized void setServer(short nConnType, String strServerName, int nPort, int nConnNum)The setServer method sets server connection information.
synchronized void connect(String strUser, String strPasswd)The connect method connects to a server using a username and password.
synchronized void reset()The reset method resets the connection pool.
synchronized TEAgentConnection getConnection()The getConnection method gets a connection instance from a connection pool.
synchronized void releaseConnection(TEAgentConnection conn)The releaseConnection method releases a used connection back to the connection pool.
void encrypt(TEAgent agent)The encrypt method encrypts data.
void decrypt(TEAgent agent)The decrypt method decrypts data.

Member Function Documentation

TEAgentConnectionPool()

The TEAgentConnectionPool constructor is the default constructor.

TEAgentConnectionPool(String strPropertyFile)

The TEAgentConnectionPool constructor specifies a property file name.

Parameters

ParameterDescription
strPropertyFileA string representing the name of a property file.

Exceptions

ExceptionDescription
TEAgentExceptionif the request cannot be completed on the connection, or the Key Service returns an error for it (delivered as a TEServerException).

synchronized void setServer(short nConnType, String strServerName, int nPort, int nConnNum)

The setServer method sets server connection information.

Parameters

ParameterDescription
nConnTypeA short integer representing the type of connection.
strServerNameA string representing a server name or ip address.
nPortAn integer representing a port number.
nConnNumAn integer representing the number of connections.

Exceptions

ExceptionDescription
TEAgentExceptionif the request cannot be completed on the connection, or the Key Service returns an error for it (delivered as a TEServerException).

synchronized void connect(String strUser, String strPasswd)

The connect method connects to a server using a username and password.

Parameters

ParameterDescription
strUserA string representing a username.
strPasswdA string representing a password.

Exceptions

ExceptionDescription
TEAgentExceptionif the request cannot be completed on the connection, or the Key Service returns an error for it (delivered as a TEServerException).

synchronized void reset()

The reset method resets the connection pool.

Exceptions

ExceptionDescription
TEAgentExceptionif the request cannot be completed on the connection, or the Key Service returns an error for it (delivered as a TEServerException).

synchronized TEAgentConnection getConnection()

The getConnection method gets a connection instance from a connection pool.

Exceptions

ExceptionDescription
TEAgentExceptionif the request cannot be completed on the connection, or the Key Service returns an error for it (delivered as a TEServerException).

Returns: Returns a TEAgentConnection object; null if no connection is available.

synchronized void releaseConnection(TEAgentConnection conn)

The releaseConnection method releases a used connection back to the connection pool.

Parameters

ParameterDescription
connA TEAgentConnection object to be released.

Exceptions

ExceptionDescription
TEAgentExceptionif the request cannot be completed on the connection, or the Key Service returns an error for it (delivered as a TEServerException).

void encrypt(TEAgent agent)

The encrypt method encrypts data.

Parameters

ParameterDescription
agentA TEAgent object to be encrypted.

Exceptions

ExceptionDescription
TEAgentExceptionif the request cannot be completed on the connection, or the Key Service returns an error for it (delivered as a TEServerException).

void decrypt(TEAgent agent)

The decrypt method decrypts data.

Parameters

ParameterDescription
agentA TEAgent object to be decrypted.

Exceptions

ExceptionDescription
TEAgentExceptionif the request cannot be completed on the connection, or the Key Service returns an error for it (delivered as a TEServerException).