com.softwareag.mdm.service.directory
Class Directory

java.lang.Object
  extended bycom.softwareag.mdm.service.directory.Directory
Direct Known Subclasses:
DirectoryDefault

public abstract class Directory
extends Object

Defines the users' directory that is used by webMethods MDM for user authentication and roles management.

See Also:
DirectoryFactory

Constructor Summary
Directory()
           
 
Method Summary
 UserReference authenticateUserFromArray(Object[] args)
          Authenticates a user by an open array.
 UserReference authenticateUserFromHttpRequest(HttpServletRequest request)
          Authenticates a user for the purpose of a single sign-on policy.
abstract  UserReference authenticateUserFromLoginPassword(String aLogin, String aPassword)
          Authenticates a user by its login and password.
 String displayBuiltInRole(Role aBuiltInRole, Locale aLocale)
          Returns a label for the built-in role specified.
 String displaySpecificRole(Role aSpecificRole, Locale aLocale)
          Returns a label for the specific role specified.
 String displayUser(UserReference aUserReference, Locale aLocale)
          Returns a label for the user specified.
abstract  List getProfiles(ProfileListContext aProfileContext)
          Returns the profiles according the context specified.
 String getUserEmail(UserReference aUserReference)
          Returns the e-mail address of the user specified, null if it is unknown.
 boolean isRoleStrictlyIncluded(Role aRole, Role anotherRole)
          Returns true when aRole is included in anotherRole.
abstract  boolean isSpecificRoleDefined(Role aSpecificRole)
          Returns true if the specific role specified actually exists in this directory.
abstract  boolean isUserDefined(UserReference aUserReference)
          Returns true if the user specified actually exists in this directory.
abstract  boolean isUserInRole(UserReference aUser, Role aRole)
          Returns true if the user has the role specified.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Directory

public Directory()
Method Detail

authenticateUserFromLoginPassword

public abstract UserReference authenticateUserFromLoginPassword(String aLogin,
                                                                String aPassword)
Authenticates a user by its login and password.

Returns:
the user reference corresponding to the login/password specified, or null if login does not exist or password is incorrect.

authenticateUserFromHttpRequest

public UserReference authenticateUserFromHttpRequest(HttpServletRequest request)
                                              throws AuthenticationException
Authenticates a user for the purpose of a single sign-on policy.

If the implementation of this method does not return null, the user enters directly into Manager session (he does not have to submit its login and password).

More precisely, this method is called each time an initial HTTP request is sent to the Manager:

The default implementation of this method always returns null. This method shall be overridden if a single sign-on behaviour is needed.

Returns:
the user reference retrieved from the HTTP request specified (for example, from its parameters or from its cookies), or null if authentication features are not provided in the request (in which case a login/password is asked to user).
Throws:
AuthenticationException - if authentication cannot complete.

authenticateUserFromArray

public UserReference authenticateUserFromArray(Object[] args)
Authenticates a user by an open array.

The default implementation of this method always returns null.

Returns:
the user reference corresponding to arguments specified, or null no user can be authenticated.

isUserDefined

public abstract boolean isUserDefined(UserReference aUserReference)
Returns true if the user specified actually exists in this directory.

See Also:
DirectoryHandler.isProfileDefined(Profile)

isSpecificRoleDefined

public abstract boolean isSpecificRoleDefined(Role aSpecificRole)
Returns true if the specific role specified actually exists in this directory.

See Also:
DirectoryHandler.isProfileDefined(Profile)

isUserInRole

public abstract boolean isUserInRole(UserReference aUser,
                                     Role aRole)
Returns true if the user has the role specified. The method must return false if the user does not exist.

The following built-in roles are not passed to this method because their meaning does not depend on a specific directory:

  1. Profile.OWNER
  2. Profile.DISTRIBUTOR
  3. Profile.EVERYONE

See Also:
DirectoryHandler.isProfileIncluded(Profile, Profile)

isRoleStrictlyIncluded

public boolean isRoleStrictlyIncluded(Role aRole,
                                      Role anotherRole)
Returns true when aRole is included in anotherRole.

Default implementation of this method returns false. It should be overriden if role inclusion is somehow implemented in the underlying directory.

See Also:
DirectoryHandler.isProfileIncluded(Profile, Profile)

getProfiles

public abstract List getProfiles(ProfileListContext aProfileContext)
Returns the profiles according the context specified.

Postconditions: The profiles to return have some restrictions :


Returns:
a List of profiles

getUserEmail

public String getUserEmail(UserReference aUserReference)
Returns the e-mail address of the user specified, null if it is unknown.

Default implementation of this method returns always null.


displayUser

public String displayUser(UserReference aUserReference,
                          Locale aLocale)
Returns a label for the user specified.

Any implementation of this method must handle the case where the user does not exist any more in the directory (because it has been deleted). In this case it is expected that this method returns a particular label that indicates that the user specified is unknown.

Default implementation of this method displays user id string (it adds the "unknown" word if user is not defined).

See Also:
DirectoryHandler.displayProfile(Profile, Locale)

displayBuiltInRole

public String displayBuiltInRole(Role aBuiltInRole,
                                 Locale aLocale)
Returns a label for the built-in role specified.

Default implementation of this method returns a localized label.

See Also:
DirectoryHandler.displayProfile(Profile, Locale)

displaySpecificRole

public String displaySpecificRole(Role aSpecificRole,
                                  Locale aLocale)
Returns a label for the specific role specified.

Any implementation of this method should handle the case where the role does not exist any more in the directory (because it has been deleted). In this case it is expected that this method returns a particular label that indicates that the role specified is unknown.

Default implementation of this method uses role name.

See Also:
DirectoryHandler.displayProfile(Profile, Locale)


(report a bug)
webMethods MDM 4.2.8 [0558]
Copyright Software AG 2000-2007. All rights reserved.