Package org.jivesoftware.openfire.fast
Class FastToken
java.lang.Object
org.jivesoftware.openfire.fast.FastToken
Value object representing a FAST (XEP-0484) authentication token.
Holds the raw token bytes, the username and mechanism it belongs to, and its expiry time.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the instant at which this token expires.Returns the FAST SASL mechanism name associated with this token.byte[]getToken()Returns a copy of the raw token bytes.Returns the SASL-HT token string exactly as sent in XEP-0484 XML.Returns the username this token belongs to.inthashCode()booleanReturnstrueif this token has expired relative to the current time.toString()
-
Constructor Details
-
FastToken
public FastToken(@Nonnull String username, @Nonnull String mechanism, @Nonnull byte[] token, @Nonnull Instant expiry) Constructs a FastToken.- Parameters:
username- the local username this token belongs to (cannot be null)mechanism- the FAST SASL mechanism name (cannot be null)token- the raw token bytes (cannot be null)expiry- the instant at which this token expires (cannot be null)
-
-
Method Details
-
getUsername
Returns the username this token belongs to.- Returns:
- the username (never null)
-
getMechanism
Returns the FAST SASL mechanism name associated with this token.- Returns:
- the mechanism name (never null)
-
getToken
@Nonnull public byte[] getToken()Returns a copy of the raw token bytes.- Returns:
- the raw token bytes (never null)
-
getTokenString
Returns the SASL-HT token string exactly as sent in XEP-0484 XML. -
getExpiry
Returns the instant at which this token expires.- Returns:
- the expiry instant (never null)
-
isExpired
public boolean isExpired()Returnstrueif this token has expired relative to the current time.- Returns:
trueif expired
-
equals
-
hashCode
public int hashCode() -
toString
-