Skip navigation links

Oracle Fusion Middleware Management Java API Reference for Oracle Entitlements Server
11g Release 2 (11.1.2)

E27155-01 ESAPI


oracle.security.jps.service.policystore.info
Class OpssDate

java.lang.Object
  extended by oracle.security.jps.service.policystore.info.DataType
      extended by oracle.security.jps.service.policystore.info.OpssDateTimeObject
          extended by oracle.security.jps.service.policystore.info.OpssDate

All Implemented Interfaces:
ExpressionComponent

public class OpssDate
extends OpssDateTimeObject

The class stands for date data type which supported by OPSS policy store and as defined by http://www.w3.org/2001/XMLSchema#date. The lexical represenation of date is as follows: '-'? yyyy '-' mm '-' dd (zzzzzz), where '-'? yyyy is a four-or-more digit optionally negative-signed numeral that represents the year; if more than four digits, leading zeros are prohibited; '0000' is prohibited; a plus sign is not permitted the remaining '-'s are separators between parts of the date portion; the first mm is a two-digit numeral that represents the month; dd is a two-digit numeral that represents the day; OpssDate manages date in milliseconds if millisPrecision is set to true. Otherwise, it ignores milliseconds when comparing dates etc. Please note that in this case, the behavior of OpssDate.equals() will not be same to Date.equals() because java Date.equals compares millisecond values of two dates. OpssDate is designed more for comparing two dates that are generated using different means (from Calendar or String or milliseconds). zzzzzz (if present) represents the signed time offset from UTC. For more information on how OES supports timezones, see javadoc for OpssDateTimeObject.


Nested Class Summary

 

Nested classes/interfaces inherited from class oracle.security.jps.service.policystore.info.DataType
DataType.TYPE

 

Nested classes/interfaces inherited from interface oracle.security.jps.service.policystore.info.ExpressionComponent
ExpressionComponent.Type

 

Field Summary

 

Fields inherited from class oracle.security.jps.service.policystore.info.OpssDateTimeObject
OES_SPECIFIC_TZ_OFFSET, PDP_TIMEZONE, PEP_TIMEZONE

 

Constructor Summary
OpssDate(java.util.Date val)
          Constructor
OpssDate(java.util.Date val, int tzoffset)
          Creates a date with given offset from UTC.
OpssDate(java.util.Date val, java.lang.String tzname)
          Creates a date with given time zone.

 

Method Summary
static int compare(OpssDate date1, OpssDate date2)
          Compares two OpssDate objects.
 boolean equals(java.lang.Object that)
          Override java method for accurate list and hashtable lookups.
 ExpressionComponent.Type getComponentType()
          Returns type of the component.
 java.util.Date getDate()
          Returns the Date object.
 int getDayOfMonth()
          Returns the day of the month represented by this date.A month is represented by an integer from 0 to 11; 0 is January, 1 is February, and so forth; thus 11 is December.
 int getMonth()
          Returns the month represented by this date.A month is represented by an integer from 0 to 11; 0 is January, 1 is February, and so forth; thus 11 is December.
 java.lang.String getMonthString()
          Returns the month name represented by this date as three letters.
 java.util.Date getTime()
          Returns the time from the Calendar object created with the represeneted Date object.
 DataType.TYPE getType()
          For all concrete subclasses, this method is required so that function evaluators at runtime don't need to keep doing instanceof
 OpssDate getValue()
          Returns an object representing real value of this data type.
 int getYear()
          Returns the year represented by this date.
 int hashCode()
           
 boolean isMillisecPrecision()
          returns true if this object is supposed to maintain milliseconds.
 boolean isValid()
           
 void setMillisecPrecision(boolean bool)
          Indicates whether millisecond privilege must be maintained for this date object.
 java.lang.String toISODateString()
          Return the ISO date string .
 java.lang.String toString()
           
static OpssDate valueOf(java.lang.String str)
           

 

Methods inherited from class oracle.security.jps.service.policystore.info.OpssDateTimeObject
getTimeZoneName, getTimeZonesForOffset, getTimeZoneString, getUTCOffset, isTimeZonePresent, isUTC, nthOccurrence

 

Methods inherited from class oracle.security.jps.service.policystore.info.DataType
getDataTypeObjectFromString, getDataTypeObjectFromString, getTypeClassFromClassName, getTypeFromClass

 

Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

 

Constructor Detail

OpssDate

public OpssDate(java.util.Date val)
Constructor
Parameters:
val -
Throws:
java.lang.IllegalArgumentException - if provided Date is null

OpssDate

public OpssDate(java.util.Date val,
                int tzoffset)
         throws java.lang.IllegalArgumentException
Creates a date with given offset from UTC. The offset is expected to be in positive/ negative number of milliseconds.
Throws:
java.lang.IllegalArgumentException - if provided Date is null

OpssDate

public OpssDate(java.util.Date val,
                java.lang.String tzname)
         throws java.lang.IllegalArgumentException
Creates a date with given time zone.
Throws:
java.lang.IllegalArgumentException - if provided Date is null

Method Detail

setMillisecPrecision

public void setMillisecPrecision(boolean bool)
Indicates whether millisecond privilege must be maintained for this date object. Default is false.

isMillisecPrecision

public boolean isMillisecPrecision()
returns true if this object is supposed to maintain milliseconds.

toString

public java.lang.String toString()
Specified by:
toString in class DataType

toISODateString

public java.lang.String toISODateString()
Return the ISO date string .

getValue

public OpssDate getValue()
Description copied from class: DataType
Returns an object representing real value of this data type. For example, OpssInteger.getValue will return an Integer object.
Specified by:
getValue in class DataType

getType

public final DataType.TYPE getType()
Description copied from class: DataType
For all concrete subclasses, this method is required so that function evaluators at runtime don't need to keep doing instanceof
Specified by:
getType in class DataType
Returns:
Data Type of this object, which is always TYPE.DATE

valueOf

public static OpssDate valueOf(java.lang.String str)
                        throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

compare

public static int compare(OpssDate date1,
                          OpssDate date2)
Compares two OpssDate objects. Returns -1 if date1 is smaller than date2, 0 if the two are equal and 1 if date1 is greater than date2

equals

public boolean equals(java.lang.Object that)
Description copied from class: DataType
Override java method for accurate list and hashtable lookups.
Specified by:
equals in class DataType

getComponentType

public ExpressionComponent.Type getComponentType()
Description copied from interface: ExpressionComponent
Returns type of the component.
Returns:

isValid

public boolean isValid()

getYear

public int getYear()
Returns the year represented by this date.
Returns:
the year represented by this date.

getMonth

public int getMonth()
Returns the month represented by this date.A month is represented by an integer from 0 to 11; 0 is January, 1 is February, and so forth; thus 11 is December.
Returns:
the month represented by this date.

getMonthString

public java.lang.String getMonthString()
Returns the month name represented by this date as three letters. Month January is represented as Jan etc.
Returns:
the month represented by this date as String of first 3 letters.

getDayOfMonth

public int getDayOfMonth()
Returns the day of the month represented by this date.A month is represented by an integer from 0 to 11; 0 is January, 1 is February, and so forth; thus 11 is December.
Returns:
the day of the month represented by this date.

getDate

public java.util.Date getDate()
Returns the Date object.
Returns:
the Date object.

getTime

public java.util.Date getTime()
Returns the time from the Calendar object created with the represeneted Date object.
Returns:
time from the Calendar object.

hashCode

public int hashCode()
Overrides:
hashCode in class OpssDateTimeObject

Skip navigation links

Oracle Fusion Middleware Management Java API Reference for Oracle Entitlements Server
11g Release 2 (11.1.2)

E27155-01 ESAPI


Copyright © 2011,2012, Oracle and/or its affiliates. All rights reserved.