uk.org.ogsadai.common.rolemap
Interface RoleMapper

All Known Implementing Classes:
SimpleFileRoleMapper, SimpleFileWithEncryptedPasswordsRoleMapper

public interface RoleMapper

An interface for a component that maps user security credentials to database user names and passwords. The component can perform mappings for one or more databases.

Author:
The OGSA-DAI Team

Method Summary
 Role map(java.lang.String credentials, java.lang.String database)
          Maps the given credentials and database onto a role which can be used to access the database.
 void setConfiguration(java.lang.String configuration)
          Configures the role mapper.
 

Method Detail

setConfiguration

public void setConfiguration(java.lang.String configuration)
                      throws RoleMapConfigurationException
Configures the role mapper. This method must be called before any calls to the map method.

Parameters:
configuration - Configuration information.
Throws:
RoleMapConfigurationException - if any error occurs when processing the configuration.

map

public Role map(java.lang.String credentials,
                java.lang.String database)
         throws RoleMapAuthorizationException,
                RoleMapCannotAuthorizeException
Maps the given credentials and database onto a role which can be used to access the database.

Parameters:
credentials - User credentials.
database - URI of database to get role for.
Returns:
the role to use to access the database.
Throws:
RoleMapAuthorizationException - if the user is not authorized to access the database.
RoleMapCannotAuthorizeException - if a problem arises during the authorization.