RbDe rbde-349 (20120127151154)

edu.mssm.crover.scentral
Interface UserDirectory

All Known Implementing Classes:
UserDirectory_JDBC_Impl, UserDirectory_Serialization_Impl

public interface UserDirectory


Method Summary
 UserRecord getRecord(String recordID)
          Returns the record identified by this recordID.
 UserRecord getRecord(String userID, String password)
          Returns the record identified by the userID and password.
 RestrictedUserRecord getRecordByEmail(String email)
          Gets a restricted interface to the user record.
 void hasChanged(UserRecord record)
          Instructs this directory that the user record state has changed and need to be updated in the directory.
 void initialize()
          This method avoids the use of a specialized constructor that requires more work to invoke through the reflection API.
 boolean isRegistered(String userID, String password)
          Returns whether a record exists that match a userID and password.
 void register(String userID, UserRecord record)
          Registers a user record with this directory.
 

Method Detail

initialize

void initialize()
This method avoids the use of a specialized constructor that requires more work to invoke through the reflection API. The reflection API is used because one implementation is chosen via the name of the implementing class (Class.forName()).


getRecord

UserRecord getRecord(String userID,
                     String password)
Returns the record identified by the userID and password.

Parameters:
userID - The user id for which the record is requested.
password - The password associated with the userID.
Returns:
The record or null if none is found or the authentication fails.

getRecord

UserRecord getRecord(String recordID)
Returns the record identified by this recordID. The recordID is built in such a way that without obtaining it from a valid user record it is very hard to guess. This ensures that only objects that had a reference to a record in the past can obtain this record back from the recordID. This is used to help with persistence issues.

Parameters:
recordID - The record id for which the record is requested.
Returns:
The record or null if none is found or the authentication fails (the recordID is invalid).

isRegistered

boolean isRegistered(String userID,
                     String password)
Returns whether a record exists that match a userID and password.

Returns:
true when a matching record is found in this directory, false otherwise.

register

void register(String userID,
              UserRecord record)
              throws BadUserID,
                     RegistrationFailure
Registers a user record with this directory.

Throws:
BadUserID - Thrown when the userID is already used in this directory.
RegistrationFailure - Thrown when anything went wrong during the storage of the user record in the directory.

hasChanged

void hasChanged(UserRecord record)
Instructs this directory that the user record state has changed and need to be updated in the directory.


getRecordByEmail

RestrictedUserRecord getRecordByEmail(String email)
Gets a restricted interface to the user record. This form can only be used to send an email to the user telling him/her about his/her forgotten password. The restricted interface does not allow to obtain personal information from the record.


RbDe rbde-349 (20120127151154)

Copyright © 2003-2012 Institute for Computational Biomedicine, All Rights Reserved.