com.softwareag.mdm.service.directory
Class DirectoryDefault

java.lang.Object
  extended bycom.softwareag.mdm.service.directory.Directory
      extended bycom.softwareag.mdm.service.directory.DirectoryDefault

public class DirectoryDefault
extends Directory

Default internal implementation of directory that is delivered with webMethods MDM.

See Also:
DirectoryDefaultFactory

Method Summary
 UserReference authenticateUserFromLoginPassword(String aLogin, String aPassword)
          Authenticates a user by its login and password.
 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.
static String encryptString(String s)
           
static DirectoryDefault getInstance(Repository aRepository)
          Returns the default internal directory instance that is delivered with webMethods MDM.
 List getProfiles(ProfileListContext aProfileContext)
          Returns the profiles according the context specified.
 List getRolesForUser(UserReference userReference)
          Returns the user specific roles.
 String getUserEmail(UserReference ref)
          Returns the e-mail address of the user specified, null if it is unknown.
 boolean isSpecificRoleDefined(Role aRole)
          Returns true if the specific role specified actually exists in this directory.
 boolean isUserDefined(UserReference aUserReference)
          Returns true if the user specified actually exists in this directory.
 boolean isUserInRole(UserReference ref, Role aRole)
          Returns true if the user has the role specified.
 
Methods inherited from class com.softwareag.mdm.service.directory.Directory
authenticateUserFromArray, authenticateUserFromHttpRequest, displayBuiltInRole, isRoleStrictlyIncluded
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DirectoryDefault getInstance(Repository aRepository)
                                    throws Exception
Returns the default internal directory instance that is delivered with webMethods MDM.

Returns null if a specific directory implementation is used.

Parameters:
aRepository - an webMethods MDM repository.
Throws:
Exception

isUserDefined

public boolean isUserDefined(UserReference aUserReference)
Description copied from class: Directory
Returns true if the user specified actually exists in this directory.

Specified by:
isUserDefined in class Directory
See Also:
DirectoryHandler.isProfileDefined(Profile)

isSpecificRoleDefined

public boolean isSpecificRoleDefined(Role aRole)
Description copied from class: Directory
Returns true if the specific role specified actually exists in this directory.

Specified by:
isSpecificRoleDefined in class Directory
See Also:
DirectoryHandler.isProfileDefined(Profile)

authenticateUserFromLoginPassword

public UserReference authenticateUserFromLoginPassword(String aLogin,
                                                       String aPassword)
Description copied from class: Directory
Authenticates a user by its login and password.

Specified by:
authenticateUserFromLoginPassword in class Directory
Returns:
the user reference corresponding to the login/password specified, or null if login does not exist or password is incorrect.

isUserInRole

public boolean isUserInRole(UserReference ref,
                            Role aRole)
Description copied from class: Directory
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

Specified by:
isUserInRole in class Directory
See Also:
DirectoryHandler.isProfileIncluded(Profile, Profile)

getRolesForUser

public List getRolesForUser(UserReference userReference)
Returns the user specific roles.

See Also:
Role

getUserEmail

public String getUserEmail(UserReference ref)
Description copied from class: Directory
Returns the e-mail address of the user specified, null if it is unknown.

Default implementation of this method returns always null.

Overrides:
getUserEmail in class Directory

encryptString

public static String encryptString(String s)

getProfiles

public List getProfiles(ProfileListContext aProfileContext)
Description copied from class: Directory
Returns the profiles according the context specified.

Postconditions: The profiles to return have some restrictions :


Specified by:
getProfiles in class Directory
Returns:
a List of profiles

displaySpecificRole

public String displaySpecificRole(Role aSpecificRole,
                                  Locale aLocale)
Description copied from class: Directory
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.

Overrides:
displaySpecificRole in class Directory
See Also:
DirectoryHandler.displayProfile(Profile, Locale)

displayUser

public String displayUser(UserReference aUserReference,
                          Locale aLocale)
Description copied from class: Directory
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).

Overrides:
displayUser in class Directory
See Also:
DirectoryHandler.displayProfile(Profile, Locale)


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