Class HttpContext

  • All Implemented Interfaces:
    com.hexagonkt.handlers.Context

    
    public final class HttpContext
     implements Context<HttpCall>
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpContext(Context<HttpCall> context)
      HttpContext(HttpRequestPort request, HttpResponsePort response, HttpPredicate predicate, Map<?, ?> attributes)
      HttpContext(HttpCall event, Function1<Context<HttpCall>, Boolean> predicate, List<Handler<HttpCall>> nextHandlers, Integer nextHandler, Exception exception, Map<?, ?> attributes, Boolean handled)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final HttpRequestPort getRequest()
      final HttpResponsePort getResponse()
      final HttpMethod getMethod()
      final HttpProtocol getProtocol()
      final String getHost()
      final Integer getPort()
      final String getPath()
      final QueryParameters getQueryParameters()
      final List<HttpPart> getParts()
      final FormParameters getFormParameters()
      final List<ContentType> getAccept()
      final Authorization getAuthorization()
      final List<X509Certificate> getCertificateChain()
      final Map<String, HttpPart> getPartsMap()
      final URL getUrl()
      final String getUserAgent()
      final String getReferer()
      final String getOrigin()
      final X509Certificate getCertificate()
      final HttpStatus getStatus()
      final Map<String, String> getPathParameters()
      HttpCall getEvent()
      Function1<Context<HttpCall>, Boolean> getPredicate()
      List<Handler<HttpCall>> getNextHandlers()
      Integer getNextHandler()
      Exception getException()
      Map<?, ?> getAttributes()
      Boolean getHandled()
      HttpContext next()
      Context<HttpCall> with(HttpCall event, Function1<Context<HttpCall>, Boolean> predicate, List<Handler<HttpCall>> nextHandlers, Integer nextHandler, Exception exception, Map<?, ?> attributes, Boolean handled)
      final HttpContext unauthorized(Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      final HttpContext forbidden(Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      final HttpContext internalServerError(Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      final HttpContext internalServerError(Exception exception, Headers headers, Map<?, ?> attributes)
      final HttpContext serverError(HttpStatus status, Exception exception, Headers headers, Map<?, ?> attributes)
      final HttpContext ok(Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      final HttpContext sse(Flow.Publisher<ServerEvent> body)
      final HttpContext badRequest(Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      final HttpContext notFound(Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      final HttpContext created(Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      final HttpContext redirect(HttpStatus status, String location, Headers headers, List<Cookie> cookies, Map<?, ?> attributes)
      final HttpContext found(String location, Headers headers, List<Cookie> cookies, Map<?, ?> attributes)
      final HttpContext accepted(Function1<WsSession, Unit> onConnect, Function2<WsSession, ByteArray, Unit> onBinary, Function2<WsSession, String, Unit> onText, Function2<WsSession, ByteArray, Unit> onPing, Function2<WsSession, ByteArray, Unit> onPong, Function3<WsSession, Integer, String, Unit> onClose)
      final HttpContext send(HttpStatus status, Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      final HttpContext send(HttpResponsePort response, Map<?, ?> attributes)
      final HttpContext send(HttpRequestPort request, Map<?, ?> attributes)
      final HttpContext receive(Object body, Headers headers, ContentType contentType, List<ContentType> accept, List<Cookie> cookies, Map<?, ?> attributes)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HttpContext

        HttpContext(Context<HttpCall> context)
      • HttpContext

        HttpContext(HttpRequestPort request, HttpResponsePort response, HttpPredicate predicate, Map<?, ?> attributes)
      • HttpContext

        HttpContext(HttpCall event, Function1<Context<HttpCall>, Boolean> predicate, List<Handler<HttpCall>> nextHandlers, Integer nextHandler, Exception exception, Map<?, ?> attributes, Boolean handled)
    • Method Detail

      • getParts

         final List<HttpPart> getParts()
      • getAccept

         final List<ContentType> getAccept()
      • getPartsMap

         final Map<String, HttpPart> getPartsMap()
      • getPredicate

         Function1<Context<HttpCall>, Boolean> getPredicate()
      • with

         Context<HttpCall> with(HttpCall event, Function1<Context<HttpCall>, Boolean> predicate, List<Handler<HttpCall>> nextHandlers, Integer nextHandler, Exception exception, Map<?, ?> attributes, Boolean handled)
      • unauthorized

         final HttpContext unauthorized(Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      • forbidden

         final HttpContext forbidden(Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      • internalServerError

         final HttpContext internalServerError(Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      • serverError

         final HttpContext serverError(HttpStatus status, Exception exception, Headers headers, Map<?, ?> attributes)
      • ok

         final HttpContext ok(Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      • badRequest

         final HttpContext badRequest(Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      • notFound

         final HttpContext notFound(Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      • created

         final HttpContext created(Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      • redirect

         final HttpContext redirect(HttpStatus status, String location, Headers headers, List<Cookie> cookies, Map<?, ?> attributes)
      • found

         final HttpContext found(String location, Headers headers, List<Cookie> cookies, Map<?, ?> attributes)
      • accepted

         final HttpContext accepted(Function1<WsSession, Unit> onConnect, Function2<WsSession, ByteArray, Unit> onBinary, Function2<WsSession, String, Unit> onText, Function2<WsSession, ByteArray, Unit> onPing, Function2<WsSession, ByteArray, Unit> onPong, Function3<WsSession, Integer, String, Unit> onClose)
      • send

         final HttpContext send(HttpStatus status, Object body, Headers headers, ContentType contentType, List<Cookie> cookies, Map<?, ?> attributes)
      • send

         final HttpContext send(HttpResponsePort response, Map<?, ?> attributes)
      • send

         final HttpContext send(HttpRequestPort request, Map<?, ?> attributes)
      • receive

         final HttpContext receive(Object body, Headers headers, ContentType contentType, List<ContentType> accept, List<Cookie> cookies, Map<?, ?> attributes)