Ontimize 5.2072EN

com.ontimize.db
Class MultiConnectionManager

java.lang.Object
  extended bycom.ontimize.db.MultiConnectionManager

public class MultiConnectionManager
extends java.lang.Object


Field Summary
static java.lang.String AUTONUMERICAL_PROPERTIES
          Configuration XML Tag
static java.lang.String CONNECTION_INFO
          Configuration XML Tag
static java.lang.String CONNECTION_MANAGER
          Configuration XML Tag
static java.lang.String CONNECTION_MANAGERS
          Configuration XML Tag
protected static java.util.ArrayList[] connectionManagerEntities
           
protected static java.lang.String[] connectionManagerId
           
protected static DatabaseConnectionManager[] connectionManagers
           
protected static java.util.Hashtable connectionManagerStore
           
protected static java.lang.Number[] connectionMangerNumId
           
protected static java.util.Vector connectionsGroup
           
static java.lang.String DATABASE_MULTICONNECTION_MANAGER
          COnfiguration XML Tag
static java.lang.String DB_PROPERTIES
          Configuration XML Tag
protected static DatabaseMultiConnectionManager dbMCManager
           
protected static DatabaseConnectionManager defaultConnectionManager
           
static java.lang.String ENTITY
          Configuration XML Tag
static java.lang.String ID
           
static java.lang.String INITIAL_CONNECTIONS
          Configuration XML Tag
protected static EntityReferenceLocator locator
           
protected static java.lang.String NAME_ELEMENT
           
protected static java.lang.String PARAM_ELEMENT
           
protected static java.lang.String VALUE_ELEMENT
           
 
Constructor Summary
MultiConnectionManager()
           
 
Method Summary
protected static void _removeConnectionManager(java.lang.Number id)
           
protected static void _removeConnectionManager(java.lang.String id)
           
 void clearConnectionManager()
           
static void commit(java.sql.Connection con)
           This method makes one commit operation of all the connections which are related to the entry parameter except the connections which belong to the standard manager.
protected static void configureDatabaseMultiConnectionManager(org.w3c.dom.NodeList dbMCManagerList)
           
static boolean configureMultiConnectionManager(java.lang.String multiConnectionManagerPath)
           
static void disconnect(java.sql.Connection con)
           All connections that are related to the entry parameter except the standard one will be disconnected
static java.sql.Connection getConnection(java.lang.String entity, java.sql.Connection con, int id)
           Checks if the specified connection belongs to the entity connection manager.
static DatabaseConnectionManager getConnectionManager(java.lang.Number numericId)
          Gets the connection manager with the specified numeric identifier 'numericId'.
static DatabaseConnectionManager getConnectionManager(java.lang.String id)
          Gets the connection manager with the specified identifier 'id'.
static DatabaseConnectionManager getConnectionManagerForEntity(java.lang.String entity)
          Return the connection manager assigned to the specified entity
static java.lang.String[] getConnectionManagerIds()
          Gets all connection manager identifiers
protected static int getDatabaseConnectionManagerListIndex(java.lang.Object id)
           
static DatabaseConnectionManager getDefaultConnectionManager()
          Return default connection manager.
static java.util.List getGroupConnections(java.sql.Connection con)
          Gets a list with all related connections
static OntimizeConnection getOntimizeConnection(java.sql.Connection con, DatabaseConnectionManager connectionManager)
          Gets the Ontimize connection that contains the connection entry parameter.
static java.lang.String getTextValue(org.w3c.dom.Node son)
           
protected static boolean isOwnerConnectionManager(java.sql.Connection con, DatabaseConnectionManager dbcm)
          Checks if the specified connection belongs to the connection manager 'dbcm'
static void removeConnectionManager(java.lang.Object id)
           
static void rollback(java.sql.Connection con)
           This method makes one rollback operation of all the connections which are related to the entry parameter except these that are in the standard manager.
static void setAutoCommit(java.sql.Connection con, boolean autocommit)
           This method makes one commit operation of all the connections which are related to the entry parameter except the connections which belong to the standard manager.
static void setConnectionManager(java.lang.Number numId, java.lang.String id, DatabaseConnectionManager cm, java.util.ArrayList entities)
          Adds a new connection manager to the managers list
static void setConnectionManager(java.lang.String id, DatabaseConnectionManager cm, java.util.ArrayList entities)
          Adds a new connection manager to the managers list
static void setDefaultConnectionManager(DatabaseConnectionManager gC)
           
static void setLocator(EntityReferenceLocator loc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTION_MANAGERS

public static final java.lang.String CONNECTION_MANAGERS
Configuration XML Tag

See Also:
Constant Field Values

DATABASE_MULTICONNECTION_MANAGER

public static final java.lang.String DATABASE_MULTICONNECTION_MANAGER
COnfiguration XML Tag

See Also:
Constant Field Values

CONNECTION_MANAGER

public static final java.lang.String CONNECTION_MANAGER
Configuration XML Tag

See Also:
Constant Field Values

DB_PROPERTIES

public static final java.lang.String DB_PROPERTIES
Configuration XML Tag

See Also:
Constant Field Values

AUTONUMERICAL_PROPERTIES

public static final java.lang.String AUTONUMERICAL_PROPERTIES
Configuration XML Tag

See Also:
Constant Field Values

INITIAL_CONNECTIONS

public static final java.lang.String INITIAL_CONNECTIONS
Configuration XML Tag

See Also:
Constant Field Values

CONNECTION_INFO

public static final java.lang.String CONNECTION_INFO
Configuration XML Tag

See Also:
Constant Field Values

ENTITY

public static final java.lang.String ENTITY
Configuration XML Tag

See Also:
Constant Field Values

ID

public static final java.lang.String ID
See Also:
Constant Field Values

defaultConnectionManager

protected static DatabaseConnectionManager defaultConnectionManager

connectionManagers

protected static DatabaseConnectionManager[] connectionManagers

connectionManagerEntities

protected static java.util.ArrayList[] connectionManagerEntities

connectionMangerNumId

protected static java.lang.Number[] connectionMangerNumId

connectionManagerId

protected static java.lang.String[] connectionManagerId

connectionsGroup

protected static java.util.Vector connectionsGroup

connectionManagerStore

protected static java.util.Hashtable connectionManagerStore

locator

protected static EntityReferenceLocator locator

PARAM_ELEMENT

protected static final java.lang.String PARAM_ELEMENT
See Also:
Constant Field Values

NAME_ELEMENT

protected static final java.lang.String NAME_ELEMENT
See Also:
Constant Field Values

VALUE_ELEMENT

protected static final java.lang.String VALUE_ELEMENT
See Also:
Constant Field Values

dbMCManager

protected static DatabaseMultiConnectionManager dbMCManager
Constructor Detail

MultiConnectionManager

public MultiConnectionManager()
Method Detail

getConnectionManagerIds

public static java.lang.String[] getConnectionManagerIds()
Gets all connection manager identifiers

Returns:

getConnectionManager

public static DatabaseConnectionManager getConnectionManager(java.lang.String id)
Gets the connection manager with the specified identifier 'id'. If no coincidence is found return null

Parameters:
id -
Returns:

getConnectionManager

public static DatabaseConnectionManager getConnectionManager(java.lang.Number numericId)
Gets the connection manager with the specified numeric identifier 'numericId'. If no coincidence is found return null

Parameters:
numericId -
Returns:

setDefaultConnectionManager

public static void setDefaultConnectionManager(DatabaseConnectionManager gC)

setConnectionManager

public static void setConnectionManager(java.lang.Number numId,
                                        java.lang.String id,
                                        DatabaseConnectionManager cm,
                                        java.util.ArrayList entities)
                                 throws java.lang.IllegalArgumentException
Adds a new connection manager to the managers list

Parameters:
numId - Numeric connection manager identifier.
id - Connection manager identifier
cm - Connection Manager Object
entities - Entity list that use this connection manager
Throws:
java.lang.IllegalArgumentException

setConnectionManager

public static void setConnectionManager(java.lang.String id,
                                        DatabaseConnectionManager cm,
                                        java.util.ArrayList entities)
                                 throws java.lang.IllegalArgumentException
Adds a new connection manager to the managers list

Parameters:
id - Connection manager identifier
cm - Connection Manager Object
entities - Entity list that use this connection manager
Throws:
java.lang.IllegalArgumentException

getDefaultConnectionManager

public static DatabaseConnectionManager getDefaultConnectionManager()
Return default connection manager.

Returns:

clearConnectionManager

public void clearConnectionManager()

removeConnectionManager

public static void removeConnectionManager(java.lang.Object id)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

_removeConnectionManager

protected static void _removeConnectionManager(java.lang.Number id)

_removeConnectionManager

protected static void _removeConnectionManager(java.lang.String id)

getDatabaseConnectionManagerListIndex

protected static int getDatabaseConnectionManagerListIndex(java.lang.Object id)

getConnectionManagerForEntity

public static DatabaseConnectionManager getConnectionManagerForEntity(java.lang.String entity)
                                                               throws java.lang.IllegalArgumentException
Return the connection manager assigned to the specified entity

Parameters:
entity -
Returns:
Throws:
java.lang.IllegalArgumentException

isOwnerConnectionManager

protected static boolean isOwnerConnectionManager(java.sql.Connection con,
                                                  DatabaseConnectionManager dbcm)
Checks if the specified connection belongs to the connection manager 'dbcm'

Parameters:
con -
dbcm -
Returns:

getOntimizeConnection

public static OntimizeConnection getOntimizeConnection(java.sql.Connection con,
                                                       DatabaseConnectionManager connectionManager)
Gets the Ontimize connection that contains the connection entry parameter.

Parameters:
con -
connectionManager -
Returns:

getConnection

public static java.sql.Connection getConnection(java.lang.String entity,
                                                java.sql.Connection con,
                                                int id)

Checks if the specified connection belongs to the entity connection manager. If this is true return the same connection, in other case return a connection to the entity connection manager and relates them. To see all related connections @see getGroupConnections(Connection)

Parameters:
entity - Entity name
con - Connection
id -
Returns:
Connection

getGroupConnections

public static java.util.List getGroupConnections(java.sql.Connection con)
Gets a list with all related connections

Parameters:
con -
Returns:

disconnect

public static void disconnect(java.sql.Connection con)

All connections that are related to the entry parameter except the standard one will be disconnected

Parameters:
con -

setAutoCommit

public static void setAutoCommit(java.sql.Connection con,
                                 boolean autocommit)
                          throws java.lang.Exception

This method makes one commit operation of all the connections which are related to the entry parameter except the connections which belong to the standard manager.
Warning: If one connection throws one exception during the commit operation, it is possible that there are connections without realizing the commit operation.

Parameters:
con -
Throws:
java.lang.Exception

commit

public static void commit(java.sql.Connection con)
                   throws java.lang.Exception

This method makes one commit operation of all the connections which are related to the entry parameter except the connections which belong to the standard manager.
Warning: If one connection throws one exception during the commit operation, it is possible that there are connections without realizing the commit operation.

Parameters:
con -
Throws:
java.lang.Exception

rollback

public static void rollback(java.sql.Connection con)
                     throws java.lang.Exception

This method makes one rollback operation of all the connections which are related to the entry parameter except these that are in the standard manager.

Parameters:
con -
Throws:
java.lang.Exception

setLocator

public static void setLocator(EntityReferenceLocator loc)

configureMultiConnectionManager

public static boolean configureMultiConnectionManager(java.lang.String multiConnectionManagerPath)

configureDatabaseMultiConnectionManager

protected static void configureDatabaseMultiConnectionManager(org.w3c.dom.NodeList dbMCManagerList)
                                                       throws java.lang.Exception
Throws:
java.lang.Exception

getTextValue

public static java.lang.String getTextValue(org.w3c.dom.Node son)

Ontimize