Skip navigation links

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

E12907-01


oracle.irm.engine.core.time
Class TimeSpanCheckInstance

java.lang.Object
  extended by oracle.irm.engine.core.time.TimeSpanCheckInstance


public final class TimeSpanCheckInstance
extends Object

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.

This class provides static methods for a set of procedural style methods. The methods can be made to appear as global methods by using import static. e.g.

import static oracle.irm.engine.core.time.TimeSpanCheckInstance.*;

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

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

getReferenceDate

public static 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

public static 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

public static 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

public static 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-01


Copyright © 2010, Oracle. All rights reserved.