Interface HttpMessageResponse

All Superinterfaces:
BaseMessageResponse, BaseResponse, HttpBaseResponse
All Known Subinterfaces:
HttpResponse, MessageResponse, Response

public interface HttpMessageResponse extends BaseMessageResponse, HttpBaseResponse
Represents a response that can manipulate a flow of messages.
Author:
Guillaume LAMIRAND (guillaume.lamirand at graviteesource.com), GraviteeSource Team
  • Method Details

    • messages

      io.reactivex.rxjava3.core.Flowable<Message> messages()
      Get the response message flow as a Flowable of Message. WARN: you should not keep a direct reference on the message flow as it could be overridden by others at anytime.
      Specified by:
      messages in interface BaseMessageResponse
      Returns:
      a Flowable of Message.
    • messages

      void messages(io.reactivex.rxjava3.core.Flowable<Message> messages)
      Set the response message flow. WARN:
      • Replacing the message flow DOES NOT take care of the previous message flow in place.
      • You MUST ensure to consume the previous message flow when using it.
      • You SHOULD consider using onMessages(FlowableTransformer) or onMessage(Function) that may be more appropriate for message transformation.
      Specified by:
      messages in interface BaseMessageResponse
      See Also:
    • onMessages

      io.reactivex.rxjava3.core.Completable onMessages(io.reactivex.rxjava3.core.FlowableTransformer<Message,Message> onMessages)
      Applies a given transformation on each message. Ex: response.onMessages(messages -> messages.flatMap(message -> transformMyMessage(message)));
      Specified by:
      onMessages in interface BaseMessageResponse
      Parameters:
      onMessages - the transformer that will be applied on each message.
      Returns:
      a Completable that completes once the message transformation has been set up on the message flow (not executed).
    • onMessage

      default io.reactivex.rxjava3.core.Completable onMessage(Function<Message,io.reactivex.rxjava3.core.Maybe<Message>> onMessage)
      Applies a given transformation on each message. Ex: Discard a message: response.onMessage(message -> Maybe.empty()); Update a message: response.onMessage(message -> transformMyMessage(message));
      Specified by:
      onMessage in interface BaseMessageResponse
      Parameters:
      onMessage - the transformer that will be applied on each message.
      Returns:
      a Completable that completes once the message transformation has been set up on the message flow (not executed).