Class FastToken

java.lang.Object
org.jivesoftware.openfire.fast.FastToken

public class FastToken extends Object
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 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

      @Nonnull public String getUsername()
      Returns the username this token belongs to.
      Returns:
      the username (never null)
    • getMechanism

      @Nonnull public String 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

      @Nonnull public String getTokenString()
      Returns the SASL-HT token string exactly as sent in XEP-0484 XML.
    • getExpiry

      @Nonnull public Instant getExpiry()
      Returns the instant at which this token expires.
      Returns:
      the expiry instant (never null)
    • isExpired

      public boolean isExpired()
      Returns true if this token has expired relative to the current time.
      Returns:
      true if expired
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object