Class RatpackWebContext

java.lang.Object
ratpack.pac4j.internal.RatpackWebContext
All Implemented Interfaces:
org.pac4j.core.context.WebContext

public class RatpackWebContext extends Object implements org.pac4j.core.context.WebContext
  • Constructor Details

    • RatpackWebContext

      public RatpackWebContext(ratpack.handling.Context ctx, ratpack.http.TypedData body, ratpack.session.SessionData session)
  • Method Details

    • getContext

      public ratpack.handling.Context getContext()
      Get the ratpack context.
      Returns:
      the ratpack context
    • from

      public static ratpack.exec.Promise<RatpackWebContext> from(ratpack.handling.Context ctx, boolean bodyBacked)
    • callContext

      public org.pac4j.core.context.CallContext callContext()
    • getSessionStore

      public org.pac4j.core.context.session.SessionStore getSessionStore()
    • getProfileManager

      public org.pac4j.core.profile.ProfileManager getProfileManager()
    • getRequestParameter

      public Optional<String> getRequestParameter(String name)
      Specified by:
      getRequestParameter in interface org.pac4j.core.context.WebContext
    • getRequestParameters

      public Map<String,String[]> getRequestParameters()
      Specified by:
      getRequestParameters in interface org.pac4j.core.context.WebContext
    • getRequestAttribute

      public Optional getRequestAttribute(String name)
      Specified by:
      getRequestAttribute in interface org.pac4j.core.context.WebContext
    • setRequestAttribute

      public void setRequestAttribute(String name, Object value)
      Specified by:
      setRequestAttribute in interface org.pac4j.core.context.WebContext
    • getRequestHeader

      public Optional<String> getRequestHeader(String name)
      Specified by:
      getRequestHeader in interface org.pac4j.core.context.WebContext
    • getRequestMethod

      public String getRequestMethod()
      Specified by:
      getRequestMethod in interface org.pac4j.core.context.WebContext
    • getRemoteAddr

      public String getRemoteAddr()
      Specified by:
      getRemoteAddr in interface org.pac4j.core.context.WebContext
    • setResponseHeader

      public void setResponseHeader(String name, String value)
      Specified by:
      setResponseHeader in interface org.pac4j.core.context.WebContext
    • getResponseHeader

      public Optional<String> getResponseHeader(String s)
      Specified by:
      getResponseHeader in interface org.pac4j.core.context.WebContext
    • setResponseContentType

      public void setResponseContentType(String content)
      Specified by:
      setResponseContentType in interface org.pac4j.core.context.WebContext
    • getServerName

      public String getServerName()
      Specified by:
      getServerName in interface org.pac4j.core.context.WebContext
    • getServerPort

      public int getServerPort()
      Specified by:
      getServerPort in interface org.pac4j.core.context.WebContext
    • getScheme

      public String getScheme()
      Specified by:
      getScheme in interface org.pac4j.core.context.WebContext
    • isSecure

      public boolean isSecure()
      Specified by:
      isSecure in interface org.pac4j.core.context.WebContext
    • getFullRequestURL

      public String getFullRequestURL()
      Specified by:
      getFullRequestURL in interface org.pac4j.core.context.WebContext
    • getRequestURL

      public String getRequestURL()
      Specified by:
      getRequestURL in interface org.pac4j.core.context.WebContext
    • sendResponse

      public void sendResponse(org.pac4j.core.exception.http.HttpAction action)
    • sendStatusCode

      public void sendStatusCode(org.pac4j.core.exception.http.HttpAction action)
    • getRequestCookies

      public Collection<org.pac4j.core.context.Cookie> getRequestCookies()
      Specified by:
      getRequestCookies in interface org.pac4j.core.context.WebContext
    • addResponseCookie

      public void addResponseCookie(org.pac4j.core.context.Cookie cookie)
      Specified by:
      addResponseCookie in interface org.pac4j.core.context.WebContext
    • getPath

      public String getPath()
      Specified by:
      getPath in interface org.pac4j.core.context.WebContext
    • getRequestContent

      public String getRequestContent()
      Specified by:
      getRequestContent in interface org.pac4j.core.context.WebContext
    • getProtocol

      public String getProtocol()
      Specified by:
      getProtocol in interface org.pac4j.core.context.WebContext