com.softwareag.tamino.db.api.connection
Class TConnectionPoolDescriptor

java.lang.Object
  extended by com.softwareag.tamino.db.api.connection.TConnectionPoolDescriptor

public class TConnectionPoolDescriptor
extends java.lang.Object

TConnectionPoolDescriptor describes all the properties for a connection pool.

Version:
$Revision: 1.7 $
Author:
Martin Meijsen

Constructor Summary
TConnectionPoolDescriptor()
          Constructor to construct a TConnectionPoolDescriptor with default settings.
 
Method Summary
 java.lang.String getDatabaseURI()
          Gets the Tamino database URI.
 java.lang.String getDomain()
          Gets the domain.
 int getInitConnections()
          Gets the number of connections initially in the pool.
 TIsolationDegree getIsolationDegree()
          Gets the isolation degree.
 TLockMode getLockMode()
          Gets the lock mode.
 TLockwaitMode getLockwaitMode()
          Gets the current lockwait mode.
 int getMaxConnections()
          Gets the maimum number of connections in the pool.
 long getMaximumTransactionDuration()
          Gets the maximum transaction duration in seconds.
 long getNonActivityTimeout()
          Gets the nonActivity timeout.
 java.lang.String getPassword()
          Gets the password.
 SecurityToken getSecurityToken()
           
 int getTimeOut()
          Gets the pool time out.
 java.lang.String getUser()
          Gets the user id used of all connections in the pool.
 void setDatabaseURI(java.lang.String databaseURI)
          Sets the Tamino database URI to be used for all connections.
 void setDomain(java.lang.String domain)
          Sets the domain to be used for authentication for all connections in the pool.
 void setInitConnections(int initConnections)
          Sets the number of connections that are initially in the pool.
 void setIsolationDegree(TIsolationDegree isolationDegree)
          Sets the isolation degree.
 void setLockMode(TLockMode lockMode)
          Sets the lock mode.
 void setLockwaitMode(TLockwaitMode lockwaitMode)
          Sets the lockwait mode for a transaction.
 void setMaxConnections(int maxConnections)
          Sets the maximum number of connections in the pool.
 void setMaximumTransactionDuration(long maximumTransactionDuration)
          Sets the maximum transaction duration in seconds.
 void setNonActivityTimeout(long nonActivityTimeout)
          Sets the nonActivity timeout.
 void setPassword(java.lang.String password)
          Sets the password to be used for authentication for all connections in the pool.
 void setSecurityToken(SecurityToken token)
           
 void setTimeOut(int timeOut)
          Sets the time out for the pool.
 void setUser(java.lang.String user)
          Sets the user id to be used for authentication for all connections in the pool.
 java.lang.String toString()
          Writes the current descriptor properties to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TConnectionPoolDescriptor

public TConnectionPoolDescriptor()
Constructor to construct a TConnectionPoolDescriptor with default settings.

Method Detail

setMaxConnections

public void setMaxConnections(int maxConnections)
Sets the maximum number of connections in the pool. Once the maximum number has been reached and all connections in the pool are in use, a getConnection() request will wait timeOut seconds for a used connection to be freed and put back into the pool. If no connection is returned in the pool, an exception is thrown. This number must be greater than or equal to the initial number of connections.

Parameters:
maxConnections - an int specifying the maximum number of connections in the pool.

getMaxConnections

public int getMaxConnections()
Gets the maimum number of connections in the pool.

Returns:
the maximum number of connection as an int

setUser

public void setUser(java.lang.String user)
Sets the user id to be used for authentication for all connections in the pool.

Parameters:
the - user id as a String

getUser

public java.lang.String getUser()
Gets the user id used of all connections in the pool.

Returns:
the user id as a String

setTimeOut

public void setTimeOut(int timeOut)
Sets the time out for the pool. Once the maximum number of connections in the pool have been created and all connections are currently in use, the pool manager waits for timeOut seconds for a used connection to be returned to the pool. If this does not happen, an exception is thrown. If 0 is specified as timeOut, the pool manager does not wait and immediately throws an exception.

Parameters:
timeOut - the time out as an int

getTimeOut

public int getTimeOut()
Gets the pool time out.

Returns:
the pool time out as an int

setDomain

public void setDomain(java.lang.String domain)
Sets the domain to be used for authentication for all connections in the pool.

Parameters:
domain - the domain as a String

getDomain

public java.lang.String getDomain()
Gets the domain.

Returns:
the domain as a String

setInitConnections

public void setInitConnections(int initConnections)
Sets the number of connections that are initially in the pool. This number must be lower than or equal to the maximum number of connections.

Parameters:
initConnections - the number of connections initially in the pool as an int

getInitConnections

public int getInitConnections()
Gets the number of connections initially in the pool.

Returns:
an int

setDatabaseURI

public void setDatabaseURI(java.lang.String databaseURI)
Sets the Tamino database URI to be used for all connections.

Parameters:
databaseURI - the database URI as a String

getDatabaseURI

public java.lang.String getDatabaseURI()
Gets the Tamino database URI.

Returns:
the Tamino database URI as a String

setPassword

public void setPassword(java.lang.String password)
Sets the password to be used for authentication for all connections in the pool.

Parameters:
password - the password as a String

getPassword

public java.lang.String getPassword()
Gets the password.

Returns:
the password as a String

setSecurityToken

public void setSecurityToken(SecurityToken token)

getSecurityToken

public SecurityToken getSecurityToken()

setLockwaitMode

public void setLockwaitMode(TLockwaitMode lockwaitMode)
Sets the lockwait mode for a transaction.

Parameters:
lockwaitMode - the lockwait mode to be set, 'null' for Tamino default.

getLockwaitMode

public TLockwaitMode getLockwaitMode()
Gets the current lockwait mode. A 'null' value represents the Tamino default.

Returns:
the lockwait mode. Returns 'null' if no lockwait mode is specified.

setIsolationDegree

public void setIsolationDegree(TIsolationDegree isolationDegree)
Sets the isolation degree.

Parameters:
isolationDegree - the isolation degree to be set, 'null' for Tamino default.

getIsolationDegree

public TIsolationDegree getIsolationDegree()
Gets the isolation degree. A 'null' value represents the Tamino default.

Returns:
the isolation degree. Returns 'null' if no isolation degree is specified.

setLockMode

public void setLockMode(TLockMode lockMode)
Sets the lock mode.

Parameters:
lockMode - the lock mode to be set, 'null' for Tamino default.

getLockMode

public TLockMode getLockMode()
Gets the lock mode. A 'null' value represents the Tamino default.

Returns:
the lock mode. Returns 'null' if no lock mode is specified.

setNonActivityTimeout

public void setNonActivityTimeout(long nonActivityTimeout)
Sets the nonActivity timeout. Note that for pooled connections obtained from a connection pool which configured to pool Tamino physical connections, the invocation of connection.setNonActivityTimeout() has no effect. The default value is set once and for all connections in a pool when the pool is created.

Parameters:
nonActivityTimeout - the transaction nonActivity timeout in seconds be set, TConnection.DEFAULT_TIMEOUT for Tamino default.

getNonActivityTimeout

public long getNonActivityTimeout()
Gets the nonActivity timeout.

Returns:
the transaction nonActivity timeout. Returns DEFAUL_TIMEOUT, if no transaction nonActivity timeout is specified.

setMaximumTransactionDuration

public void setMaximumTransactionDuration(long maximumTransactionDuration)
Sets the maximum transaction duration in seconds.

Parameters:
maximumTransactionDuration - the maximum transaction duration in seconds in seconds be set, TConnection.DEFAULT_TIMEOUT for Tamino default.

getMaximumTransactionDuration

public long getMaximumTransactionDuration()
Gets the maximum transaction duration in seconds.

Returns:
the maximum transaction duration. Returns TConnection.DEFAULT_TIMEOUT, if no transaction timeout is specified.

toString

public java.lang.String toString()
Writes the current descriptor properties to a String.

Overrides:
toString in class java.lang.Object
Returns:
the escriptor properties as a String.


Copyright (c) 2013 Software AG. All Rights Reserved.