Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-03


oracle.irm.engine.core.time
Interface TimeSpanCheck


public interface TimeSpanCheck

Validity checks for absolute and relative time spans. The methods on the time span check interface allow a time span to be compared against the current time. This allows the caller to determine whether the current time falls within a time span, given the license being used and the content being viewed.

Instance

The methods on TimeSpanCheck can be invoked using TimeSpanCheckInstance.


Method Summary
 Date getReferenceDate(TimeSpan span, Date current, Classification classification, License license)
          Obtain the date that the time span should be compare against.
 boolean isAfter(TimeSpan span, Date current, Classification classification, License license)
          Check to see if a time is after the time span ends.
 boolean isBefore(TimeSpan span, Date current, Classification classification, License license)
          Check to see if a time is before the time span starts.
 boolean isWithin(TimeSpan span, Date current, Classification classification, License license)
          Check to see if a time is within the time span.

 

Method Detail

getReferenceDate

Date getReferenceDate(TimeSpan span,
                      Date current,
                      Classification classification,
                      License license)
Obtain the date that the time span should be compare against. The time span can be compared against current time, classification time or license time.
Parameters:
span - the time span to query.
current - the current time.
classification - the classification. This parameter is optional, it is valid to pass null.
license - the license. This parameter is optional, it is valid to pass null.
Returns:
the current, classification or license time depending on what the time span supports. This method will never return null.

isBefore

boolean isBefore(TimeSpan span,
                 Date current,
                 Classification classification,
                 License license)
Check to see if a time is before the time span starts.
Parameters:
span - the time span to check.
current - the current time.
classification - the classification. This parameter is optional, it is valid to pass null.
license - the license. This parameter is optional, it is valid to pass null.
Returns:
whether the time provided is before the time span.

isAfter

boolean isAfter(TimeSpan span,
                Date current,
                Classification classification,
                License license)
Check to see if a time is after the time span ends.
Parameters:
span - the time span to check.
current - the current time.
classification - the classification. This parameter is optional, it is valid to pass null.
license - the license. This parameter is optional, it is valid to pass null.
Returns:
whether the time provided is after the time span.

isWithin

boolean isWithin(TimeSpan span,
                 Date current,
                 Classification classification,
                 License license)
Check to see if a time is within the time span. This is inclusive. A time is within a time span if it is equal to the start or stop times.
Parameters:
span - the time span to check.
current - the current time.
classification - the classification. This parameter is optional, it is valid to pass null.
license - the license. This parameter is optional, it is valid to pass null.
Returns:
whether the time provided is within the time span.

Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-03


Copyright © 2011, Oracle. All rights reserved.