Top Description Fields Constructors Methods
org.eclipse.jetty.reactive.client.internal

public Class PublisherContent

extends AbstractSingleProcessor<Content.Chunk, Content.Chunk>
implements Content
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.reactive.client.ReactiveRequest.Content, org.reactivestreams.Publisher
Imports
java.util.Objects, org.eclipse.jetty.io.Content, org.eclipse.jetty.reactive.client.ReactiveRequest, org.reactivestreams.Publisher, .Subscriber

A ReactiveRequest.Content that wraps a Publisher.

Field Summary

Modifier and TypeField and Description
private final String
private final Publisher<Content.Chunk>

Constructor Summary

AccessConstructor and Description
public
PublisherContent(Publisher<Content.Chunk> publisher, String contentType)

Method Summary

Modifier and TypeMethod and Description
public String
public long
public void
onNext(Content.Chunk
the element signaled
chunk
)

Implements org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).
public boolean
rewind()

Overrides default org.eclipse.jetty.reactive.client.ReactiveRequest.Content.rewind.

Rewinds this content, if possible.

public void
subscribe(Subscriber<? super Content.Chunk>
the Subscriber that will consume signals from this Publisher
subscriber
)

Overrides org.eclipse.jetty.reactive.client.internal.AbstractSinglePublisher.subscribe.

Implements org.reactivestreams.Publisher.subscribe.

Request Publisher to start streaming data.
Inherited from org.eclipse.jetty.reactive.client.internal.AbstractSingleProcessor:
canceldownStreamdownStreamOnNextonCompleteonErroronFailureonRequestonSubscribetoStringupStreamCancelupStreamRequest

Field Detail

contentTypeback to summary
private final String contentType
publisherback to summary
private final Publisher<Content.Chunk> publisher

Constructor Detail

PublisherContentback to summary
public PublisherContent(Publisher<Content.Chunk> publisher, String contentType)

Method Detail

getContentTypeback to summary
public String getContentType()

Implements org.eclipse.jetty.reactive.client.ReactiveRequest.Content.getContentType.

Returns:String

Doc from org.eclipse.jetty.reactive.client.ReactiveRequest.Content.getContentType.

the content type in the form media_type[;charset=<charset>]

Annotations
@Override
getLengthback to summary
public long getLength()

Implements org.eclipse.jetty.reactive.client.ReactiveRequest.Content.getLength.

Returns:long

Doc from org.eclipse.jetty.reactive.client.ReactiveRequest.Content.getLength.

the content length

Annotations
@Override
onNextback to summary
public void onNext(Content.Chunk chunk)

Implements org.reactivestreams.Subscriber.onNext.

Doc from org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).

Parameters
chunk:Content.Chunk

the element signaled

Annotations
@Override
rewindback to summary
public boolean rewind()

Overrides default org.eclipse.jetty.reactive.client.ReactiveRequest.Content.rewind.

Doc from org.eclipse.jetty.reactive.client.ReactiveRequest.Content.rewind.

Rewinds this content, if possible.

Returns:boolean

whether this request content was rewound

Annotations
@Override
subscribeback to summary
public void subscribe(Subscriber<? super Content.Chunk> subscriber)

Overrides org.eclipse.jetty.reactive.client.internal.AbstractSinglePublisher.subscribe.

Implements org.reactivestreams.Publisher.subscribe.

Doc from org.reactivestreams.Publisher.subscribe.

Request Publisher to start streaming data.

This is a "factory method" and can be called multiple times, each time starting a new Subscription.

Each Subscription will work for only a single Subscriber.

A Subscriber should only subscribe once to a single Publisher.

If the Publisher rejects the subscription attempt or otherwise fails it will signal the error via Subscriber#onError(Throwable).

Parameters
subscriber:Subscriber<? super Content.Chunk>

the Subscriber that will consume signals from this Publisher

Annotations
@Override