Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.fujitsu.iflow.model.workflow
Interface DirectoryServices

public interface DirectoryServices

This interface allows you to perform actions using your system's Directory Services.

Users and roles are important parts of the Interstage BPM system. The users of Interstage BPM are defined in your system's Directory Services, so you do not need to define separate users for the Interstage BPM system.

Users and roles are necessary parts of a process definition and are used during process execution. A process definition includes a list of nodes to be executed automatically or by a user. Those that are executed by a user must assigned to a group (role) of users (or a single user if you use a Role JavaAction). When a new process instance is generated for a process definition, each user of the assigned role gets a work item for the activity (node).

This means: Roles determine which users will be assigned to an activity during the development of a process definition.

Assigning activities to roles instead of users increases the life of process definitions because they are not dependent on the individuals within the organization. No additional process definition design or maintenance is required when one person is replaced by another - so long as they both belong to the same role.

The organization's Directory Services handles role resolution. The Directory Services adapter you have installed will determine the role resolution behaviour.

During the execution of a process instance, role resolution does not occur in activities until the node becomes active. Role resolution is dynamic like this so that Interstage BPM can immediately adapt to changes in the organization.

The standard way of constructing a new `DirectoryServices` object is to call the method `WFObjectFactory.getDirectoryServices`.

Exceptions. Three kinds of exceptions are commonly thrown within this class: `DirException`, `WFInternalException`, and `ModelInternalException`, all of these exceptions are instances of `ModelException`. In the methods that directly throw a `ModelException`, this exception usually wraps one of the former three exceptions. `DirException` indicates that the directory service failed to operate normally. `WFInternalException` indicates a problem in the communication between client and server. As its name suggests, `ModelInternalException` denotes other problems that are internal to the Model API.

See Also:
  `WFObjectFactory`, `com.fujitsu.iflow.common.xml.parser.Node`, `Plan`, `ProcessInstance`

Field Summary
`static int` | `MAX_DIR_NAME_LENGTH` Specifies the maximum length of the directory name; currently 64 characters.

Method Summary
`void` | `createUserPropList(java.lang.String user, ProfileProp[] attrList)` Creates a user profile for a specific user given an array of `ProfileProp` objects.
`void` | `deleteUserPropList(java.lang.String user)` Deletes the user's profile corresponding to the user's name.
`ProfileProp[]` | `getUserAllPropList(java.lang.String user)` Returns a complete user profile for the specified user in the current Directory Services.
`java.lang.String[]` | `getUserGroups()` Returns a list of available roles that are currently defined in the Directory Services.
`java.lang.String[]` | `getUserList(java.lang.String userGroup)` Returns a list of all the members of the specified group (role) that are defined in the Directory Services.
`boolean` | `updateUserPropList(java.lang.String user, ProfileProp[] userProfile)` Updates the user profile property values for the specified user with the specified user profile.

Field Detail

### MAX_DIR_NAME_LENGTH

    public static final int MAX_DIR_NAME_LENGTH

  Specifies the maximum length of the directory name; currently 64 characters.

  See Also:
    Constant Field Values

Method Detail

### getUserGroups

    public java.lang.String[] getUserGroups()
                                     throws DirException,
                                            ModelInternalException

  Returns a list of available roles that are currently defined in the Directory Services.

  Returns:
    An array of user roles maintained in the Directory Services.
  Throws:
    `DirException`
    `ModelInternalException.`
    `ModelInternalException`

### getUserList

    public java.lang.String[] getUserList(java.lang.String userGroup)
                                   throws DirException,
                                          ModelInternalException

  Returns a list of all the members of the specified group (role) that are defined in the Directory Services. If there are no members in the supplied user group, an empty array is returned.

  Parameters:
    `userGroup` - The group's name
  Returns:
    An array of member names that are in the specified role.
  Throws:
    `DirException`
    `ModelInternalException` - Thrown when the user's name is `null`, empty, or invalid. Should be caught as `ModelException` for future compatibility.

### getUserAllPropList

    public ProfileProp[] getUserAllPropList(java.lang.String user)
                                     throws DirException,
                                            ModelInternalException

  Returns a complete user profile for the specified user in the current Directory Services.

  The user profile consists of the following data attribute objects:

  1. User (uid)
  2. iflownotification
  3. email
  4. default home directory (dmsdir)

  These are the properties that are already defined by Interstage BPM. Additional properties can be set through the use of the `ProfileProp` interface.

  Parameters:
    `user` - User's name for which the user profile will be retrieved.
  Returns:
    An array of `ProfileProp` objects representing the users profile. The value of the elements of the array is `null` if there is no value for the referenced attribute.
  Throws:
    `DirException`
    `ModelInternalException` - Thrown when the user's name is `null`, empty, or invalid. Should be caught as `ModelException` for future compatibility.

### updateUserPropList

    public boolean updateUserPropList(java.lang.String user,
                                      ProfileProp[] userProfile)
                               throws DirException,
                                      ModelInternalException

  Updates the user profile property values for the specified user with the specified user profile.

  The length of user must not be longer than specified by `MAX_DIR_NAME_LENGTH` and must not contain the character '`,`'.

  Parameters:
    `user` - The user's name.
    `userProfile` - the array of `ProfileProp` objects to be used to update the user's profile.
  Returns:
    `true` if the update was successful; `false` otherwise.
  Throws:
    `DirException`
    `ModelInternalException` - When attribute user or userProfile is `null`, empty, or invalid. Should be caught as `ModelException` for future compatibility.
  See Also:
    `getUserAllPropList(java.lang.String)`

### createUserPropList

    public void createUserPropList(java.lang.String user,
                                   ProfileProp[] attrList)
                            throws DirException

  Creates a user profile for a specific user given an array of `ProfileProp` objects. Each of these contains the name and value of the attribute that characterizes the user account.

  The length of user must not be longer than specified by `MAX_DIR_NAME_LENGTH` and must not contain the character '`,`'.

  Parameters:
    `user` - The user's name.
    `attrList` - An array of attributes and their values to be associated with the user.
  Throws:
    `DirException` - Thrown when the user's name or `attrList` is invalid, empty, or `null`. If attributes are valid but the creation fails. Should be caught as `ModelException` for future compatibility.

### deleteUserPropList

    public void deleteUserPropList(java.lang.String user)
                            throws WFInternalException,
                                   DirException

  Deletes the user's profile corresponding to the user's name.

  Parameters:
    `user` - The user's name.
  Throws:
    `DirException`
    `WFInternalException` - Thrown when the user's name is invalid or `null`. Should be caught as `ModelException` for future compatibility.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD