Class EncryptSession<S,​U>

  • Type Parameters:
    S - Session object, intended to contain user session data.
    U - User object, intended to be a authenticated user.
    All Implemented Interfaces:
    Between<S,​U>

    public class EncryptSession<S,​U>
    extends java.lang.Object
    implements Between<S,​U>
    Intended to be used after a resource has processed the request. This will encrypt the session which will become a cookie.
    • Field Detail

      • COULD_NOT_ENCRYPT_SESSION

        public static final java.lang.String COULD_NOT_ENCRYPT_SESSION
        See Also:
        Constant Field Values
      • LOGGER

        protected static org.slf4j.Logger LOGGER
    • Constructor Detail

      • EncryptSession

        public EncryptSession​(CookieConfig cookieConfig,
                              org.rootservices.jwt.entity.jwk.SymmetricKey preferredKey,
                              com.fasterxml.jackson.databind.ObjectWriter objectWriter)
    • Method Detail

      • onHalt

        protected void onHalt​(HaltException e,
                              Response response)
        This method will be called before a Halt Exception is thrown. Override this method if you wish to change the behavior on the response right before a Halt Exception is going to be thrown. An Example would be, you may want to redirect the user to a login page.
        Parameters:
        e - a HaltException
        response - a Response
      • shouldEncrypt

        protected java.lang.Boolean shouldEncrypt​(Request<S,​U> request,
                                                  Response<S> response)
      • setCookieConfig

        public void setCookieConfig​(CookieConfig cookieConfig)
      • getPreferredKey

        public org.rootservices.jwt.entity.jwk.SymmetricKey getPreferredKey()
      • setPreferredKey

        public void setPreferredKey​(org.rootservices.jwt.entity.jwk.SymmetricKey preferredKey)