org.aselect.server.udb.sasdb
Class SASDBConnector

java.lang.Object
  extended by org.aselect.server.udb.sasdb.SASDBConnector
All Implemented Interfaces:
IUDBConnector

public class SASDBConnector
extends java.lang.Object
implements IUDBConnector

SASDB UDB connection.

Description:
The SASDB first checks if a user exists in the configured database.
If the user doesn't exist in that database, default user attributes will be generated for the authsps configured in the SASDB config section.

Concurrency issues:
-

Author:
Alfa & Ariss

Constructor Summary
SASDBConnector()
           
 
Method Summary
 java.lang.String getUserAttributes(java.lang.String sUserId, java.lang.String sAuthSPId)
          Retrieve the A-Select user attributes.
 java.util.Hashtable getUserProfile(java.lang.String sUserId)
          Resolves the user attributes for the supplied user id.
 void init(java.lang.Object oConfigSection)
          Reads the SASSB configuration and initializes the SASDB udb storage.
 boolean isUserEnabled(java.lang.String sUserId)
          Check if user is A-Select enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SASDBConnector

public SASDBConnector()
Method Detail

init

public void init(java.lang.Object oConfigSection)
          throws ASelectUDBException
Reads the SASSB configuration and initializes the SASDB udb storage.

The following configuration is read: - The udb storage which optional - No filter has to be configured - Every filter must have an unique id, starting with 1 and increased by one - One or more authsps must be configured were the user attribute will be generated for

Specified by:
init in interface IUDBConnector
Parameters:
oConfigSection - containing the configuration section for this component
Throws:
ASelectUDBException - if the component could not be initialized by missing config parameters or could not open a connection
See Also:
IUDBConnector.init(java.lang.Object)

getUserProfile

public java.util.Hashtable getUserProfile(java.lang.String sUserId)
Resolves the user attributes for the supplied user id.

- It first checks if the user exists in the configured udb (udb_storage)
- Checks if the user id matches all configured filters
- Creates user attributes for all authsps configured in the sas db connector

The user attribute that is set is always the user id.

Specified by:
getUserProfile in interface IUDBConnector
Parameters:
sUserId - containing the user id by which the user is known in the user database
Returns:
a Hashtable containing the user information (authsp information and result code)
See Also:
IUDBConnector.getUserProfile(java.lang.String)

getUserAttributes

public java.lang.String getUserAttributes(java.lang.String sUserId,
                                          java.lang.String sAuthSPId)
                                   throws ASelectUDBException
Retrieve the A-Select user attributes.

Specified by:
getUserAttributes in interface IUDBConnector
Parameters:
sUserId - The user ID.
sAuthSPId - The AuthSP ID
Returns:
The user attributes.
Throws:
ASelectUDBException - If database fails.
See Also:
IUDBConnector.getUserAttributes(java.lang.String, java.lang.String)

isUserEnabled

public boolean isUserEnabled(java.lang.String sUserId)
                      throws ASelectUDBException
Check if user is A-Select enabled.

Specified by:
isUserEnabled in interface IUDBConnector
Parameters:
sUserId - the user to check.
Returns:
true if user is A-Select enabled, otherwise false.
Throws:
ASelectUDBException - If database fails.
See Also:
IUDBConnector.isUserEnabled(java.lang.String)


Copyright © 2008 SURFnet BV. All Rights Reserved.