com.adobe.livecycle.rightsmanagement.client.infomodel
Interface AbstractPolicy

All Superinterfaces:
java.lang.Cloneable

public interface AbstractPolicy
extends java.lang.Cloneable

The AbstractPolicy interface provides methods for creating and manipulating abstract policies. AbstractPolicy contains all the information that a Policy contains but the actual principals are not specified in the AbstracPolicy. These objects are used to create the actual Policy objects. While creating the actual policies from the AbstractPolicy, one needs to specify the actual principals whom one wants to give the permission to. AbstractPolicies must have the following properties defined:

Abstract Policies can also have one or more of the following optional properties defined:

The changes made to AbstractPolicy objects do not affect the actual policies that are generated from the Abstract Policies. To implement new AbstractPolicy objects that you create, you use AbstractPolicyManager to register the abstract policies.

For information about creating new abstract policies using the Document Security Java API, see the Creating a new abstract policy using the Java API quick start in Programming with Adobe Experience Manager Forms.


Field Summary
static java.lang.String ENCRYPTION_TYPE_AES128
          Represents the AES encryption algorithm with a 128-bit key.
static java.lang.String ENCRYPTION_TYPE_AES256
          Represents the AES encryption algorithm with a 256-bit key.
static java.lang.String ENCRYPTION_TYPE_NONE
          Represents no encryption.
static java.lang.String ORGANIZATIONAL_POLICY
          Represents the Organizational policy type.
static java.lang.String USER_POLICY
          The constant that represents the User policy type.
 
Method Summary
 void addAbstractPolicyEntry(AbstractPolicyEntry abstractPolicyEntry)
          Adds an abstract policy entry that defines the set of permissions to the abstract policy.
 void clearAbstractPolicyEntries()
          Removes all abstract policy entries from the abstract policy.
 void clearValidityPeriod()
          Removes the validity period from an abstract policy.
 java.util.List getAbstractPolicyEntries()
          Retrieves the abstract policy entries for the abstract policy.
 java.util.Map getAbstractPolicyProperties()
          Retrieves all the properties defined in the abstract policy.
 java.lang.String getAccessDeniedErrorMessage()
          Retrieves access denied error message defined in the abstract policy.
 java.lang.String getAlternateId()
          Retrieves the alternate identification of the abstract policy.
 java.util.Date getCreationTime()
          Retrieves the date that the abstract policy was first registered with the Rights Management service.
 java.lang.String getDescription()
          Retrieves the description of the abstract policy.
 java.lang.String getEncryptionAlgorithmAndKeySize()
          Retrieves encrpytion algorithm and key size defined in the abstract policy.
 java.lang.String getId()
          Retrieves the identification value of the abstract policy.
 int getInstanceVersion()
          Retrieves the instance version of the abstract policy.
 java.util.Date getLastModifiedTime()
          Retrieves the date that the abstract policy was last modified.
 java.lang.String getName()
          Retrieves the name of the abstract policy.
 int getOfflineLeasePeriod()
          Retrieves the offline lease period.
 User getOwner()
          Retrieves the owner of the policy.
 java.lang.String getPolicySetName()
          Retrieves the name of the policy set that contains this abstract policy.
 java.lang.String getSchemaVersion()
          Retrieves the version of the PDRL schema used to define the abstract policy.
 java.lang.String getType()
          Retrieves the type of the policy.
 ValidityPeriod getValidityPeriod()
          Retrieves the validity period of the abstract policy.
 java.lang.String getWatermarkId()
          Retrieves the identification of the watermark used with this abstract policy.
 boolean isCertificateAuthenticationAllowed()
          Retrieves the boolean which specifies if certificate authentication is allowed for the abstract policy.
 boolean isDeleted()
          Retrieves whether the abstract policy is active or deleted.
 boolean isEncryptAttachmentsOnly()
          Retrieves whether only document attachments should be encrypted or both the document content and the attachment should be encrypted.
 boolean isExtendedUsageTrackingEnabled()
          Retrieves the boolean which specifies if extended usage tracking is allowed for the abstract policy.
 boolean isKerberosAuthenticationAllowed()
          Retrieves the boolean which specifies if kerberos based authentication is allowed for the abstract policy.
 boolean isOverrideAuthenticationSettings()
          Retrieves the authentication settings override flag for the abstract policy.
 boolean isPlaintextMetadata()
          Retrieves whether the metadata of documents that are protected with the policy created from this abstract policy is encrypted.
 boolean isThirdPartyAuthenticationAllowed()
          Retrieves the boolean which specifies if third party authentication is allowed for the abstract policy.
 boolean isTracked()
          Retrieves whether the Rights Management service logs events that involve this abstract policy.
 boolean isUsernamePwdAuthenticationAllowed()
          Retrieves the boolean which specifies if username password authentication is allowed for the abstract policy.
 void removeAbstractPolicyEntry(AbstractPolicyEntry abstractPolicyEntry)
          Removes an abstract policy entry from the abstract policy.
 void setAbstractPolicyProperties(java.util.Map newProps)
          Set the new properties for the abstract policy.
 void setAccessDeniedErrorMessage(java.lang.String accessDeniedErrorMessage)
          Set the new access denied error message for the abstract policy.
 void setAlternateId(java.lang.String alternateId)
          Sets the unique alternate identification for the abstract policy.
 void setCertificateAuthenticationAllowed(boolean certificateAuthenticationAllowed)
          Set the certificate flag for the abstract policy.
 void setDescription(java.lang.String abstractPolicyDescription)
          Sets the description of the abstract policy.
 void setEncryptAttachmentsOnly(boolean encryptAttachmentsOnly)
          Specifies whether only document attachments should be encrypted or both the document content and the attachment should be encrypted.
 void setEncryptionAlgorithmAndKeySize(java.lang.String encrpytionAlgorithm)
          Set the new encrpytion algorithm and key size for the abstract policy.
 void setExtendedUsageTrackingEnabled(boolean extendedUsageTrackingEnabled)
          Set the extended usage tracking flag for the abstract policy.
 void setKerberosAuthenticationAllowed(boolean kerberosAuthenticationAllowed)
          Set the kerberos flag for the abstract policy.
 void setName(java.lang.String name)
          Sets the unique name for the abstract policy.
 void setOfflineLeasePeriod(int days)
          Sets the length of time after which users synchronize with the Rights Management service that documents protected with the policy created from this abstract policy can be opened offline.
 void setOverrideAuthenticationSettings(boolean b)
          Sets the authentication settings override flag for the abstract policy, Setting this to true, will enable all authentication types.
 void setPlaintextMetadata(boolean plaintextMetadata)
          Specifies whether document metadata is encrypted when the document is protected with the policy created from this abstract policy.
 void setPolicySetName(java.lang.String policySetName)
          Sets the name of the policy set that contains this abstract policy.
 void setThirdPartyAuthenticationAllowed(boolean thirdPartyAuthenticationAllowed)
          Set the third party authentication flag for the abstract policy.
 void setTracked(boolean tracked)
          Specifies whether to log events regarding user actions on documents protected with policy created from this abstract policy.
 void setUsernamePwdAuthenticationAllowed(boolean usernamePwdAuthenticationAllowed)
          Set the username password authentication flag for the abstract policy.
 void setValidityPeriod(ValidityPeriod validityPeriod)
          Sets the validity period of the abstract policy.
 void setWatermarkId(java.lang.String id)
          Sets the watermark to use with the abstract policy.
 byte[] toXml()
          Retrieves an XML representation of the abstract policy.
 

Field Detail

USER_POLICY

static final java.lang.String USER_POLICY
The constant that represents the User policy type.

See Also:
Constant Field Values

ORGANIZATIONAL_POLICY

static final java.lang.String ORGANIZATIONAL_POLICY
Represents the Organizational policy type.

See Also:
Constant Field Values

ENCRYPTION_TYPE_AES256

static final java.lang.String ENCRYPTION_TYPE_AES256
Represents the AES encryption algorithm with a 256-bit key.

See Also:
Constant Field Values

ENCRYPTION_TYPE_AES128

static final java.lang.String ENCRYPTION_TYPE_AES128
Represents the AES encryption algorithm with a 128-bit key.

See Also:
Constant Field Values

ENCRYPTION_TYPE_NONE

static final java.lang.String ENCRYPTION_TYPE_NONE
Represents no encryption.

See Also:
Constant Field Values
Method Detail

setName

void setName(java.lang.String name)
             throws PDRLException
Sets the unique name for the abstract policy. To see this method used in a code example, see the Creating a new abstract policy using the Java API quick start in Programming with Adobe Experience Manager Forms.

Parameters:
name - A java.lang.String that holds the name for the abstract policy. The maximum length of the java.lang.String you can use is 50 characters or errors can occur.
Throws:
PDRLException - if the specified name is longer than 50 characters.

getName

java.lang.String getName()
Retrieves the name of the abstract policy.

Returns:
A java.lang.String that holds the name of the abstract policy.

setPolicySetName

void setPolicySetName(java.lang.String policySetName)
                      throws PDRLException
Sets the name of the policy set that contains this abstract policy. To see this method used in a code example, see the Creating a new abstract policy using the Java API quick start in Programming with Adobe Experience Manager Forms.

Parameters:
policySetName - A java.lang.String value that specifies the name of the policy set to used by this abstract policy. The maximum length of the String value is 50 characters or errors occur.
Throws:
PDRLException - If the specified name is longer than 50 characters.

getPolicySetName

java.lang.String getPolicySetName()
Retrieves the name of the policy set that contains this abstract policy.

Returns:
A java.lang.String that holds the name of the policy set that contains this abstract policy.

setDescription

void setDescription(java.lang.String abstractPolicyDescription)
                    throws PDRLException
Sets the description of the abstract policy. You can use the description to describe the intended use of abstract policy.

Parameters:
abstractPolicyDescription - A java.lang.String that holds the description of the abstract policy. The maximum length of the java.lang.String you can use is 250 characters.
Throws:
PDRLException - if the specified description is longer than 250 characters.

getDescription

java.lang.String getDescription()
Retrieves the description of the abstract policy.

Returns:
A java.lang.String that holds the description of the abstract policy and null if no description is set.

getType

java.lang.String getType()
Retrieves the type of the policy.

Returns:
A java.lang.String that holds the abstract policy type. The policy type for an abstract policy can be only ORGANIZATIONAL. AbstractPolicy.ORGANIZATIONAL_POLICY
See Also:
AbstractPolicy.ORGANIZATIONAL_POLICY

getValidityPeriod

ValidityPeriod getValidityPeriod()
Retrieves the validity period of the abstract policy. When an abstract policy is always valid (both the starting date and expiration date are null), this method returns null.

Returns:
A ValidityPeriod object that represents the validity period of the abstract policy.

setValidityPeriod

void setValidityPeriod(ValidityPeriod validityPeriod)
                       throws PDRLException
Sets the validity period of the abstract policy. The validity period defines the period of time during which the abstract policy provides access to the documents it protects. The validity period can define the expiration date, the date when the policy becomes valid, or both. When a policy is not valid, the documents that the policy protects cannot be opened.

The validity period is an optional property. To see this method used in a code example, see the Creating a new abstract policy using the Java API quick start in Programming with Adobe Experience Manager Forms.

Parameters:
validityPeriod - A ValidityPeriod object for the abstract policy and null to specify no validity period.
Throws:
PDRLException - If an error occurred during this operation.

clearValidityPeriod

void clearValidityPeriod()
Removes the validity period from an abstract policy. You can also use the setValidityPeriod(null) method to remove the validity period.


getAbstractPolicyEntries

java.util.List getAbstractPolicyEntries()
Retrieves the abstract policy entries for the abstract policy.

Returns:
A java.util.List object that contains AbstractPolicyEntry objects that represent the abstract policy entries associated with the abstract policy.
See Also:
AbstractPolicyEntry

addAbstractPolicyEntry

void addAbstractPolicyEntry(AbstractPolicyEntry abstractPolicyEntry)
                            throws PDRLException
Adds an abstract policy entry that defines the set of permissions to the abstract policy. To see this method used in a code example, see the Creating a new abstract policy using the Java API quick start in Programming with Adobe Experience Manager Forms.

Parameters:
abstractPolicyEntry - A AbstractPolicyEntry object to add to the policy.
Throws:
PDRLException - If an error occurs during this operation.
See Also:
AbstractPolicyEntry

removeAbstractPolicyEntry

void removeAbstractPolicyEntry(AbstractPolicyEntry abstractPolicyEntry)
                               throws PDRLException
Removes an abstract policy entry from the abstract policy.

Parameters:
abstractPolicyEntry - The AbstractPolicyEntry object that represents the abstract policy entry to remove from the abstract policy.
Throws:
PDRLException - If an error occurs during this operation.
See Also:
AbstractPolicyEntry

clearAbstractPolicyEntries

void clearAbstractPolicyEntries()
Removes all abstract policy entries from the abstract policy.

See Also:
AbstractPolicyEntry

isTracked

boolean isTracked()
Retrieves whether the Rights Management service logs events that involve this abstract policy.

Returns:
true if events are logged and false if events are not logged.
See Also:
AbstractPolicy.setTracked(boolean)

getOfflineLeasePeriod

int getOfflineLeasePeriod()
Retrieves the offline lease period.

Returns:
An integer that holds the length of the offline lease period for the abstract policy, in days. Returns 0 if this policy does not permit access to the document while offline.

getWatermarkId

java.lang.String getWatermarkId()
Retrieves the identification of the watermark used with this abstract policy.

Returns:
A java.lang.String that holds the unique identifier for the watermark and null if no watermark is used.

setTracked

void setTracked(boolean tracked)
Specifies whether to log events regarding user actions on documents protected with policy created from this abstract policy. Examples of user actions are opening documents and printing documents.

Parameters:
tracked - The value true specifies that the user's actions are logged and false means that a user's actions are not logged. The default value is true.

setOfflineLeasePeriod

void setOfflineLeasePeriod(int days)
                           throws PDRLException
Sets the length of time after which users synchronize with the Rights Management service that documents protected with the policy created from this abstract policy can be opened offline. Users can synchronize with the Rights Mangement service by using one of two methods:
  • Open a policy-protected document.
  • Use Acrobat or Adobe Reader to explicitly synchronize.

The abstract policy permissions must be configured to allow offline use of documents. To see this method used in a code example, see the Creating a new abstract policy using the Java API quick start in Programming with Adobe Experience Manager Forms.

Parameters:
days - An integer value for the length of the offline lease (in days). days can be any value greater than zero and less than 10000, and null to use the default offline lease period. The default offline lease period is set using Adobe Experience Manager Forms administrator web pages.
Throws:
PDRLException - If an error occurs during this operation.

setWatermarkId

void setWatermarkId(java.lang.String id)
                    throws PDRLException
Sets the watermark to use with the abstract policy.

Parameters:
id - A java.lang.String that contains the watermark identification or null if no watermark is used.
Throws:
PDRLException - If an error occurs during this operation.
See Also:
Watermark.getId()

isPlaintextMetadata

boolean isPlaintextMetadata()
Retrieves whether the metadata of documents that are protected with the policy created from this abstract policy is encrypted.

Returns:
true if metadata is not encrypted and false if the metadata is encyrpted.
See Also:
AbstractPolicy.setPlaintextMetadata(boolean)

isEncryptAttachmentsOnly

boolean isEncryptAttachmentsOnly()
Retrieves whether only document attachments should be encrypted or both the document content and the attachment should be encrypted.

Returns:
true if only attachments are encrypted and false if both the document content and the attachments are encrypted.
See Also:
AbstractPolicy.setEncryptAttachmentsOnly(boolean)

setPlaintextMetadata

void setPlaintextMetadata(boolean plaintextMetadata)
                          throws PDRLException
Specifies whether document metadata is encrypted when the document is protected with the policy created from this abstract policy. Search engines use document metadata for matching documents with keywords. If the metadata is encrypted, then search engines cannot use it. If the abstract policy contains NoEncryption for the encryption setting, then this method does not perform an action.

setPlaintextMetadata can be set only when an abstract policy is initially registered with the Rights Management service. You cannot change this setting for abstract policies that are already registered.

Parameters:
plaintextMetadata - true if document metadata should not be encrypted and false if metadata should be encrypted. plaintextMetadata is false by default.

plaintextMetadata must be false if the abstract policy is set to encrypt only document attachments.

Throws:
PDRLException - if plaintextMetadata is true and the abstract policy is set to encrypt only document attachments.
See Also:
setEncryptAttachmentsOnly

setEncryptAttachmentsOnly

void setEncryptAttachmentsOnly(boolean encryptAttachmentsOnly)
                               throws PDRLException
Specifies whether only document attachments should be encrypted or both the document content and the attachment should be encrypted. If only the attachment is encrypted, then the abstract policy protects only document attachments, not the document. By default, both the document and the attachments are encrypted. If the abstract policy contains NoEncryption for the encryption setting, then this method does not perform an action.

setEncryptedAttachmentsOnly can be set only when an abstract policy is initially registered with the Rights Mangement service. You cannot change this setting for policies that are already registered.

Parameters:
encryptAttachmentsOnly - true to specify that only the attachment should be encrypted and false if both the document and the attachment should be encrypted. The default value is false.

If encryptAttachmentsOnly is true, then the abstract policy must be set to encrypt document metadata.

Throws:
PDRLException - if encryptAttachmentsOnly is true and the abstract policy is not set to encrypt document metadata.

getCreationTime

java.util.Date getCreationTime()
Retrieves the date that the abstract policy was first registered with the Rights Management service. The date is set according to the date on the server.

Returns:
A java.util.Date object that contains the date the abstract policy was created.

getLastModifiedTime

java.util.Date getLastModifiedTime()
Retrieves the date that the abstract policy was last modified. The date is set according to the date on the server.

Returns:
A java.util.Date object that contains the date the abstract policy was last modified.

getId

java.lang.String getId()
Retrieves the identification value of the abstract policy.

Returns:
A java.lang.String that specifies the identification value of the abstract policy and null if this abstract policy object represents an abstract policy not yet registered with the Rights Management service.

getSchemaVersion

java.lang.String getSchemaVersion()
Retrieves the version of the PDRL schema used to define the abstract policy.

Returns:
A java.lang.String that holds the version of the PDRL schema.

toXml

byte[] toXml()
             throws PDRLException
Retrieves an XML representation of the abstract policy. The structure of the XML is defined by the PDRL schema.

Returns:
An array of bytes that contains an XML document that represents the abstract policy.
Throws:
PDRLException
See Also:
policy

getInstanceVersion

int getInstanceVersion()
Retrieves the instance version of the abstract policy. The instance version tracks the number of times a registered abstract policy is modified. The instance version is set to 1 when an abstract policy is first registered with the Rights Management service. The instance version increments by 1 each time the abstract policy is modified.

Returns:
An integer that holds the instance version of the abstract policy.

isDeleted

boolean isDeleted()
Retrieves whether the abstract policy is active or deleted. Active abstract policies can be used to create policies. Deleted abstract policies can no longer be used to create policies.

Returns:
true if the abstract policy is deleted and false if the abstract policy is active.
See Also:
deleteAbstractPolicy

getAlternateId

java.lang.String getAlternateId()
Retrieves the alternate identification of the abstract policy.

Returns:
A java.lang.String that holds the alternate identification of the abstract policy and null if no alternate identification was set.
See Also:
AbstractPolicy.setAlternateId(String)

setAlternateId

void setAlternateId(java.lang.String alternateId)
                    throws PDRLException
Sets the unique alternate identification for the abstract policy. The alternate identification is useful if you want to cross-reference abstract policies by using the identification scheme of an integrated third-party application.

Parameters:
alternateId - A java.lang.String that holds the alternate identification of the abstract policy. The maximum length of the java.lang.String you can use is 255 characters.

No two policies can use the same alternate identification.

Throws:
PDRLException - if alternateId is longer than 255 characters.

getOwner

User getOwner()
Retrieves the owner of the policy. The owner of the policy is the user who registered the policy with the Rights Management service.

Returns:
null if a policy is contained in a policy set, and returns a valid User object if the policy is contained in My Policies.
See Also:
PolicyManager

getAbstractPolicyProperties

java.util.Map getAbstractPolicyProperties()
Retrieves all the properties defined in the abstract policy. The properties are returned in a map as a set of name/value pairs. The values will be either single String or arrays of Strings if the property was multi-valued.

Returns:
A java.util.Map of name/value pairs.

setAbstractPolicyProperties

void setAbstractPolicyProperties(java.util.Map newProps)
Set the new properties for the abstract policy.

Parameters:
newProps - Each value in the java.util.Map must be either a string or an array of strings.

getEncryptionAlgorithmAndKeySize

java.lang.String getEncryptionAlgorithmAndKeySize()
Retrieves encrpytion algorithm and key size defined in the abstract policy.

Returns:
A java.lang.String.

setEncryptionAlgorithmAndKeySize

void setEncryptionAlgorithmAndKeySize(java.lang.String encrpytionAlgorithm)
                                      throws PDRLException
Set the new encrpytion algorithm and key size for the abstract policy.

Parameters:
encrpytionAlgorithm - A string contains the new encrpytion algorithm and key size.
Throws:
PDRLException

getAccessDeniedErrorMessage

java.lang.String getAccessDeniedErrorMessage()
Retrieves access denied error message defined in the abstract policy.

Returns:
A java.lang.String.

setAccessDeniedErrorMessage

void setAccessDeniedErrorMessage(java.lang.String accessDeniedErrorMessage)
Set the new access denied error message for the abstract policy.

Parameters:
accessDeniedErrorMessage - A string contains the new access denied error message.

setOverrideAuthenticationSettings

void setOverrideAuthenticationSettings(boolean b)
Sets the authentication settings override flag for the abstract policy, Setting this to true, will enable all authentication types. User needs to explicitly disable unwanted authentication types by using the respective setters.

Parameters:
b - boolean which specifies if we want to override the authentication settings in the policy

isOverrideAuthenticationSettings

boolean isOverrideAuthenticationSettings()
Retrieves the authentication settings override flag for the abstract policy.

Returns:
A boolean.

isThirdPartyAuthenticationAllowed

boolean isThirdPartyAuthenticationAllowed()
Retrieves the boolean which specifies if third party authentication is allowed for the abstract policy.

Returns:
A boolean.

setThirdPartyAuthenticationAllowed

void setThirdPartyAuthenticationAllowed(boolean thirdPartyAuthenticationAllowed)
Set the third party authentication flag for the abstract policy.

Parameters:
thirdPartyAuthenticationAllowed - boolean which specifies if we want to allow third party authentication for the abstract policy

isKerberosAuthenticationAllowed

boolean isKerberosAuthenticationAllowed()
Retrieves the boolean which specifies if kerberos based authentication is allowed for the abstract policy.

Returns:
A boolean.

setKerberosAuthenticationAllowed

void setKerberosAuthenticationAllowed(boolean kerberosAuthenticationAllowed)
Set the kerberos flag for the abstract policy.

Parameters:
kerberosAuthenticationAllowed - boolean which specifies if we want to allow kerberos based authentication for the abstract policy

isCertificateAuthenticationAllowed

boolean isCertificateAuthenticationAllowed()
Retrieves the boolean which specifies if certificate authentication is allowed for the abstract policy.

Returns:
A boolean.

setCertificateAuthenticationAllowed

void setCertificateAuthenticationAllowed(boolean certificateAuthenticationAllowed)
Set the certificate flag for the abstract policy.

Parameters:
certificateAuthenticationAllowed - boolean which specifies if we want to allow certificate authentication for the abstract policy

isUsernamePwdAuthenticationAllowed

boolean isUsernamePwdAuthenticationAllowed()
Retrieves the boolean which specifies if username password authentication is allowed for the abstract policy.

Returns:
A boolean.

setUsernamePwdAuthenticationAllowed

void setUsernamePwdAuthenticationAllowed(boolean usernamePwdAuthenticationAllowed)
Set the username password authentication flag for the abstract policy.

Parameters:
usernamePwdAuthenticationAllowed - boolean which specifies if we want to allow username password authentication for the abstract policy

isExtendedUsageTrackingEnabled

boolean isExtendedUsageTrackingEnabled()
Retrieves the boolean which specifies if extended usage tracking is allowed for the abstract policy.

Returns:
A boolean.

setExtendedUsageTrackingEnabled

void setExtendedUsageTrackingEnabled(boolean extendedUsageTrackingEnabled)
Set the extended usage tracking flag for the abstract policy.

Parameters:
extendedUsageTrackingEnabled - boolean which specifies if we want to allow extended usage tracking for the abstract policy