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 TimeOperations


public interface TimeOperations

Operations for manipulating and creating time based objects.

Instance

The methods on TimeOperations can be invoked using TimeOperationsInstance.


Method Summary
 Date getCurrentTime()
          The current time.
 TimeRange getTimeRangeByInterval(Date date, TimeRange.Direction direction, TimeRange.Interval interval, int size)
          Create a time range using a time interval.
 boolean isTimeWindowOverlapping(TimeWindow window, Collection<TimeWindow> windows)
          Check whether a time window overlaps other time windows.
 Collection<TimePeriod> sortTimePeriods(Collection<TimePeriod> periods)
          Sort a set of time periods in ascending order.

 

Method Detail

getCurrentTime

Date getCurrentTime()
The current time. The current time can be used when checking time based license criteria. As license time constraints have a maximum precision of a second the time returned by this method will round down the time to the nearest second.

State

The date returned by this method can be safely altered without affecting the internal state of the object.
Returns:
the value of the property. This method will never return null.

isTimeWindowOverlapping

boolean isTimeWindowOverlapping(TimeWindow window,
                                Collection<TimeWindow> windows)
Check whether a time window overlaps other time windows.
Parameters:
window - the time window to check.
windows - the time windows to compare against. This parameter is optional, it is valid to pass null or an empty collection.
Returns:
whether the first time window overlaps any of the other time windows.

getTimeRangeByInterval

TimeRange getTimeRangeByInterval(Date date,
                                 TimeRange.Direction direction,
                                 TimeRange.Interval interval,
                                 int size)
Create a time range using a time interval. The time range is calculate from the reference date using the interval provided. The direction specifies whether the interval is forwards or backwards in time. e.g. create a time range from the reference date 15 August 2008 20:00, forward in time two hours. This would result in a time range with a begin time of 15 August 2008 20:00 and an end time of 15 August 2008 22:00.
Parameters:
date - reference date.
direction - time direction.
interval - interval.
size - interval size.
Returns:
the time range. This method will never return null.

sortTimePeriods

Collection<TimePeriod> sortTimePeriods(Collection<TimePeriod> periods)
Sort a set of time periods in ascending order. Sorts a set of time periods in time ascending order. The time periods are sorted using the toSeconds method.
Parameters:
periods - time periods to sort. This parameter is optional, it is valid to pass null or an empty collection.
Returns:
the sorted time periods. If applicable, this method will return an empty collection rather than null to indicate no results.

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.