org.apache.directory.server.kerberos.shared.messages.value
Class KerberosTime

java.lang.Object
  extended by org.apache.directory.server.kerberos.shared.messages.value.KerberosTime
All Implemented Interfaces:
java.lang.Comparable<KerberosTime>

public class KerberosTime
extends java.lang.Object
implements java.lang.Comparable<KerberosTime>

Implementation of the time object for Kerberos.

Version:
$Rev: 557427 $, $Date: 2007-07-19 01:47:31 +0200 (Do, 19 Jul 2007) $
Author:
Apache Directory Project

Field Summary
static int DAY
          The number of milliseconds in a day.
static KerberosTime INFINITY
          Constant for the KerberosTime "infinity."
static int MINUTE
          The number of milliseconds in a minute.
static int WEEK
          The number of milliseconds in a week.
 
Constructor Summary
KerberosTime()
          Creates a new instance of KerberosTime.
KerberosTime(java.util.Date time)
          Creates a new instance of KerberosTime.
KerberosTime(long time)
          Creates a new instance of KerberosTime.
 
Method Summary
 int compareTo(KerberosTime that)
           
 boolean equals(KerberosTime time)
          Returns whether this KerberosTime is equal to another KerberosTime.
 long getTime()
          Returns the KerberosTime as a long.
static KerberosTime getTime(java.lang.String zuluTime)
          Returns the KerberosTime for a given zulu time.
 boolean greaterThan(KerberosTime time)
          Returns whether this KerberosTime is greater than a given KerberosTime.
 boolean isInClockSkew(long clockSkew)
          Returns whether this KerberosTime is within the given clockskew.
 boolean isZero()
          Returns whether this KerberosTime is zero.
 boolean lessThan(KerberosTime time)
          Returns whether this KerberosTime is less than a given KerberosTime.
 java.util.Date toDate()
          Returns the KerberosTime as a Date.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MINUTE

public static final int MINUTE
The number of milliseconds in a minute.

See Also:
Constant Field Values

DAY

public static final int DAY
The number of milliseconds in a day.

See Also:
Constant Field Values

WEEK

public static final int WEEK
The number of milliseconds in a week.

See Also:
Constant Field Values

INFINITY

public static final KerberosTime INFINITY
Constant for the KerberosTime "infinity."

Constructor Detail

KerberosTime

public KerberosTime()
Creates a new instance of KerberosTime.


KerberosTime

public KerberosTime(long time)
Creates a new instance of KerberosTime.

Parameters:
time -

KerberosTime

public KerberosTime(java.util.Date time)
Creates a new instance of KerberosTime.

Parameters:
time -
Method Detail

getTime

public static KerberosTime getTime(java.lang.String zuluTime)
                            throws java.text.ParseException
Returns the KerberosTime for a given zulu time.

Parameters:
zuluTime -
Returns:
The KerberosTime.
Throws:
java.text.ParseException

compareTo

public int compareTo(KerberosTime that)
Specified by:
compareTo in interface java.lang.Comparable<KerberosTime>

getTime

public long getTime()
Returns the KerberosTime as a long.

Returns:
The KerberosTime as a long.

toDate

public java.util.Date toDate()
Returns the KerberosTime as a Date.

Returns:
The KerberosTime as a Date.

isInClockSkew

public boolean isInClockSkew(long clockSkew)
Returns whether this KerberosTime is within the given clockskew.

Parameters:
clockSkew -
Returns:
true if this KerberosTime is within the given clockskew.

greaterThan

public boolean greaterThan(KerberosTime time)
Returns whether this KerberosTime is greater than a given KerberosTime.

Parameters:
time -
Returns:
true if this KerberosTime is greater than a given KerberosTime.

lessThan

public boolean lessThan(KerberosTime time)
Returns whether this KerberosTime is less than a given KerberosTime.

Parameters:
time -
Returns:
true if this KerberosTime is less than a given KerberosTime.

equals

public boolean equals(KerberosTime time)
Returns whether this KerberosTime is equal to another KerberosTime.

Parameters:
time -
Returns:
true if the two KerberosTimes are equal.

isZero

public boolean isZero()
Returns whether this KerberosTime is zero.

Returns:
true if this KerberosTime is zero.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.