Package io.servicetalk.http.api
Class StatelessTrailersTransformer<Payload>
- java.lang.Object
-
- io.servicetalk.http.api.StatelessTrailersTransformer<Payload>
-
- Type Parameters:
Payload- Type of payload this transformer receives.
- All Implemented Interfaces:
TrailersTransformer<java.lang.Object,Payload>
public class StatelessTrailersTransformer<Payload> extends java.lang.Object implements TrailersTransformer<java.lang.Object,Payload>
An implementation ofTrailersTransformerthat does not require any state.
-
-
Constructor Summary
Constructors Constructor Description StatelessTrailersTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Payloadaccept(java.lang.Object __, Payload payload)Accepts aTrailersTransformer.protected Payloadaccept(Payload payload)Same asaccept(Object, Object)but without the state.HttpHeaderscatchPayloadFailure(java.lang.Object __, java.lang.Throwable cause, HttpHeaders trailers)Invoked once allTrailersTransformerinstances areacceptedand the payload stream has terminated with an error.java.lang.ObjectnewState()Creates a new instance of theTrailersTransformer.protected HttpHeaderspayloadComplete(HttpHeaders trailers)Same aspayloadComplete(Object, HttpHeaders)but without the state.HttpHeaderspayloadComplete(java.lang.Object __, HttpHeaders trailers)Invoked once allTrailersTransformerinstances areacceptedand the payload stream has successfully completed.protected HttpHeaderspayloadFailed(java.lang.Throwable cause, HttpHeaders trailers)Same ascatchPayloadFailure(Object, Throwable, HttpHeaders)but without the state.
-
-
-
Method Detail
-
newState
public final java.lang.Object newState()
Description copied from interface:TrailersTransformerCreates a new instance of theTrailersTransformer.- Specified by:
newStatein interfaceTrailersTransformer<java.lang.Object,Payload>- Returns:
- A new instance of the
TrailersTransformer.
-
accept
public final Payload accept(java.lang.Object __, Payload payload)
Description copied from interface:TrailersTransformerAccepts aTrailersTransformer.- Specified by:
acceptin interfaceTrailersTransformer<java.lang.Object,Payload>- Parameters:
__-TrailersTransformerinstance created previously by this transformer.payload-TrailersTransformerto accept.- Returns:
- Potentially transformed
TrailersTransformerinstance.
-
payloadComplete
public final HttpHeaders payloadComplete(java.lang.Object __, HttpHeaders trailers)
Description copied from interface:TrailersTransformerInvoked once allTrailersTransformerinstances areacceptedand the payload stream has successfully completed.- Specified by:
payloadCompletein interfaceTrailersTransformer<java.lang.Object,Payload>- Parameters:
__-TrailersTransformerinstance created previously by this transformer.trailers- Trailer for the streaming HTTP request/response that is transformed.- Returns:
- Potentially transformed trailers.
-
catchPayloadFailure
public final HttpHeaders catchPayloadFailure(java.lang.Object __, java.lang.Throwable cause, HttpHeaders trailers) throws java.lang.Throwable
Description copied from interface:TrailersTransformerInvoked once allTrailersTransformerinstances areacceptedand the payload stream has terminated with an error.This method suppresses the passed
causeif it returns successfully. In order to propagate thecause, one should throw the same from this method.- Specified by:
catchPayloadFailurein interfaceTrailersTransformer<java.lang.Object,Payload>- Parameters:
__-TrailersTransformerinstance created previously by this transformer.cause- of the payload stream failure.trailers- Trailer for the streaming HTTP request/response that is transformed.- Returns:
- Potentially transformed trailers. This will swallow the passed
cause. In order to propagate thecause, it should be re-thrown. - Throws:
java.lang.Throwable- If the error has to be propagated
-
accept
protected Payload accept(Payload payload)
Same asaccept(Object, Object)but without the state.- Parameters:
payload-StatelessTrailersTransformerto accept.- Returns:
- Potentially transformed
StatelessTrailersTransformerinstance.
-
payloadComplete
protected HttpHeaders payloadComplete(HttpHeaders trailers)
Same aspayloadComplete(Object, HttpHeaders)but without the state.- Parameters:
trailers- Trailer for the streaming HTTP request/response that is transformed.- Returns:
- Potentially transformed trailers.
-
payloadFailed
protected HttpHeaders payloadFailed(java.lang.Throwable cause, HttpHeaders trailers) throws java.lang.Throwable
Same ascatchPayloadFailure(Object, Throwable, HttpHeaders)but without the state.- Parameters:
cause- of the payload stream failure.trailers- Trailer for the streaming HTTP request/response that is transformed.- Returns:
- Potentially transformed trailers. This will swallow the passed
cause. In order to propagate thecause, it should be re-thrown. - Throws:
java.lang.Throwable- If the error has to be propagated
-
-