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<Void,Payload>
public class StatelessTrailersTransformer<Payload>
extends Object
implements TrailersTransformer<Void,Payload>
An implementation of
TrailersTransformer that does not require any state.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal PayloadAccepts aTrailersTransformer.protected PayloadSame asaccept(Void, Object)but without the state.final HttpHeaderscatchPayloadFailure(Void __, Throwable cause, HttpHeaders trailers) Invoked once allTrailersTransformerinstances areacceptedand the payload stream has terminated with an error.final VoidnewState()Creates a new instance of theTrailersTransformer.protected HttpHeaderspayloadComplete(HttpHeaders trailers) Same aspayloadComplete(Void, HttpHeaders)but without the state.final HttpHeaderspayloadComplete(Void __, HttpHeaders trailers) Invoked once allTrailersTransformerinstances areacceptedand the payload stream has successfully completed.protected HttpHeaderspayloadFailed(Throwable cause, HttpHeaders trailers) Same ascatchPayloadFailure(Void, Throwable, HttpHeaders)but without the state.
-
Constructor Details
-
StatelessTrailersTransformer
public StatelessTrailersTransformer()
-
-
Method Details
-
newState
Description copied from interface:TrailersTransformerCreates a new instance of theTrailersTransformer.- Specified by:
newStatein interfaceTrailersTransformer<Void,Payload> - Returns:
- A new instance of the
TrailersTransformer.
-
accept
Description copied from interface:TrailersTransformerAccepts aTrailersTransformer.- Specified by:
acceptin interfaceTrailersTransformer<Void,Payload> - Parameters:
__-TrailersTransformerinstance created previously by this transformer.payload-TrailersTransformerto accept.- Returns:
- Potentially transformed
TrailersTransformerinstance.
-
payloadComplete
Description copied from interface:TrailersTransformerInvoked once allTrailersTransformerinstances areacceptedand the payload stream has successfully completed.- Specified by:
payloadCompletein interfaceTrailersTransformer<Void,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(Void __, Throwable cause, HttpHeaders trailers) throws 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<Void,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:
Throwable- If the error has to be propagated
-
accept
Same asaccept(Void, Object)but without the state.- Parameters:
payload-StatelessTrailersTransformerto accept.- Returns:
- Potentially transformed
StatelessTrailersTransformerinstance.
-
payloadComplete
Same aspayloadComplete(Void, HttpHeaders)but without the state.- Parameters:
trailers- Trailer for the streaming HTTP request/response that is transformed.- Returns:
- Potentially transformed trailers.
-
payloadFailed
Same ascatchPayloadFailure(Void, 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:
Throwable- If the error has to be propagated
-