Class SdkPublishers
- java.lang.Object
-
- software.amazon.awssdk.core.internal.async.SdkPublishers
-
public final class SdkPublishers extends Object
Common implementations ofSdkPublisher
that are provided for convenience when building asynchronous interceptors to be used with specific clients.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SdkPublisher<ByteBuffer>
envelopeWrappedPublisher(org.reactivestreams.Publisher<ByteBuffer> publisher, String envelopePrefix, String envelopeSuffix)
Constructs anSdkPublisher
that wraps aByteBuffer
publisher and inserts additional content that wraps the published content like an envelope.
-
-
-
Method Detail
-
envelopeWrappedPublisher
public static SdkPublisher<ByteBuffer> envelopeWrappedPublisher(org.reactivestreams.Publisher<ByteBuffer> publisher, String envelopePrefix, String envelopeSuffix)
Constructs anSdkPublisher
that wraps aByteBuffer
publisher and inserts additional content that wraps the published content like an envelope. This can be used when you want to transform the content of an asynchronous SDK response by putting it in an envelope. This publisher implementation does not comply with the complete flow spec (as it inserts data into the middle of a flow between a third-party publisher and subscriber rather than acting as a fully featured independent publisher) and therefore should only be used in a limited fashion when we have complete control over how data is being published to the publisher it wraps.- Parameters:
publisher
- The underlying publisher to wrap the content of.envelopePrefix
- A string representing the content to be inserted as the head of the containing envelope.envelopeSuffix
- A string representing the content to be inserted as the tail of containing envelope.- Returns:
- An
SdkPublisher
that wraps the provided publisher.
-
-