public class KerberosTime extends java.lang.Object implements java.lang.Comparable<KerberosTime>, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
date
The KerberosTime as a String
|
static int |
DAY
The number of milliseconds in a day.
|
static KerberosTime |
INFINITY
Constant for the
KerberosTime "infinity." |
private long |
kerberosTime
The kerberosTime, as a long
|
static int |
MINUTE
The number of milliseconds in a minute.
|
private static long |
serialVersionUID |
private static java.util.TimeZone |
UTC
The UTC timeZone
|
static int |
WEEK
The number of milliseconds in a week.
|
| Constructor and Description |
|---|
KerberosTime()
Creates a new instance of a KerberosTime object
|
KerberosTime(java.util.Date time)
Creates a new instance of KerberosTime.
|
KerberosTime(long date)
Creates a new instance of a KerberosTime object
|
KerberosTime(java.lang.String date)
Creates a new instance of a KerberosTime object
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(KerberosTime that)
compares current kerberos time with the given kerberos time
|
private void |
convertInternal(long date)
converts the given milliseconds time to seconds and
also formats the time to the generalized form
|
boolean |
equals(java.lang.Object obj) |
byte[] |
getBytes() |
java.lang.String |
getDate() |
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 ktime)
checks if the current kerberos time is greater than the given kerberos time
|
int |
hashCode() |
boolean |
isInClockSkew(long clockSkew)
Returns whether this
KerberosTime is within the given clockskew. |
boolean |
isZero()
Returns whether this
KerberosTime is zero. |
boolean |
lessThan(KerberosTime ktime)
checks if the current kerberos time is less or equal than the given kerberos time
|
void |
setDate(java.lang.String date)
Sets the date if it's a valid KerberosTime
|
java.util.Date |
toDate()
Returns the
KerberosTime as a Date. |
java.lang.String |
toString() |
private static final long serialVersionUID
private static final java.util.TimeZone UTC
private java.lang.String date
private long kerberosTime
public static final KerberosTime INFINITY
KerberosTime "infinity."public static final int MINUTE
public static final int DAY
public static final int WEEK
public KerberosTime()
public KerberosTime(java.lang.String date)
date - the KerberosTime to storepublic KerberosTime(long date)
public KerberosTime(java.util.Date time)
time - private void convertInternal(long date)
date - the time in millisecondspublic long getTime()
KerberosTime as a long.KerberosTime as a long.public java.util.Date toDate()
KerberosTime as a Date.KerberosTime as a Date.public static KerberosTime getTime(java.lang.String zuluTime) throws java.text.ParseException
KerberosTime for a given zulu time.zuluTime - KerberosTime.java.text.ParseExceptionpublic void setDate(java.lang.String date)
throws java.text.ParseException
date - The date to storejava.text.ParseExceptionpublic byte[] getBytes()
public java.lang.String getDate()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic boolean isInClockSkew(long clockSkew)
KerberosTime is within the given clockskew.clockSkew - KerberosTime is within the given clockskew.public int compareTo(KerberosTime that)
compareTo in interface java.lang.Comparable<KerberosTime>that - the kerberos time against which the current kerberos time is comparedpublic boolean lessThan(KerberosTime ktime)
ktime - the kerberos time against which the current kerberos time needs to be comparedpublic boolean greaterThan(KerberosTime ktime)
ktime - the kerberos time against which the currnet kerberos time needs to be comparedpublic boolean isZero()
KerberosTime is zero.KerberosTime is zero.public java.lang.String toString()
toString in class java.lang.Object