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


public interface ValidityPeriod

The ValidityPeriod interface provides methods for defining a period of time that a policy provides principals with access to the documents that it protects. You can specify the time when the validity period begins, ends, or both.

The validiy period can be expressed using either absolute time values or time values relative to the time that the associated policy is registered.

After you create a ValidyPeriod object, you can use it to define the validity period of one or more PolicyEntry objects. For information about using this interface as part of creating new policies using the Rights Management Java API, see the Creating a new policy using the Java API quick start in Programming with LiveCycle ES4.


Method Summary
 void clear()
          Removes all settings for the validity period.
 java.util.Date getAbsoluteNotAfterDate()
          Retrieves the date when the validity period ends.
 java.util.Date getAbsoluteNotBeforeDate()
          Retrieves the date when the validity period begins.
 int getRelativeExpirationDays()
          Returns the length of the relative validity period.
 boolean isAbsolute()
          Returns whether the validity period is relative or absolute.
 void setAbsoluteValidityPeriod(java.util.Date notBeforeDate, java.util.Date notAfterDate)
          Sets the validity period using absolute dates.
 void setRelativeExpirationDays(int days)
          Sets the length of the validity period for policy entries, relative to the time that the associated policies were registered with the Rights Management service.
 

Method Detail

setRelativeExpirationDays

void setRelativeExpirationDays(int days)
                               throws PDRLException
Sets the length of the validity period for policy entries, relative to the time that the associated policies were registered with the Rights Management service. You can also set the validity period using absolute dates with the #setAbsoluteValidityPeriod() method.

If you set the validity period multiple times using either method, the period most recently set takes precedence.

Parameters:
days - An integer that specifies the number of days that policy entries are valid after the time that the associated policies were registered with the Rights Management service. The value days must be a value between zero and 10000.
Throws:
PDRLException - if the specified number of days is not within the valid range.

setAbsoluteValidityPeriod

void setAbsoluteValidityPeriod(java.util.Date notBeforeDate,
                               java.util.Date notAfterDate)
                               throws PDRLException
Sets the validity period using absolute dates. You can specify the beginning date of the validiy period or the ending date of the validity period, or both. You must specify at least one of the dates:

You can also set the validity period using relative dates with #setRelativeExpirationDays().

If you set the validity period multiple times using either method, the period most recently set takes precedence.

Parameters:
notBeforeDate - A java.util.Date object that defines the beginning of the validity period and null if the associated policy entry is valid from the time the associated policy is registered with the Rights Management Service.
notAfterDate - A java.util.Date object that defines the ending of the validity period and null if the validity period does not end.
Throws:
PDRLException - if any of the following conditions are true:
  • notBeforeDate and notAfterDate are null.
  • notBeforeDate is later than notAfterDate.
  • notBeforeDate is earlier than January 1, 1970 00:00:00 GMT.

isAbsolute

boolean isAbsolute()
Returns whether the validity period is relative or absolute.

Returns:
A Boolean value of true if the validity period is absolute and false if the validity period is relative to the registration date of the associated policies.

getRelativeExpirationDays

int getRelativeExpirationDays()
Returns the length of the relative validity period.

Returns:
An integer that contains the length of the validity period, in days, or -1 if no relative period is set.

getAbsoluteNotBeforeDate

java.util.Date getAbsoluteNotBeforeDate()
Retrieves the date when the validity period begins.

Returns:
A java.util.Date object that contains the date after which the associated policy entries are valid and null if no absolute date is set for the beginning of the validity period.

getAbsoluteNotAfterDate

java.util.Date getAbsoluteNotAfterDate()
Retrieves the date when the validity period ends.

Returns:
A java.util.Date object that contains the date before which the associated policy entries are valid and null if no absolute date has been specified for the end of the validity period.

clear

void clear()
Removes all settings for the validity period.



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