Payload
- Type of payload this transformer receives.public class StatelessTrailersTransformer<Payload> extends java.lang.Object implements TrailersTransformer<java.lang.Object,Payload>
TrailersTransformer
that does not require any state.Constructor and Description |
---|
StatelessTrailersTransformer() |
Modifier and Type | Method and Description |
---|---|
Payload |
accept(java.lang.Object __,
Payload payload)
Accepts a
Payload . |
protected Payload |
accept(Payload payload)
Same as
accept(Object, Object) but without the state. |
HttpHeaders |
catchPayloadFailure(java.lang.Object __,
java.lang.Throwable cause,
HttpHeaders trailers)
Invoked once all
Payload instances are accepted and the payload stream
has terminated with an error. |
java.lang.Object |
newState()
Creates a new instance of the
State . |
protected HttpHeaders |
payloadComplete(HttpHeaders trailers)
Same as
payloadComplete(Object, HttpHeaders) but without the state. |
HttpHeaders |
payloadComplete(java.lang.Object __,
HttpHeaders trailers)
Invoked once all
Payload instances are accepted and the payload stream
has successfully completed. |
protected HttpHeaders |
payloadFailed(java.lang.Throwable cause,
HttpHeaders trailers)
Same as
catchPayloadFailure(Object, Throwable, HttpHeaders) but without the state. |
public final java.lang.Object newState()
TrailersTransformer
State
.newState
in interface TrailersTransformer<java.lang.Object,Payload>
State
.public final Payload accept(java.lang.Object __, Payload payload)
TrailersTransformer
Payload
.accept
in interface TrailersTransformer<java.lang.Object,Payload>
__
- State
instance created previously by this transformer.payload
- Payload
to accept.Payload
instance.public final HttpHeaders payloadComplete(java.lang.Object __, HttpHeaders trailers)
TrailersTransformer
Payload
instances are accepted
and the payload stream
has successfully completed.payloadComplete
in interface TrailersTransformer<java.lang.Object,Payload>
__
- State
instance created previously by this transformer.trailers
- Trailer for the streaming HTTP request/response that is transformed.public final HttpHeaders catchPayloadFailure(java.lang.Object __, java.lang.Throwable cause, HttpHeaders trailers) throws java.lang.Throwable
TrailersTransformer
Payload
instances are accepted
and the payload stream
has terminated with an error.
This method suppresses the passed cause
if it returns successfully. In order to propagate the
cause
, one should throw the same from this method.
catchPayloadFailure
in interface TrailersTransformer<java.lang.Object,Payload>
__
- State
instance created previously by this transformer.cause
- of the payload stream failure.trailers
- Trailer for the streaming HTTP request/response that is transformed.cause
. In order to
propagate the cause
, it should be re-thrown.java.lang.Throwable
- If the error has to be propagatedprotected Payload accept(Payload payload)
accept(Object, Object)
but without the state.payload
- Payload
to accept.Payload
instance.protected HttpHeaders payloadComplete(HttpHeaders trailers)
payloadComplete(Object, HttpHeaders)
but without the state.trailers
- Trailer for the streaming HTTP request/response that is transformed.protected HttpHeaders payloadFailed(java.lang.Throwable cause, HttpHeaders trailers) throws java.lang.Throwable
catchPayloadFailure(Object, Throwable, HttpHeaders)
but without the state.cause
- of the payload stream failure.trailers
- Trailer for the streaming HTTP request/response that is transformed.cause
. In order to
propagate the cause
, it should be re-thrown.java.lang.Throwable
- If the error has to be propagated