org.norther.tammi.root.db
Interface RepositoryClient

All Known Subinterfaces:
BeanRepositoryClient, BeanRepositoryFilter, MultiRepositoryClient, RepositoryFilter, RepositoryRealm, VariableRootMBean
All Known Implementing Classes:
DefaultBeanRepositoryClient, DefaultBeanRepositoryFilter, DefaultMultiRepositoryClient, DefaultRepositoryClient, DefaultRepositoryFilter, DefaultRepositoryRealm, VariableRoot

public interface RepositoryClient

An interface to repository clients interacting with a repository through a persister. The repository connection can be specified with the corresponding methods or through a property file.

Author:
Ilkka Priha

Method Summary
 Persister acquirePersister()
          Acquires a persister through the default connection.
 Persister acquirePersister(Principal principal)
          Acquires an authenticated persister through the default connection.
 Persister acquirePersister(String user, String pswd)
          Acquires an authenticated persister through the default connection.
 String getAuthenticatedPasswordKey()
          Gets the authenticated password key.
 String getAuthenticatedUsernameKey()
          Gets the authenticated username key.
 String getAuthenticationConnectionKey()
          Gets the authentication connection key.
 String getConnectionKey()
          Gets the default connection key of the repository this client uses.
 String getConnectionUsername()
          Gets the user's login name for the default connection.
 String getPersisterClassName()
          Gets the class name of the persister implemention for the default connection.
 boolean isConnectionAuthenticated()
          Checks whether authentication is configured for the default connection.
 void setAuthenticationConnection(String alias, String userKey, String pswdKey)
          Sets authentication connection.
 void setConnectionAuthenticated(boolean auth)
          Sets whether authentication is configured for the default connection.
 void setConnectionKey(String key)
          Sets the default connection key of the repository this client uses.
 void setConnectionPassword(String password)
          Sets the user's credentials for the default connection.
 void setConnectionUsername(String username)
          Sets the user's login name for the default connection.
 void setPersisterClassName(String className)
          Sets the class name of the persister implementation for the default connection.
 

Method Detail

getConnectionKey

String getConnectionKey()
Gets the default connection key of the repository this client uses.

Returns:
the connection key.

setConnectionKey

void setConnectionKey(String key)
Sets the default connection key of the repository this client uses.

Parameters:
key - the connection key.

getPersisterClassName

String getPersisterClassName()
Gets the class name of the persister implemention for the default connection.

Returns:
the persister class name.

setPersisterClassName

void setPersisterClassName(String className)
Sets the class name of the persister implementation for the default connection.

Parameters:
className - the persister class name.

getConnectionUsername

String getConnectionUsername()
Gets the user's login name for the default connection.

Returns:
the user's repository connection login name.

setConnectionUsername

void setConnectionUsername(String username)
Sets the user's login name for the default connection.

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

setConnectionPassword

void setConnectionPassword(String password)
Sets the user's credentials for the default connection.

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

isConnectionAuthenticated

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

Returns:
true for an authenticated connection, false otherwise.

setConnectionAuthenticated

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

Parameters:
auth - true for an authenticated connection, false otherwise.

getAuthenticationConnectionKey

String getAuthenticationConnectionKey()
Gets the authentication connection key.

Returns:
the authentication connection key or null.

getAuthenticatedUsernameKey

String getAuthenticatedUsernameKey()
Gets the authenticated username key.

Returns:
the authenticated username key or null.

getAuthenticatedPasswordKey

String getAuthenticatedPasswordKey()
Gets the authenticated password key.

Returns:
the authenticated password key or null.

setAuthenticationConnection

void setAuthenticationConnection(String alias,
                                 String userKey,
                                 String pswdKey)
Sets authentication connection.

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

acquirePersister

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

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

acquirePersister

Persister acquirePersister(String user,
                           String pswd)
                           throws ConstructionException
Acquires an authenticated persister through the default 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:
user - the username of the connection.
pswd - the password of the connection.
Returns:
the authenticated persister.
Throws:
ConstructionException - if construction fails.

acquirePersister

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

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


Copyright © 2004 The Norther Organization. All rights reserved.