org.norther.tammi.root.db
Interface MultiRepositoryClient

All Superinterfaces:
RepositoryClient
All Known Subinterfaces:
BeanRepositoryClient, BeanRepositoryFilter, RepositoryFilter, RepositoryRealm
All Known Implementing Classes:
DefaultBeanRepositoryClient, DefaultBeanRepositoryFilter, DefaultMultiRepositoryClient, DefaultRepositoryFilter, DefaultRepositoryRealm

public interface MultiRepositoryClient
extends RepositoryClient

Extends RepositoryClient by supporting multiple connections.

Author:
Ilkka Priha

Method Summary
 Persister acquirePersister(String key)
          Acquires a persister through the specified connection.
 Persister acquirePersister(String key, Principal principal)
          Acquires an authenticated persister through the specified connection.
 Persister acquirePersister(String key, String user, String pswd)
          Acquires an authenticated persister through the specified connection.
 void clearConnections()
          Clears all connections.
 Set connectionKeySet()
          Returns a read-only set of available connection aliases.
 boolean containsConnection(String key)
          Checks the specified connection.
 String getAuthenticatedPasswordKey(String key)
          Gets the authenticated password key of the specified connection.
 String getAuthenticatedUsernameKey(String key)
          Gets the authenticated username key of the specified connection.
 String getAuthenticationConnectionKey(String key)
          Gets the authentication connection key of the specified connection.
 String getConnectionAlias(String key)
          Gets the alias of the specified connection.
 String getConnectionUsername(String key)
          Gets the user's login name of the specified connection.
 String getPersisterClassName(String key)
          Gets the class name of the persister implementation of the specified connection.
 String getResourceKey()
          Gets the resource connection key of the repository this client uses.
 boolean isConnectionAuthenticated(String key)
          Checks whether authentication is configured for the specified connection.
 void removeConnection(String key)
          Removes the specified connection.
 void setAuthenticationConnection(String key, String alias, String userKey, String pswdKey)
          Sets authentication connection of the specified connection.
 void setConnectionAlias(String key, String alias)
          Sets the alias of the specified connection.
 void setConnectionAuthenticated(String key, boolean authenticated)
          Sets whether authentication is configured for the specified connection.
 void setConnectionPassword(String key, String password)
          Sets the user's credentials of the specified connection.
 void setConnectionUsername(String key, String username)
          Sets the user's login name of the specified connection.
 void setPersisterClassName(String key, String className)
          Sets the class name of the persister implementation of the specified connection.
 void setResourceKey(String key)
          Sets the resource connection key of the repository this client uses.
 
Methods inherited from interface org.norther.tammi.root.db.RepositoryClient
acquirePersister, acquirePersister, acquirePersister, getAuthenticatedPasswordKey, getAuthenticatedUsernameKey, getAuthenticationConnectionKey, getConnectionKey, getConnectionUsername, getPersisterClassName, isConnectionAuthenticated, setAuthenticationConnection, setConnectionAuthenticated, setConnectionKey, setConnectionPassword, setConnectionUsername, setPersisterClassName
 

Method Detail

getResourceKey

String getResourceKey()
Gets the resource connection key of the repository this client uses.

Returns:
the resource key.

setResourceKey

void setResourceKey(String key)
Sets the resource connection key of the repository this client uses.

Parameters:
key - the resource key.

getConnectionAlias

String getConnectionAlias(String key)
Gets the alias of the specified connection. The key is applied if not specified.

Parameters:
key - the connection key.
Returns:
the connection alias.

setConnectionAlias

void setConnectionAlias(String key,
                        String alias)
Sets the alias of the specified connection. The key is applied if not specified.

Parameters:
key - the connection key.
alias - the connection alias.

getPersisterClassName

String getPersisterClassName(String key)
Gets the class name of the persister implementation of the specified connection.

Parameters:
key - the connection key.
Returns:
the class name.

setPersisterClassName

void setPersisterClassName(String key,
                           String className)
Sets the class name of the persister implementation of the specified connection.

Parameters:
key - the connection key.
className - the class name.

getConnectionUsername

String getConnectionUsername(String key)
Gets the user's login name of the specified connection.

Parameters:
key - the connection key.
Returns:
the user's repository connection login name.

setConnectionUsername

void setConnectionUsername(String key,
                           String username)
Sets the user's login name of the specified connection.

Parameters:
key - the connection key.
username - the user's repository connection login name.

setConnectionPassword

void setConnectionPassword(String key,
                           String password)
Sets the user's credentials of the specified connection.

Parameters:
key - the connection key.
password - the user's repository connection credentials.

isConnectionAuthenticated

boolean isConnectionAuthenticated(String key)
Checks whether authentication is configured for the specified connection. If username and password are not configured separately, the values passed to the client are used for the connection.

Parameters:
key - the connection key.
Returns:
the class name.

setConnectionAuthenticated

void setConnectionAuthenticated(String key,
                                boolean authenticated)
Sets whether authentication is configured for the specified connection. If username and password are not configured separately, the values passed to the client are used for the connection.

Parameters:
key - the connection key.
authenticated - true if the connection is to be authenticated.

getAuthenticationConnectionKey

String getAuthenticationConnectionKey(String key)
Gets the authentication connection key of the specified connection.

Parameters:
key - the connection key.
Returns:
the authentication connection key or null.

getAuthenticatedUsernameKey

String getAuthenticatedUsernameKey(String key)
Gets the authenticated username key of the specified connection.

Parameters:
key - the connection key.
Returns:
the authenticated username key or null.

getAuthenticatedPasswordKey

String getAuthenticatedPasswordKey(String key)
Gets the authenticated password key of the specified connection.

Parameters:
key - the connection key.
Returns:
the authenticated password key or null.

setAuthenticationConnection

void setAuthenticationConnection(String key,
                                 String alias,
                                 String userKey,
                                 String pswdKey)
Sets authentication connection of the specified connection.

Parameters:
key - the connection key.
alias - the authentication key.
userKey - the username key.
pswdKey - the password key.

containsConnection

boolean containsConnection(String key)
Checks the specified connection.

Parameters:
key - the connection key.
Returns:
true if available, false otherwise.

removeConnection

void removeConnection(String key)
Removes the specified connection.

Parameters:
key - the connection key.

clearConnections

void clearConnections()
Clears all connections.


connectionKeySet

Set connectionKeySet()
Returns a read-only set of available connection aliases.

Returns:
a set of connections aliases.

acquirePersister

Persister acquirePersister(String key)
                           throws ConstructionException
Acquires a persister through the specified connection. If the connection is defined to be an authenticated one, the username and password specified for the connection are applied to authentication.

Parameters:
key - the connection key.
Returns:
the default persister.
Throws:
ConstructionException - if construction fails.

acquirePersister

Persister acquirePersister(String key,
                           String user,
                           String pswd)
                           throws ConstructionException
Acquires an authenticated persister through the specified connection. If the connection is not defined to be an authenticated one or a connection specific identity is defined, the username and password are ignored.

Parameters:
key - the connection key.
user - the username of the connection.
pswd - the password of the connection.
Returns:
the authenticated persister.
Throws:
ConstructionException - if construction fails.

acquirePersister

Persister acquirePersister(String key,
                           Principal principal)
                           throws ConstructionException
Acquires an authenticated persister through the specified connection. If the connection is not defined to be an authenticated one or a connection specific identity is defined, the principal is ignored.

Parameters:
key - the connection key.
principal - an authenticated principal.
Returns:
the authenticated persister.
Throws:
ConstructionException - if construction fails.


Copyright © 2004 The Norther Organization. All rights reserved.