接口 Token

所有超级接口:
Serializable

public interface Token extends Serializable
令牌 Created by davidoff shen on 2016-08-31.
  • 字段详细资料

  • 方法详细资料

    • created

      long created()
      返回:
      令牌创建时间
    • isValid

      boolean isValid()
      返回:
      是否还有效
    • invalidate

      void invalidate()
      声明令牌失效
    • currentAccount

      Account<?> currentAccount()
      返回:
      当前账户
    • setAccount

      void setAccount(Account<?> account)
      设置当前账户
      参数:
      account - account
    • isAccountCredible

      boolean isAccountCredible()
      返回:
      当前账户是否可信
    • setAccountCredible

      void setAccountCredible(boolean credible)
      设置账户是否可信
      参数:
      credible - credible
    • getTokenId

      String getTokenId()
      返回:
      获取令牌id
    • getAttribute

      <T> T getAttribute(String key, Class<T> clz)
      类型参数:
      T -
      参数:
      key - key
      clz - clz
      返回:
      从令牌中获取属性
    • setAttribute

      void setAttribute(String key, Serializable attribute)
      将属性缓存到令牌中
      参数:
      key - key
      attribute - attribute
    • removeAttribute

      void removeAttribute(String key)
      从令牌中移除属性
      参数:
      key - key
    • attributeNames

      Enumeration<String> attributeNames()
      返回:
      遍历所有属性
    • flush

      void flush()
      更新token内的值
    • renew

      void renew()