com.softwareag.mdm.service
Class Profile

java.lang.Object
  extended bycom.softwareag.mdm.service.Profile
Direct Known Subclasses:
Role, UserReference

public abstract class Profile
extends Object

Identifies a user profile for permissions management. Profiles are of three types:

The relationship between each user and the roles he has is defined by the method DirectoryHandler.isProfileIncluded(Profile, Profile).

See Also:
Session

Field Summary
static Role ADMINISTRATOR
          Built-in Administrator role.
static Role DISTRIBUTOR
          Dynamic built-in Distributor role.
static Role EVERYONE
          Built-in role, all users have this role.
static Role OWNER
          Dynamic built-in owner role.
static Role PROVIDER
          Built-in Provider role.
static Role READ_ONLY
          Built-in read-only role.
 
Method Summary
 boolean equals(Object anObject)
           
static Role forBuiltInRole(String roleName)
          Returns the built-in role identified by the name specified.
 String format()
          Serializes a profile reference to a String.
static Role forSpecificRole(String roleName)
          Returns the specific role identified by the name specified.
static UserReference forUser(String userId)
          Returns the user reference specified.
static UserReference forUserWithSpecificPrivilege(String userId, ServiceKey servicePrivilegeGranted)
          Returns the user reference specified, with the specific privilege granted.
static UserReference forUserWithSpecificPrivileges(String userId, Set servicePrivileges)
          Returns the user reference specified, with the specific privileges granted.
 String getLabel()
          Returns a label of this profile.
 int hashCode()
           
 boolean isBuiltIn()
          Returns true if this profile is a built-in role.
 boolean isBuiltInAdministrator()
           
 boolean isBuiltInDistributor()
           
 boolean isBuiltInEveryone()
           
 boolean isBuiltInOwner()
           
 boolean isBuiltInProvider()
           
 boolean isBuiltInReadOnly()
           
 boolean isSpecificRole()
          Returns true if this profile is a specific role.
 boolean isUserReference()
          Returns true if this profile references a user.
static Profile parse(String aString)
          Analyses a string that has been created via format() and returns the corresponding profile.
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ADMINISTRATOR

public static final Role ADMINISTRATOR
Built-in Administrator role. Administrator role allows to perform general administration tasks.


PROVIDER

public static final Role PROVIDER
Built-in Provider role. Provider role allows to create new root adaptations.


READ_ONLY

public static final Role READ_ONLY
Built-in read-only role.

A user with role read-only has generally no rights for doing any modifications on webMethods MDM repository (unless a procedure has explicitly deactivated access rights controls, see ProcedureContext.setAllPrivileges(boolean)).


OWNER

public static final Role OWNER
Dynamic built-in owner role. A user is in Owner role when he is on an adaptation A and when he is in the "owner" profile defined by the root adaptation of A. Additionnally A must not be under an agreement (see DISTRIBUTOR role).


DISTRIBUTOR

public static final Role DISTRIBUTOR
Dynamic built-in Distributor role. A user is in Distributor role when he is on an adaptation under an agreement and when he is in the "distributor" profile defined by the agreement.


EVERYONE

public static final Role EVERYONE
Built-in role, all users have this role.

Method Detail

forBuiltInRole

public static Role forBuiltInRole(String roleName)
                           throws IllegalArgumentException
Returns the built-in role identified by the name specified.

Parameters:
roleName - unique and persistent identifier of the specific role in the directory
Throws:
IllegalArgumentException - if the name specified does not correspond to a built-in role

forSpecificRole

public static Role forSpecificRole(String roleName)
                            throws IllegalArgumentException
Returns the specific role identified by the name specified.

Parameters:
roleName - unique and persistent identifier of the specific role in the directory
Throws:
IllegalArgumentException

forUser

public static UserReference forUser(String userId)
Returns the user reference specified. Note: the call to this method does not imply that it returns a user that is actually defined in the current directory. The actual existence of a user is indeed checked by the method Directory.isUserDefined(UserReference).

Parameters:
userId - a unique identifier of a user (usually its login)

forUserWithSpecificPrivilege

public static UserReference forUserWithSpecificPrivilege(String userId,
                                                         ServiceKey servicePrivilegeGranted)
Returns the user reference specified, with the specific privilege granted.

Parameters:
userId - a unique identifier of a user (usually its login)
servicePrivilegeGranted - grants the user the privilege of executing the service specified

forUserWithSpecificPrivileges

public static UserReference forUserWithSpecificPrivileges(String userId,
                                                          Set servicePrivileges)
Returns the user reference specified, with the specific privileges granted.

Parameters:
userId - a unique identifier of a user (usually its login)
servicePrivileges - set of ServiceKey, grants the user the privilege of executing the services specified

parse

public static Profile parse(String aString)
                     throws IllegalArgumentException
Analyses a string that has been created via format() and returns the corresponding profile.

Throws:
IllegalArgumentException - If aString is invalid.
See Also:
format()

equals

public boolean equals(Object anObject)

hashCode

public int hashCode()

isBuiltIn

public boolean isBuiltIn()
Returns true if this profile is a built-in role.

See Also:
Role

isBuiltInAdministrator

public boolean isBuiltInAdministrator()
See Also:
ADMINISTRATOR

isBuiltInProvider

public boolean isBuiltInProvider()
See Also:
PROVIDER

isBuiltInReadOnly

public boolean isBuiltInReadOnly()
See Also:
READ_ONLY

isBuiltInDistributor

public boolean isBuiltInDistributor()
See Also:
DISTRIBUTOR

isBuiltInEveryone

public boolean isBuiltInEveryone()
See Also:
EVERYONE

isBuiltInOwner

public boolean isBuiltInOwner()
See Also:
OWNER

isSpecificRole

public boolean isSpecificRole()
Returns true if this profile is a specific role.

See Also:
Role

getLabel

public String getLabel()
Returns a label of this profile. Hence the string returned shall not be considered as an identifier (for an identifier the method format() shall be used).


isUserReference

public boolean isUserReference()
Returns true if this profile references a user.

See Also:
UserReference

toString

public String toString()

format

public String format()
Serializes a profile reference to a String.

The string returned by this method can be persisted and it shall be used as argument of the method parse(String) in order to recreate a profile reference.

See Also:
parse(String)


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