- java.lang.Object
-
- org.eclipse.jetty.client.util.AbstractRequestContent
-
- All Implemented Interfaces:
Request.Content
- Direct Known Subclasses:
ByteBufferRequestContent,BytesRequestContent,InputStreamRequestContent,MultiPartRequestContent,PathRequestContent
public abstract class AbstractRequestContent extends java.lang.Object implements Request.Content
Partial implementation of
Request.Content.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAbstractRequestContent.AbstractSubscriptionPartial implementation ofSubscription.static interfaceAbstractRequestContent.Producer-
Nested classes/interfaces inherited from interface org.eclipse.jetty.client.api.Request.Content
Request.Content.Consumer, Request.Content.Subscription
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRequestContent(java.lang.String contentType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetContentType()protected abstract Request.Content.SubscriptionnewSubscription(Request.Content.Consumer consumer, boolean emitInitialContent)Request.Content.Subscriptionsubscribe(Request.Content.Consumer consumer, boolean emitInitialContent)Initializes this content producer with the content consumer, and with the indication of whether initial content, if present, must be emitted upon the initial demand of content (to support delaying the send of the request content in case ofExpect: 100-ContinuewhenemitInitialContentisfalse).-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.client.api.Request.Content
fail, getLength, isReproducible
-
-
-
-
Method Detail
-
getContentType
public java.lang.String getContentType()
- Specified by:
getContentTypein interfaceRequest.Content- Returns:
- the content type string such as "application/octet-stream" or "application/json;charset=UTF8", or null if no content type must be set
-
subscribe
public Request.Content.Subscription subscribe(Request.Content.Consumer consumer, boolean emitInitialContent)
Description copied from interface:Request.ContentInitializes this content producer with the content consumer, and with the indication of whether initial content, if present, must be emitted upon the initial demand of content (to support delaying the send of the request content in case of
Expect: 100-ContinuewhenemitInitialContentisfalse).- Specified by:
subscribein interfaceRequest.Content- Parameters:
consumer- the content consumer to invoke when there is demand for contentemitInitialContent- whether to emit initial content, if present- Returns:
- the Subscription that links this producer to the consumer
-
newSubscription
protected abstract Request.Content.Subscription newSubscription(Request.Content.Consumer consumer, boolean emitInitialContent)
-
-