Class Session

java.lang.Object
iu.auth.session.Session
All Implemented Interfaces:
IuSession

class Session extends Object implements IuSession
IuSession implementation
  • Constructor Details

    • Session

      Session(URI resourceUri, Duration expires)
      New session constructor.
      Parameters:
      resourceUri - root protected resource URI
      expires - expiration time
    • Session

      Session(String token, byte[] secretKey, WebKey issuerKey, Duration maxSessionTtl)
      Session token constructor.
      Parameters:
      token - tokenized session
      secretKey - Secret key to use for detokenizing the session.
      issuerKey - issuer key
      maxSessionTtl - maximum session time to live
  • Method Details

    • tokenize

      String tokenize(byte[] secretKey, WebKey issuerKey, WebKey.Algorithm algorithm)
      Token constructor
      Parameters:
      secretKey - secret key
      issuerKey - issuer key
      algorithm - algorithm
      Returns:
      tokenized session
    • getDetail

      public <T> T getDetail(Class<T> type)
      Description copied from interface: IuSession
      Get session attributes
      Specified by:
      getDetail in interface IuSession
      Type Parameters:
      T - type
      Parameters:
      type - class
      Returns:
      attributes for the session
    • clearDetail

      public void clearDetail(Class<?> type)
      Description copied from interface: IuSession
      Clear session attributes
      Specified by:
      clearDetail in interface IuSession
      Parameters:
      type - class
    • isChanged

      public boolean isChanged()
      Description copied from interface: IuSession
      Gets whether session object state change
      Specified by:
      isChanged in interface IuSession
      Returns:
      true if session object state has change, otherwise false;
    • setChanged

      void setChanged(boolean changed)
      Sets the change flag
      Parameters:
      changed - set to true when session attributes change, otherwise false
    • getExpires

      Instant getExpires()
      Gets session expire time
      Returns:
      Instant session expire time
    • getResourceUri

      public URI getResourceUri()
      Description copied from interface: IuSession
      Get resource URI
      Specified by:
      getResourceUri in interface IuSession
      Returns:
      resource URI
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isStrict

      public boolean isStrict()
      Gets strict
      Returns:
      strict mode
    • setStrict

      public void setStrict(boolean strict)
      Description copied from interface: IuSession
      Set strict mode
      Specified by:
      setStrict in interface IuSession
      Parameters:
      strict - strict mode