com.adobe.livecycle.rightsmanagement.client
Interface PolicyManager


public interface PolicyManager

The PolicyManager interface defines a mechanism to register policies with the Rights Management service and to search and modify policies that are already registered. The user account used to invoke LiveCycle ES2 determines which policies can be accessed.

Registered policies reside in the LiveCycle ES2 database. To modify a registered policy, you must first retrieve the policy. For information, see the Modifying a policy using the Java API quick start in Programming with LiveCycle ES4.


Method Summary
 void changePolicyOwner(java.lang.String policyName, User existingOwner, User newOwner)
          Changes the owner of the policy.
 void deleteMyPolicy(java.lang.String policyName, java.lang.String ownerUsername, java.lang.String ownerDomain)
          Deletes the specified policy in My Policies.
 void deletePolicy(java.lang.String policySetName, java.lang.String policyName)
          Deletes the specified policy.
 java.lang.String[] getAllPolicySetNames()
          Returns all policy set names that are available to user as a document publisher.
 Policy getMyPolicy(java.lang.String policyName, java.lang.String OwnerUsername, java.lang.String ownerDomain)
          Retrieves the specified policy in My Policies from the Rights Management database.
 Policy[] getPolicies(PolicySearchFilter filter, int maxResults)
          Returns Policy objects based on the specified search criteria.
 Policy getPolicy(java.lang.String policyId)
          Retrieves the specified policy from the Rights Management database.
 Policy getPolicy(java.lang.String policySetName, java.lang.String policyName)
          Retrieves the specified policy from the Rights Management database.
 Policy getPolicyByAlternateId(java.lang.String alternateId)
          Retrieves the policy that corresponds with the specified alternate identification.
 java.lang.String[] getPolicyNames(java.lang.String policySetName)
          Returns all policy set names that are available to user as a document publisher.
 java.lang.String registerPolicy(Policy policy)
          Registers the specified policy with the Rights Management service as a user policy in My Policies policy set.
 java.lang.String registerPolicy(Policy policy, java.lang.String policySetName)
          Registers the provided policy with the Rights Management service.
 void updatePolicy(Policy updatedPolicy)
          Updates an existing policy with the properties defined in a new policy definition.
 

Method Detail

registerPolicy

java.lang.String registerPolicy(Policy policy)
                                throws SDKException
Registers the specified policy with the Rights Management service as a user policy in My Policies policy set. Policies that the registerPolicy method registers are enabled by default.

Parameters:
policy - A new policy to register with the Rights Management service.
Throws:
SDKException - if any of the following conditions occur:
  • The policy name is already used for an existing policy.
  • The policy is not valid.
  • The operation was not permitted.
  • An error occurred while communicating with the Rights Management service.

registerPolicy

java.lang.String registerPolicy(Policy policy,
                                java.lang.String policySetName)
                                throws SDKException
Registers the provided policy with the Rights Management service. You can register the policy in the specified policy set. If the policySetName parameter is null, then the policy is registered in the My Policies policy set.

To see this method used in a code example, see the Creating a policy using the Java API quick start in Programming with LiveCycle ES4.

Parameters:
policy - A new policy to register with the Rights Management service.
policySetName - The name of the policy set that stores the policy.
Throws:
SDKException - if any of the following conditions occur:
  • The policy name is already used for an existing policy.
  • The policy you provided is not valid.
  • The policySetName is not valid or does not exist.
  • The operation was not permitted.
  • An error occurred while communicating with the Rights Management service.

deletePolicy

void deletePolicy(java.lang.String policySetName,
                  java.lang.String policyName)
                  throws SDKException
Deletes the specified policy. Deleted policies can no longer be used to protect documents; however, they remain active for documents that they currently protect.

To see this method used within a code example, see the Deleting a policy using the Java API quick start in Programming with LiveCycle ES4.

Parameters:
policySetName - The name of the policy set that contains the policy. If this parameter is null, then the My Policies policy set is used.
policyName - The name of the policy to delete.
Throws:
SDKException - If any of the following conditions occur:
  • The policy is already deleted.
  • The policy identification is not valid.
  • The operation was not permitted.
  • An error occurred while communicating with the Rights Management service.
See Also:
Policy

deleteMyPolicy

void deleteMyPolicy(java.lang.String policyName,
                    java.lang.String ownerUsername,
                    java.lang.String ownerDomain)
                    throws SDKException
Deletes the specified policy in My Policies. Deleted policies can no longer be used to protect documents; however, they remain active for documents that they currently protect.

Parameters:
policyName - The name of the policy to delete.
ownerUsername - The login identification of the policy owner of the policy to delete.
ownerDomain - The domain identification of the policy owner of the policy to delete.
Throws:
SDKException - If any of the following conditions occur:
  • The policy is already deleted.
  • The operation was not permitted.
  • An error occurred while communicating with the Rights Management service.
See Also:
Policy

updatePolicy

void updatePolicy(Policy updatedPolicy)
                  throws SDKException
Updates an existing policy with the properties defined in a new policy definition. To update a policy, you must first retrieve the policy from the Rights Management service.

To see this method used within a code example, see the Modifying a policy using the Java API quick start in Programming with LiveCycle ES4.

Parameters:
updatedPolicy - A Policy object that represents the policy to update. The policy was previously retrieved and modified as required.
Throws:
SDKException - if any of the following conditions occur:
  • The policy you provided is not valid.
  • The operation is not permitted.
  • An error occurred while communicating with the Rights Management service.
See Also:
PolicyManager.getPolicy(java.lang.String, java.lang.String), PolicyManager.getPolicies(com.adobe.livecycle.rightsmanagement.client.infomodel.PolicySearchFilter, int)

getPolicy

Policy getPolicy(java.lang.String policySetName,
                 java.lang.String policyName)
                 throws SDKException
Retrieves the specified policy from the Rights Management database.

To see this method used within a code example, see the Modifying a policy using the Java API quick start in Programming with LiveCycle ES4.

Parameters:
policySetName - The name of the policy set that contains the policy. If policySetName is null then the My Policies policy set is used.
policyName - The name of the policy to retrieve.
Returns:
The Policy object that corresponds to the specified policy name and policy set name.
Throws:
SDKException - if any of the following conditions occur:
  • The policy identification is not valid.
  • The policy was not found.
  • The operation was not permitted.
  • An error occurred while communicating with the Rights Management service.

getMyPolicy

Policy getMyPolicy(java.lang.String policyName,
                   java.lang.String OwnerUsername,
                   java.lang.String ownerDomain)
                   throws SDKException
Retrieves the specified policy in My Policies from the Rights Management database.

Parameters:
policyName - The name of the policy to retrieve.
OwnerUsername - The login identification of the policy owner of the policy to retrieve.
ownerDomain - The domain identification of the policy owner of the policy to retrieve.
Returns:
The Policy object that corresponds to the specified policy name, owner user name and owner domain.
Throws:
SDKException - if any of the following conditions occur:
  • The policy was not found.
  • The operation was not permitted.
  • An error occurred while communicating with the Rights Management service.

getPolicy

Policy getPolicy(java.lang.String policyId)
                 throws SDKException
Retrieves the specified policy from the Rights Management database.

Parameters:
policyId - The unique identifier of the policy.
Returns:
The Policy object that corresponds to the specified policy identifier.
Throws:
SDKException - if any of the following conditions occur:
  • The policy identifier is not valid.
  • The policy was not found (or the authenticated user does not have access to it).
  • The operation was not permitted.
  • An error occurred while communicating with the Rights Management service.
  • Because this method is new in LiveCycle 8.2.1, calling it for older server versions will cause an SDKException with error code 1 to be thrown.

getPolicies

Policy[] getPolicies(PolicySearchFilter filter,
                     int maxResults)
                     throws SDKException
Returns Policy objects based on the specified search criteria. You can specify the maximum number of policy objects to return. If USER_POLICY is specified in filter, getPolicies returns all policies for the user who is currently logged in. If no search criteria are specified, all organizational and user policies for the currently logged in user (up to the maximum number of results specified) are returned. That is, if for example, the value 5 is specified, then this method returns up to 5 user and 5 organizational policies.

If the maxResults value is an extremely large number, an exception may occur. Different databases have different limitations. For example, 50000000 is a limitation for the MySQL database.

Parameters:
filter - A PolicySearchFilter object that defines the search criteria.
maxResults - An integer that specifies the maximum number of objects to return.
Returns:
An array of Policy objects that match the search criteria. If there are no policies that match the search criteria, then this method returns only one element which is null.
Throws:
SDKException - if any of the following conditions occur:
  • A parameter you provided is not valid.
  • The operation was not permitted.
  • An error occurred while communicating with the Rights Management service.
See Also:
PolicySearchFilter

getPolicyByAlternateId

Policy getPolicyByAlternateId(java.lang.String alternateId)
                              throws SDKException
Retrieves the policy that corresponds with the specified alternate identification.

Parameters:
alternateId - A string value that holds the alternate identification of a policy. The maximum length of the String you can use is 250 characters or errors can occur.
Returns:
The Policy object that corresponds with the specified alternateId. Returns null if no policy is found.
Throws:
SDKException - if any of the following conditions occur:
  • An alternate identification you provided is not valid.
  • The operation was not permitted.
  • An error occurred while communicating with the Rights Management service.
See Also:
PolicySearchFilter

changePolicyOwner

void changePolicyOwner(java.lang.String policyName,
                       User existingOwner,
                       User newOwner)
                       throws SDKException
Changes the owner of the policy. Only administrators have permission to change policy owners. The user account used to log in must be an administrator account.

Parameters:
policyName - The name of the policy that will have its owner changed.
existingOwner - A User object that has current ownership of the policy.
newOwner - A User object to provide ownership of the policy.
Throws:
SDKException - if any of the following conditions occur:
  • A parameter you provided is not valid.
  • The operation was not permitted.
  • An error occurred while communicating with the Rights Management service.

getAllPolicySetNames

java.lang.String[] getAllPolicySetNames()
                                        throws SDKException
Returns all policy set names that are available to user as a document publisher.

Returns:
The java.lang.String[] that contains all available policy set names. If there are more than 1,000 policy sets, only the first 1,000 will be returned.
Throws:
SDKException - if any of the following conditions occur:
  • An error occurred while communicating with the Rights Management service.

getPolicyNames

java.lang.String[] getPolicyNames(java.lang.String policySetName)
                                  throws SDKException
Returns all policy set names that are available to user as a document publisher.

Parameters:
policySetName - The name of the policy set that will contain policies. "MyPolicies" should be passed if it's end user policies.
Returns:
The java.lang.String[] that contains all available policy set names. If there are more than 1,000 policies, only the first 1,000 will be returned.
Throws:
SDKException - if any of the following conditions occur:
  • The parameter you provided is not a valid policy set name (error code 0x50a - No such id).
  • The parameter policySetName is null or empty string (error code 0x501 - Invalid argument).
  • An error occurred while communicating with the Rights Management service.


[an error occurred while processing this directive] [an error occurred while processing this directive]