Class SpincastResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>

java.lang.Object
org.spincast.plugins.response.SpincastResponseRequestContextAddon<R>
All Implemented Interfaces:
org.spincast.core.exchange.ResponseRequestContextAddon<R>

public class SpincastResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>> extends Object implements org.spincast.core.exchange.ResponseRequestContextAddon<R>
  • Field Details

    • logger

      protected static final org.slf4j.Logger logger
    • IS_RESPONSE_CHARACTERS_BASED_BY_DEFAULT

      protected static final boolean IS_RESPONSE_CHARACTERS_BASED_BY_DEFAULT
      See Also:
  • Constructor Details

    • SpincastResponseRequestContextAddon

      @Inject public SpincastResponseRequestContextAddon(R requestContext, org.spincast.core.server.Server server, org.spincast.core.json.JsonManager jsonManager, org.spincast.core.xml.XmlManager xmlManager, org.spincast.core.config.SpincastConfig spincastConfig, org.spincast.core.utils.SpincastUtils spincastUtils, org.spincast.core.routing.ETagFactory etagFactory, org.spincast.core.flash.FlashMessagesHolder flashMessagesHolder, org.spincast.core.flash.FlashMessageFactory flashMessageFactory, org.spincast.core.cookies.CookieFactory cookieFactory)
  • Method Details

    • getRequestContext

      protected R getRequestContext()
    • getServer

      protected org.spincast.core.server.Server getServer()
    • getExchange

      protected Object getExchange()
    • getJsonManager

      protected org.spincast.core.json.JsonManager getJsonManager()
    • getXmlManager

      protected org.spincast.core.xml.XmlManager getXmlManager()
    • getSpincastConfig

      protected org.spincast.core.config.SpincastConfig getSpincastConfig()
    • getSpincastUtils

      protected org.spincast.core.utils.SpincastUtils getSpincastUtils()
    • getEtagFactory

      protected org.spincast.core.routing.ETagFactory getEtagFactory()
    • getFlashMessagesHolder

      protected org.spincast.core.flash.FlashMessagesHolder getFlashMessagesHolder()
    • getFlashMessageFactory

      protected org.spincast.core.flash.FlashMessageFactory getFlashMessageFactory()
    • getCookieFactory

      protected org.spincast.core.cookies.CookieFactory getCookieFactory()
    • getBuffer

      protected ByteArrayOutputStream getBuffer()
    • getOut

      protected ByteArrayOutputStream getOut()
    • getModel

      public org.spincast.core.json.JsonObject getModel()
      Specified by:
      getModel in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • getGzipBuffer

      public GZIPOutputStream getGzipBuffer()
    • isRequestSizeValidated

      protected boolean isRequestSizeValidated()
    • setRequestSizeValidated

      protected void setRequestSizeValidated(boolean requestSizeValidated)
    • setGzipOption

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> setGzipOption(org.spincast.core.utils.GzipOption gzipOption)
      Specified by:
      setGzipOption in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • getGzipOption

      public org.spincast.core.utils.GzipOption getGzipOption()
      Specified by:
      getGzipOption in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • getStatusCode

      public int getStatusCode()
      Specified by:
      getStatusCode in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setStatusCode

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> setStatusCode(int responseStatusCode)
      Specified by:
      setStatusCode in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setContentType

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> setContentType(String responseContentType)
      Specified by:
      setContentType in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • isResponseCharactersBased

      protected boolean isResponseCharactersBased()
      Try to determine is the response is characters based or not. This is allow us to use a default Content-Type header if none was specified.
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect()
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(org.spincast.core.flash.FlashMessage flashMessage)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(org.spincast.core.flash.FlashMessageLevel flashMessageType, String flashMessageText)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(org.spincast.core.flash.FlashMessageLevel flashMessageType, String flashMessageText, org.spincast.core.json.JsonObject flashMessageVariables)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(String newUrl)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(String newUrl, org.spincast.core.flash.FlashMessage flashMessage)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(String newUrl, org.spincast.core.flash.FlashMessageLevel flashMessageType, String flashMessageText)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(String newUrl, org.spincast.core.flash.FlashMessageLevel flashMessageType, String flashMessageText, org.spincast.core.json.JsonObject flashMessageVariables)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(String newUrl, org.spincast.core.json.JsonObject flashMessageVariables)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(String newUrl, boolean permanently)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(String newUrl, boolean permanently, org.spincast.core.flash.FlashMessage flashMessage)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(String newUrl, boolean permanently, org.spincast.core.flash.FlashMessageLevel flashMessageType, String flashMessageText)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(String newUrl, boolean permanently, org.spincast.core.flash.FlashMessageLevel flashMessageType, String flashMessageText, org.spincast.core.json.JsonObject flashMessageVariables)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(String newUrl, int specific3xxCode)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(String newUrl, int specific3xxCode, org.spincast.core.flash.FlashMessageLevel flashMessageType, String flashMessageText)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(String newUrl, int specific3xxCode, org.spincast.core.flash.FlashMessageLevel flashMessageType, String flashMessageText, org.spincast.core.json.JsonObject flashMessageVariables)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • redirect

      public void redirect(String newUrl, int specific3xxCode, org.spincast.core.flash.FlashMessage flashMessage)
      Specified by:
      redirect in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • saveFlashMessage

      protected String saveFlashMessage(String url, org.spincast.core.flash.FlashMessage flashMessage)
      Saves a Flash message. Returned a modified version of the final URL to redirect to, if required.
    • sendBytes

      public void sendBytes(byte[] bytes)
      Specified by:
      sendBytes in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendBytes

      public void sendBytes(byte[] bytes, String contentType)
      Specified by:
      sendBytes in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendBytes

      public void sendBytes(byte[] bytes, String contentType, boolean flush)
      Send some bytes + flush if specified.
      Specified by:
      sendBytes in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • send

      protected void send(byte[] bytes, String contentType, boolean flush)
    • sendCharacters

      public void sendCharacters(String content, String contentType)
      Specified by:
      sendCharacters in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendCharacters

      public void sendCharacters(String content, String contentType, boolean flush)
      Specified by:
      sendCharacters in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • getCharactersCharsetName

      public String getCharactersCharsetName()
      Specified by:
      getCharactersCharsetName in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setCharactersCharsetName

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> setCharactersCharsetName(String charactersCharsetName)
      Specified by:
      setCharactersCharsetName in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendPlainText

      public void sendPlainText(String string)
      Specified by:
      sendPlainText in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendPlainText

      public void sendPlainText(String string, boolean flush)
      Specified by:
      sendPlainText in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendHtml

      public void sendHtml(String html)
      Specified by:
      sendHtml in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendHtml

      public void sendHtml(String string, boolean flush)
      Specified by:
      sendHtml in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendParseHtml

      public void sendParseHtml(String html)
      Specified by:
      sendParseHtml in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendParseHtml

      public void sendParseHtml(String html, boolean flush)
      Specified by:
      sendParseHtml in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendParse

      public void sendParse(String content, String contentType)
      Specified by:
      sendParse in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendParse

      public void sendParse(String content, String contentType, boolean flush)
      Specified by:
      sendParse in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendTemplateHtml

      public void sendTemplateHtml(String templatePath)
      Specified by:
      sendTemplateHtml in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendTemplateHtml

      public void sendTemplateHtml(String templatePath, boolean isClasspathPath)
      Specified by:
      sendTemplateHtml in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendTemplateHtml

      public void sendTemplateHtml(String templatePath, boolean isClasspathPath, boolean flush)
      Specified by:
      sendTemplateHtml in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendTemplate

      public void sendTemplate(String templatePath, String contentType)
      Specified by:
      sendTemplate in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendTemplate

      public void sendTemplate(String templatePath, String contentType, boolean flush)
      Specified by:
      sendTemplate in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendTemplate

      public void sendTemplate(String templatePath, boolean isClasspathPath, String contentType)
      Specified by:
      sendTemplate in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendTemplate

      public void sendTemplate(String templatePath, boolean isClasspathPath, String contentType, boolean flush)
      Specified by:
      sendTemplate in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendJson

      public void sendJson()
      Specified by:
      sendJson in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendJson

      public void sendJson(boolean flush)
      Specified by:
      sendJson in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendJson

      public void sendJson(String jsonString)
      Specified by:
      sendJson in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendJson

      public void sendJson(String jsonString, boolean flush)
      Specified by:
      sendJson in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendJson

      public void sendJson(Object obj)
      Specified by:
      sendJson in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendJson

      public void sendJson(Object obj, boolean flush)
      Specified by:
      sendJson in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendXml

      public void sendXml()
      Specified by:
      sendXml in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendXml

      public void sendXml(boolean flush)
      Specified by:
      sendXml in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendXml

      public void sendXml(String xml)
      Specified by:
      sendXml in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendXml

      public void sendXml(String xml, boolean flush)
      Specified by:
      sendXml in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendXml

      public void sendXml(Object obj)
      Specified by:
      sendXml in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • sendXml

      public void sendXml(Object obj, boolean flush)
      Specified by:
      sendXml in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • addAlertsToModel

      protected void addAlertsToModel()
    • isAddAlertsToModel

      protected boolean isAddAlertsToModel()
      Should Alert messages (and therefore Flash message) be added to the model when sending this one as Json or XML?
    • resetBuffer

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> resetBuffer()
      Specified by:
      resetBuffer in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • resetEverything

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> resetEverything()
      Specified by:
      resetEverything in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • resetEverything

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> resetEverything(boolean resetCookies)
      Specified by:
      resetEverything in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • getUnsentBytes

      public byte[] getUnsentBytes()
      Specified by:
      getUnsentBytes in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • getUnsentCharacters

      public String getUnsentCharacters()
      Specified by:
      getUnsentCharacters in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • getUnsentCharacters

      public String getUnsentCharacters(String encoding)
      Specified by:
      getUnsentCharacters in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • removeHeader

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> removeHeader(String name)
      Specified by:
      removeHeader in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setHeader

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> setHeader(String name, String value)
      Specified by:
      setHeader in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setHeader

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> setHeader(String name, List<String> values)
      Specified by:
      setHeader in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • addHeaderValue

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> addHeaderValue(String name, String value)
      Specified by:
      addHeaderValue in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • addHeaderValues

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> addHeaderValues(String name, List<String> values)
      Specified by:
      addHeaderValues in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • getHeaders

      public Map<String,List<String>> getHeaders()
      Specified by:
      getHeaders in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • getHeader

      public List<String> getHeader(String name)
      Specified by:
      getHeader in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • getHeaderFirst

      public String getHeaderFirst(String name)
      Specified by:
      getHeaderFirst in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • isHeadersSent

      public boolean isHeadersSent()
      Specified by:
      isHeadersSent in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setIsShouldGzip

      protected void setIsShouldGzip(boolean isShouldGzip)
    • isShouldGzip

      protected boolean isShouldGzip()
    • end

      public void end()
      Specified by:
      end in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • flush

      public void flush()
      Specified by:
      flush in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • flush

      public void flush(boolean close)
      Specified by:
      flush in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setCacheSeconds

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> setCacheSeconds(int cacheSeconds)
      Specified by:
      setCacheSeconds in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setCacheSeconds

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> setCacheSeconds(int cacheSeconds, boolean isPrivateCache)
      Specified by:
      setCacheSeconds in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setModel

      public void setModel(org.spincast.core.json.JsonObject model)
      Specified by:
      setModel in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • addAlert

      public void addAlert(org.spincast.core.response.AlertLevel alertType, String alertText)
      Specified by:
      addAlert in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • createAlert

      protected org.spincast.core.response.Alert createAlert(org.spincast.core.response.AlertLevel alertType, String alertText)
    • getCookiesAdded

      public Map<String,org.spincast.core.cookies.Cookie> getCookiesAdded()
      Specified by:
      getCookiesAdded in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • getCookieAdded

      public org.spincast.core.cookies.Cookie getCookieAdded(String name)
      Specified by:
      getCookieAdded in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setCookie

      public void setCookie(org.spincast.core.cookies.Cookie cookie)
      Specified by:
      setCookie in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setCookieSession

      public void setCookieSession(String name, String value)
      Specified by:
      setCookieSession in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setCookieSessionSafe

      public void setCookieSessionSafe(String name, String value)
      Specified by:
      setCookieSessionSafe in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setCookie1year

      public void setCookie1year(String name, String value)
      Specified by:
      setCookie1year in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setCookie1yearSafe

      public void setCookie1yearSafe(String name, String value)
      Specified by:
      setCookie1yearSafe in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setCookie10years

      public void setCookie10years(String name, String value)
      Specified by:
      setCookie10years in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setCookie10yearsSafe

      public void setCookie10yearsSafe(String name, String value)
      Specified by:
      setCookie10yearsSafe in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setCookie

      public void setCookie(String name, String value, int nbrSecondsToLive)
      Specified by:
      setCookie in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • setCookie

      public void setCookie(String name, String value, int nbrSecondsToLive, boolean httpOnly)
      Specified by:
      setCookie in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • addCookieSafe

      protected void addCookieSafe(String name, String value, Integer nbrSecondsToLive)
    • setCookie

      public void setCookie(String name, String value, String path, String domain, Date expires, boolean secure, boolean httpOnly, org.spincast.core.cookies.CookieSameSite cookieSameSite, boolean discard, int version)
      Specified by:
      setCookie in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • validateCookie

      protected boolean validateCookie(org.spincast.core.cookies.Cookie cookie)
    • deleteCookie

      public void deleteCookie(String name)
      Specified by:
      deleteCookie in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • deleteAllCookiesUserHas

      public void deleteAllCookiesUserHas()
      Specified by:
      deleteAllCookiesUserHas in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • createCookie

      public org.spincast.core.cookies.Cookie createCookie(String name)
      Specified by:
      createCookie in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • addForm

      public void addForm(org.spincast.core.request.Form form)
      Specified by:
      addForm in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • addForm

      public void addForm(org.spincast.core.request.Form form, String validationElementName)
      Specified by:
      addForm in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • getResourcesToPush

      public Set<org.spincast.core.routing.ResourceToPush> getResourcesToPush()
    • push

      public org.spincast.core.exchange.ResponseRequestContextAddon<R> push(org.spincast.core.routing.HttpMethod httpMethod, String path, Map<String,List<String>> requestHeaders)
      Specified by:
      push in interface org.spincast.core.exchange.ResponseRequestContextAddon<R extends org.spincast.core.exchange.RequestContext<?>>
    • tweakResourceToPushPath

      protected String tweakResourceToPushPath(String path)