Interface HttpMessage.MessageTransformations<Self>

All Known Implementing Classes:
HttpRequest, HttpRequest, HttpResponse, HttpResponse
Enclosing interface:
HttpMessage

public static interface HttpMessage.MessageTransformations<Self>
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> Self
    addAttribute(AttributeKey<T> key, T value)
     
    Returns a copy of this message with the given http credential header added to the list of headers.
    Returns a copy of this message with the given header added to the list of headers.
    Returns a copy of this message with the given headers added to the list of headers.
    Returns a copy of this message with the attribute with this key (if any) removed.
    removeHeader(String headerName)
    Returns a copy of this message with all headers of the given name (case-insensitively) removed.
    toStrict(long timeoutMillis, long maxBytes, akka.actor.ClassicActorSystemProvider system)
    Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected.
    toStrict(long timeoutMillis, long maxBytes, Executor ec, akka.stream.Materializer materializer)
    Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected.
    toStrict(long timeoutMillis, akka.actor.ClassicActorSystemProvider system)
    Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected.
    toStrict(long timeoutMillis, Executor ec, akka.stream.Materializer materializer)
    Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected.
    <T> Self
    transformEntityDataBytes(akka.stream.Graph<akka.stream.FlowShape<akka.util.ByteString,akka.util.ByteString>,T> transformer)
    Returns a copy of Self message after applying the given transformation
    withEntity(byte[] bytes)
    Returns a copy of Self message with a new entity.
    Returns a copy of Self message with a new entity.
    withEntity(ContentType type, byte[] bytes)
    Returns a copy of Self message with a new entity.
    withEntity(ContentType type, akka.util.ByteString bytes)
    Returns a copy of Self message with a new entity.
    Returns a copy of Self message with a new entity.
    Returns a copy of Self message with a new entity.
    Returns a copy of Self message with a new entity.
    withEntity(akka.util.ByteString bytes)
    Returns a copy of Self message with a new entity.
    Returns a copy of this message with a new entity.
    Returns a copy of this message with new headers.
    Returns a copy of this message with a new protocol.
  • Method Details

    • withProtocol

      Self withProtocol(HttpProtocol protocol)
      Returns a copy of this message with a new protocol.
    • addHeader

      Self addHeader(HttpHeader header)
      Returns a copy of this message with the given header added to the list of headers.
    • addHeaders

      Self addHeaders(Iterable<HttpHeader> headers)
      Returns a copy of this message with the given headers added to the list of headers.
    • withHeaders

      Self withHeaders(Iterable<HttpHeader> headers)
      Returns a copy of this message with new headers.
    • addAttribute

      <T> Self addAttribute(AttributeKey<T> key, T value)
    • addCredentials

      Self addCredentials(HttpCredentials credentials)
      Returns a copy of this message with the given http credential header added to the list of headers.
    • removeHeader

      Self removeHeader(String headerName)
      Returns a copy of this message with all headers of the given name (case-insensitively) removed.
    • removeAttribute

      Self removeAttribute(AttributeKey<?> key)
      Returns a copy of this message with the attribute with this key (if any) removed.
    • withEntity

      Self withEntity(String string)
      Returns a copy of this message with a new entity.
    • withEntity

      Self withEntity(byte[] bytes)
      Returns a copy of Self message with a new entity.
    • withEntity

      Self withEntity(akka.util.ByteString bytes)
      Returns a copy of Self message with a new entity.
    • withEntity

      Self withEntity(ContentType.NonBinary type, String string)
      Returns a copy of Self message with a new entity.
    • withEntity

      Self withEntity(ContentType type, byte[] bytes)
      Returns a copy of Self message with a new entity.
    • withEntity

      Self withEntity(ContentType type, akka.util.ByteString bytes)
      Returns a copy of Self message with a new entity.
    • withEntity

      Self withEntity(ContentType type, File file)
      Returns a copy of Self message with a new entity.
    • withEntity

      Self withEntity(ContentType type, Path file)
      Returns a copy of Self message with a new entity.
    • withEntity

      Self withEntity(RequestEntity entity)
      Returns a copy of Self message with a new entity.
    • transformEntityDataBytes

      <T> Self transformEntityDataBytes(akka.stream.Graph<akka.stream.FlowShape<akka.util.ByteString,akka.util.ByteString>,T> transformer)
      Returns a copy of Self message after applying the given transformation
    • toStrict

      CompletionStage<? extends Self> toStrict(long timeoutMillis, Executor ec, akka.stream.Materializer materializer)
      Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected. As the duration of receiving the complete entity cannot be predicted, a timeout needs to be specified to guard the process against running and keeping resources infinitely. Use getEntity().getDataBytes and stream processing instead if the expected data is big or is likely to take a long time.
    • toStrict

      CompletionStage<? extends Self> toStrict(long timeoutMillis, long maxBytes, Executor ec, akka.stream.Materializer materializer)
      Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected. As the duration of receiving the complete entity cannot be predicted, a timeout needs to be specified to guard the process against running and keeping resources infinitely. Use getEntity().getDataBytes and stream processing instead if the expected data is big or is likely to take a long time.
    • toStrict

      CompletionStage<? extends Self> toStrict(long timeoutMillis, akka.actor.ClassicActorSystemProvider system)
      Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected. As the duration of receiving the complete entity cannot be predicted, a timeout needs to be specified to guard the process against running and keeping resources infinitely. Use getEntity().getDataBytes and stream processing instead if the expected data is big or is likely to take a long time.
    • toStrict

      CompletionStage<? extends Self> toStrict(long timeoutMillis, long maxBytes, akka.actor.ClassicActorSystemProvider system)
      Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected. As the duration of receiving the complete entity cannot be predicted, a timeout needs to be specified to guard the process against running and keeping resources infinitely. Use getEntity().getDataBytes and stream processing instead if the expected data is big or is likely to take a long time.