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

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

public class TConnectionFactory
extends java.lang.Object

TConnectionFactory is the factory class for the instantiation of TConnection instances. It is responsible for configuration and instantiation of TConnection instances. This class implements the singleton pattern, i.e. there is always only one instance of this class available.

With Tamino 4.2 it is also possible to retrieve the list of available databases for a given Tamino server.
Please note that this may require web server athentication.

Version:
$Revision: 1.30 $
Author:
Marcus Schreyer

Constructor Summary
protected TConnectionFactory()
          Default Constructor.
 
Method Summary
 java.util.Set<TDatabase> getDatabases(java.lang.String taminoHostUri)
          Retrieve the list of all available Tamino database URIs from the specified Tamino without authentication.
 java.util.Set<TDatabase> getDatabases(java.lang.String taminoHostUri, java.lang.String userId, java.lang.String password)
          Retrieve the list of all available Tamino database URIs from the specified Tamino with the authentication parameters userId and password.
 java.util.Set<TDatabase> getDatabases(java.lang.String taminoHostUri, java.lang.String domain, java.lang.String userId, java.lang.String password)
          Retrieve the list of all available Tamino database URIs from the specified Tamino with the authentication parameters domain, userId and password.
static TConnectionFactory getInstance()
          Gets the singleton TConnectionFactory instance.
 TConnection newConnection(java.lang.String databaseUri)
          Creates a TConnection instance for the given database without authentication parameters.
 TConnection newConnection(java.lang.String databaseUri, java.util.Locale locale)
          Creates a TConnection instance for the given database without authentication parameters and specified locale.
 TConnection newConnection(java.lang.String databaseUri, SecurityToken token)
           
 TConnection newConnection(java.lang.String databaseUri, SecurityToken token, java.util.Locale locale)
          Create a TConnection instance with the give database URI, security token, and the specified locale
 TConnection newConnection(java.lang.String databaseUri, SecurityToken token, java.util.Locale locale, java.util.Properties sslProperties)
          Create a TConnection instance with the give database URI, security token, and SSL properties for https.
This method is designed for internal use only!
 TConnection newConnection(java.lang.String databaseUri, java.lang.String userId, java.lang.String password)
          Creates a TConnection instance for the given database with the specified authentication parameters userId and password.
 TConnection newConnection(java.lang.String databaseUri, java.lang.String userId, java.lang.String password, java.util.Locale locale)
          Creates a TConnection instance for the given database with the specified authentication parameters userId and password and specified locale.
 TConnection newConnection(java.lang.String databaseUri, java.lang.String userId, java.lang.String password, java.util.Locale locale, java.util.Properties sslProperties)
          Creates a https TConnection instance for the given database with the specified authentication parameters userId, password and ssl properties.
This method is designed for internal use only!
 TConnection newConnection(java.lang.String databaseUri, java.lang.String userId, java.lang.String password, java.util.Properties sslProperties)
          Creates a https TConnection instance for the given database with the specified authentication parameters userId, password and ssl properties.
This method is designed for internal use only!
 TConnection newConnection(java.lang.String databaseUri, java.lang.String domain, java.lang.String userId, java.lang.String password)
          Creates a TConnection instance for the given database with the specified authentication parameters domain, userId and password.
 TConnection newConnection(java.lang.String databaseUri, java.lang.String domain, java.lang.String userId, java.lang.String password, java.util.Locale locale)
          Creates a TConnection instance for the given database with the specified authentication parameters domain, userId and password and specified locale.
 TConnection newConnection(java.lang.String databaseUri, java.lang.String domain, java.lang.String userId, java.lang.String password, java.util.Properties sslProperties)
          Creates a TConnection instance for the given database with the specified authentication parameters domain, userId and password.
 TConnection newConnection(TDatabase database)
          Creates a TConnection instance for the given database without authentication parameters.
 TConnection newConnection(TDatabase database, java.util.Locale locale)
          Creates a TConnection instance for the given database without authentication parameters and specified locale.
 TConnection newConnection(TDatabase database, SecurityToken token)
          Creates a TConnection instance with the give Database and security Token
 TConnection newConnection(TDatabase database, SecurityToken token, java.util.Locale locale)
          Create the TConnection instance with the given database, security token and the specified locale.
 TConnection newConnection(TDatabase database, java.lang.String userId, java.lang.String password)
          Creates a TConnection instance for the given database with the specified authentication parameters userId and password.
 TConnection newConnection(TDatabase database, java.lang.String userId, java.lang.String password, java.util.Locale locale)
          Creates a TConnection instance for the given database with the specified authentication parameters userId and password and specified locale.
 TConnection newConnection(TDatabase database, java.lang.String domain, java.lang.String userId, java.lang.String password)
          Creates a TConnection instance for the given database with the specified authentication parameters domain, userId and password.
 TConnection newConnection(TDatabase database, java.lang.String domain, java.lang.String userId, java.lang.String password, java.util.Locale locale)
          Creates a TConnection instance for the given database with the specified authentication parameters domain, userId and password and specified locale.
 TConnection newConnection(TDatabase database, java.lang.String domain, java.lang.String userId, java.lang.String password, java.util.Properties sslProperties)
          Creates a TConnection instance for the given database with the specified authentication parameters domain, userId and password.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TConnectionFactory

protected TConnectionFactory()
Default Constructor.

Method Detail

getInstance

public static TConnectionFactory getInstance()
Gets the singleton TConnectionFactory instance.

Returns:
the singleton TConnectionFactory instance.

newConnection

public TConnection newConnection(java.lang.String databaseUri)
                          throws TServerNotAvailableException
Creates a TConnection instance for the given database without authentication parameters.

Parameters:
databaseURI - the URI of the Tamino database.
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException - signals that the Tamino database is not available.

newConnection

public TConnection newConnection(java.lang.String databaseUri,
                                 java.lang.String userId,
                                 java.lang.String password)
                          throws TServerNotAvailableException
Creates a TConnection instance for the given database with the specified authentication parameters userId and password.

Parameters:
databaseUri - the uri of the Tamino database.
userId - the user id to be used for authentication.
password - the password to be used for authentication.
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException - signals that the Tamino database is not available.

newConnection

public TConnection newConnection(java.lang.String databaseUri,
                                 java.lang.String userId,
                                 java.lang.String password,
                                 java.util.Properties sslProperties)
                          throws TServerNotAvailableException
Creates a https TConnection instance for the given database with the specified authentication parameters userId, password and ssl properties.
This method is designed for internal use only!

Parameters:
databaseUri - the uri of the Tamino database.
userId - the user id to be used for authentication.
password - the password to be used for authentication.
sslProperties - properties class with custom ssl properties (internal use)
Returns:
Throws:
TServerNotAvailableException

newConnection

public TConnection newConnection(java.lang.String databaseUri,
                                 java.lang.String userId,
                                 java.lang.String password,
                                 java.util.Locale locale,
                                 java.util.Properties sslProperties)
                          throws TServerNotAvailableException
Creates a https TConnection instance for the given database with the specified authentication parameters userId, password and ssl properties.
This method is designed for internal use only!

Parameters:
databaseUri - the uri of the Tamino database.
userId - the user id to be used for authentication.
password - the password to be used for authentication.
locale - given locale
sslProperties - properties class with custom ssl properties (internal use)
Returns:
Throws:
TServerNotAvailableException

newConnection

public TConnection newConnection(java.lang.String databaseUri,
                                 java.lang.String domain,
                                 java.lang.String userId,
                                 java.lang.String password)
                          throws TServerNotAvailableException
Creates a TConnection instance for the given database with the specified authentication parameters domain, userId and password.

Parameters:
databaseUri - the uri of the Tamino database.
domain - the domain to be used for authentication
userId - the user id to be used for authentication.
password - the password to be used for authentication.
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException - signals that the Tamino database is not available.

newConnection

public TConnection newConnection(java.lang.String databaseUri,
                                 java.lang.String domain,
                                 java.lang.String userId,
                                 java.lang.String password,
                                 java.util.Properties sslProperties)
                          throws TServerNotAvailableException
Creates a TConnection instance for the given database with the specified authentication parameters domain, userId and password.

Parameters:
databaseUri - the uri of the Tamino database.
domain - the domain to be used for authentication
userId - the user id to be used for authentication.
password - the password to be used for authentication.
sslProperties - properties class with custom ssl properties (internal use)
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException - signals that the Tamino database is not available.

newConnection

public TConnection newConnection(TDatabase database)
                          throws TServerNotAvailableException
Creates a TConnection instance for the given database without authentication parameters.

Parameters:
database - the Tamino database.
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException - signals that the Tamino database is not available.

newConnection

public TConnection newConnection(TDatabase database,
                                 java.lang.String userId,
                                 java.lang.String password)
                          throws TServerNotAvailableException
Creates a TConnection instance for the given database with the specified authentication parameters userId and password.

Parameters:
database - the Tamino database.
userId - the user id to be used for authentication.
password - the password to be used for authentication.
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException - signals that the Tamino database is not available.

newConnection

public TConnection newConnection(TDatabase database,
                                 java.lang.String domain,
                                 java.lang.String userId,
                                 java.lang.String password)
                          throws TServerNotAvailableException
Creates a TConnection instance for the given database with the specified authentication parameters domain, userId and password.

Parameters:
database - the Tamino database.
domain - the domain to be used for authentication
userId - the user id to be used for authentication.
password - the password to be used for authentication.
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException - signals that the Tamino database is not available.

newConnection

public TConnection newConnection(TDatabase database,
                                 java.lang.String domain,
                                 java.lang.String userId,
                                 java.lang.String password,
                                 java.util.Properties sslProperties)
                          throws TServerNotAvailableException
Creates a TConnection instance for the given database with the specified authentication parameters domain, userId and password.

Parameters:
database - the Tamino database.
domain - the domain to be used for authentication
userId - the user id to be used for authentication.
password - the password to be used for authentication.
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException - signals that the Tamino database is not available.

newConnection

public TConnection newConnection(java.lang.String databaseUri,
                                 java.util.Locale locale)
                          throws TServerNotAvailableException
Creates a TConnection instance for the given database without authentication parameters and specified locale.

Parameters:
databaseURI - the URI of the Tamino database.
locale - the locale
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException - signals that the Tamino database is not available.

newConnection

public TConnection newConnection(java.lang.String databaseUri,
                                 java.lang.String userId,
                                 java.lang.String password,
                                 java.util.Locale locale)
                          throws TServerNotAvailableException
Creates a TConnection instance for the given database with the specified authentication parameters userId and password and specified locale.

Parameters:
databaseUri - the uri of the Tamino database.
userId - the user id to be used for authentication.
password - the password to be used for authentication.
locale - the locale
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException - signals that the Tamino database is not available.

newConnection

public TConnection newConnection(java.lang.String databaseUri,
                                 java.lang.String domain,
                                 java.lang.String userId,
                                 java.lang.String password,
                                 java.util.Locale locale)
                          throws TServerNotAvailableException
Creates a TConnection instance for the given database with the specified authentication parameters domain, userId and password and specified locale.

Parameters:
databaseUri - the uri of the Tamino database.
domain - the domain to be used for authentication
userId - the user id to be used for authentication.
password - the password to be used for authentication.
locale - the locale.
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException - signals that the Tamino database is not available.

newConnection

public TConnection newConnection(TDatabase database,
                                 java.util.Locale locale)
                          throws TServerNotAvailableException
Creates a TConnection instance for the given database without authentication parameters and specified locale.

Parameters:
database - the Tamino database.
locale - the locale.
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException - signals that the Tamino database is not available.

newConnection

public TConnection newConnection(TDatabase database,
                                 java.lang.String userId,
                                 java.lang.String password,
                                 java.util.Locale locale)
                          throws TServerNotAvailableException
Creates a TConnection instance for the given database with the specified authentication parameters userId and password and specified locale.

Parameters:
database - the Tamino database.
userId - the user id to be used for authentication.
password - the password to be used for authentication.
locale - the locale.
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException - signals that the Tamino database is not available.

newConnection

public TConnection newConnection(TDatabase database,
                                 java.lang.String domain,
                                 java.lang.String userId,
                                 java.lang.String password,
                                 java.util.Locale locale)
                          throws TServerNotAvailableException
Creates a TConnection instance for the given database with the specified authentication parameters domain, userId and password and specified locale.

Parameters:
database - the Tamino database.
domain - the domain to be used for authentication
userId - the user id to be used for authentication.
password - the password to be used for authentication.
locale - the locale.
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException - signals that the Tamino database is not available.

newConnection

public TConnection newConnection(java.lang.String databaseUri,
                                 SecurityToken token)
                          throws TServerNotAvailableException
Throws:
TServerNotAvailableException

newConnection

public TConnection newConnection(TDatabase database,
                                 SecurityToken token)
                          throws TServerNotAvailableException
Creates a TConnection instance with the give Database and security Token

Parameters:
database - the database object
token - the security token object
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException

newConnection

public TConnection newConnection(java.lang.String databaseUri,
                                 SecurityToken token,
                                 java.util.Locale locale)
                          throws TServerNotAvailableException
Create a TConnection instance with the give database URI, security token, and the specified locale

Parameters:
databaseUri - the database URI
token - the security token object
locale - the locale.
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException

newConnection

public TConnection newConnection(java.lang.String databaseUri,
                                 SecurityToken token,
                                 java.util.Locale locale,
                                 java.util.Properties sslProperties)
                          throws TServerNotAvailableException
Create a TConnection instance with the give database URI, security token, and SSL properties for https.
This method is designed for internal use only!

Parameters:
databaseUri - the database URI
token - the security token object
locale - the locale.
sslProperties - the ssl properties (internal use)
Returns:
a TConnection instance.
Throws:
TServerNotAvailableException

newConnection

public TConnection newConnection(TDatabase database,
                                 SecurityToken token,
                                 java.util.Locale locale)
                          throws TServerNotAvailableException
Create the TConnection instance with the given database, security token and the specified locale.

Parameters:
database - the TDatabase object
token - the security token object
locale - the locale.
Returns:
a TConnection instance
Throws:
TServerNotAvailableException

getDatabases

public java.util.Set<TDatabase> getDatabases(java.lang.String taminoHostUri)
                                      throws TServerNotAvailableException
Retrieve the list of all available Tamino database URIs from the specified Tamino without authentication.

This feature requires Tamino 4.2

Parameters:
taminoHostUri - the uri of the Tamino host, e.g. "http://myserver/tamino".
Returns:
a Set with TDatabase instances.
Throws:
TServerNotAvailableException - signals problems retrieving the list.

getDatabases

public java.util.Set<TDatabase> getDatabases(java.lang.String taminoHostUri,
                                             java.lang.String userId,
                                             java.lang.String password)
                                      throws TServerNotAvailableException
Retrieve the list of all available Tamino database URIs from the specified Tamino with the authentication parameters userId and password.

This feature requires Tamino 4.2

Parameters:
taminoHostUri - the uri of the Tamino host, e.g. "http://myserver/tamino".
userId - the user id to be used for authentication.
password - the password to be used for authentication.
Returns:
a Set with TDatabase instances.
Throws:
TServerNotAvailableException - signals problems retrieving the list.

getDatabases

public java.util.Set<TDatabase> getDatabases(java.lang.String taminoHostUri,
                                             java.lang.String domain,
                                             java.lang.String userId,
                                             java.lang.String password)
                                      throws TServerNotAvailableException
Retrieve the list of all available Tamino database URIs from the specified Tamino with the authentication parameters domain, userId and password.

This feature requires Tamino 4.2

Parameters:
taminoHostUri - the uri of the Tamino host, e.g. "http://myserver/tamino".
domain - the domain to be used for authentication
userId - the user id to be used for authentication.
password - the password to be used for authentication.
Returns:
a Set with TDatabase instances.
Throws:
TServerNotAvailableException - signals problems retrieving the list.


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