Class AsyncRequestBodyListener.NotifyingAsyncRequestBody
- java.lang.Object
-
- software.amazon.awssdk.core.async.listener.AsyncRequestBodyListener.NotifyingAsyncRequestBody
-
- All Implemented Interfaces:
org.reactivestreams.Publisher<ByteBuffer>
,AsyncRequestBody
,SdkPublisher<ByteBuffer>
- Enclosing interface:
- AsyncRequestBodyListener
public static final class AsyncRequestBodyListener.NotifyingAsyncRequestBody extends Object implements AsyncRequestBody
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Long>
contentLength()
String
contentType()
SdkPublisher<AsyncRequestBody>
split(Consumer<AsyncRequestBodySplitConfiguration.Builder> splitConfiguration)
This is a convenience method that passes an instance of theAsyncRequestBodySplitConfiguration
builder, avoiding the need to create one manually viaAsyncRequestBodySplitConfiguration.builder()
.SdkPublisher<AsyncRequestBody>
split(AsyncRequestBodySplitConfiguration splitConfiguration)
Converts thisAsyncRequestBody
to a publisher ofAsyncRequestBody
s, each of which publishes a specific portion of the original data, based on the providedAsyncRequestBodySplitConfiguration
.void
subscribe(org.reactivestreams.Subscriber<? super ByteBuffer> s)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.core.async.SdkPublisher
addTrailingData, buffer, doAfterOnCancel, doAfterOnComplete, doAfterOnError, filter, filter, flatMapIterable, limit, map, subscribe
-
-
-
-
Method Detail
-
contentLength
public Optional<Long> contentLength()
- Specified by:
contentLength
in interfaceAsyncRequestBody
- Returns:
- The content length of the data being produced.
-
contentType
public String contentType()
- Specified by:
contentType
in interfaceAsyncRequestBody
- Returns:
- The content type of the data being produced.
-
split
public SdkPublisher<AsyncRequestBody> split(AsyncRequestBodySplitConfiguration splitConfiguration)
Description copied from interface:AsyncRequestBody
Converts thisAsyncRequestBody
to a publisher ofAsyncRequestBody
s, each of which publishes a specific portion of the original data, based on the providedAsyncRequestBodySplitConfiguration
. The default chunk size is 2MB and the default buffer size is 8MB.By default, if content length of this
AsyncRequestBody
is present, each dividedAsyncRequestBody
is delivered to the subscriber right after it's initialized. On the other hand, if content length is null, it is sent after the entire content for that chunk is buffered. In this case, the configuredmaxMemoryUsageInBytes
must be larger than or equal tochunkSizeInBytes
. Note that this behavior may be different if a specific implementation of this interface overrides this method.- Specified by:
split
in interfaceAsyncRequestBody
- See Also:
AsyncRequestBodySplitConfiguration
-
split
public SdkPublisher<AsyncRequestBody> split(Consumer<AsyncRequestBodySplitConfiguration.Builder> splitConfiguration)
Description copied from interface:AsyncRequestBody
This is a convenience method that passes an instance of theAsyncRequestBodySplitConfiguration
builder, avoiding the need to create one manually viaAsyncRequestBodySplitConfiguration.builder()
.- Specified by:
split
in interfaceAsyncRequestBody
- See Also:
AsyncRequestBody.split(AsyncRequestBodySplitConfiguration)
-
subscribe
public void subscribe(org.reactivestreams.Subscriber<? super ByteBuffer> s)
- Specified by:
subscribe
in interfaceorg.reactivestreams.Publisher<ByteBuffer>
-
-