To programmatically manage users, groups, and domains using
the (Java), perform the following tasks:
Include project files.
Include client JAR files,
such as adobe-usermanager-client.jar, in your Java project’s class
path. For information about the location of these files, see Including LiveCycle Java library files.
Create a DirectoryManagerService client.
Create a DirectoryManagerServiceClient object
by using its constructor and passing a ServiceClientFactory object
that contains connection properties. For information, see Setting connection properties.
Invoke the appropriate user or group operations.
To
find a user or group, invoke one of the DirectoryManagerServiceClient object’s
methods for finding principals (since a principal can be a user
or a group). In the example below, the findPrincipals method
is called using a search filter (a PrincipalSearchFilter object).
Since
the return value in this case is a java.util.List containing Principal objects,
iterate through the result and cast the Principal objects
to either User or Group objects.
Using
the resultant User or Group object
(which both inherit from the Principal interface),
retrieve the information you need in your workflows. For example,
the domain name and canonical name values, in combination, uniquely
identify a principal. These are retrieved by invoking the Principal object’s getDomainName and getCanonicalName methods,
respectively.
To delete a local user, invoke the DirectoryManagerServiceClient object’s deleteLocalUser method
and pass the user’s identifier.
To delete a local group, invoke
the DirectoryManagerServiceClient object’s deleteLocalGroup method
and pass the group’s identifier.
|
|
|