public class KerberosTime extends Object implements Comparable<KerberosTime>
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
KerberosTime()
Creates a new instance of a KerberosTime object
|
KerberosTime(Date time)
Creates a new instance of KerberosTime.
|
KerberosTime(long date)
Creates a new instance of a KerberosTime object
|
KerberosTime(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
|
boolean |
equals(Object obj) |
byte[] |
getBytes() |
String |
getDate() |
long |
getTime()
Returns the
KerberosTime as a long. |
static KerberosTime |
getTime(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(String date)
Sets the date if it's a valid KerberosTime
|
Date |
toDate()
Returns the
KerberosTime as a Date. |
String |
toString() |
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(String date)
date - the KerberosTime to storepublic KerberosTime(long date)
public KerberosTime(Date time)
time - public long getTime()
KerberosTime as a long.KerberosTime as a long.public Date toDate()
KerberosTime as a Date.KerberosTime as a Date.public static KerberosTime getTime(String zuluTime) throws ParseException
KerberosTime for a given zulu time.zuluTime - KerberosTime.ParseExceptionpublic void setDate(String date) throws ParseException
date - The date to storeParseExceptionpublic byte[] getBytes()
public String getDate()
public 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 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.Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.