State
- Type of state provided by this transformer.Payload
- Type of payload this transformer receives.public interface TrailersTransformer<State,Payload>
Modifier and Type | Method and Description |
---|---|
Payload |
accept(State state,
Payload payload)
Accepts a
Payload . |
HttpHeaders |
catchPayloadFailure(State state,
java.lang.Throwable cause,
HttpHeaders trailers)
Invoked once all
Payload instances are accepted and the payload stream
has terminated with an error. |
State |
newState()
Creates a new instance of the
State . |
HttpHeaders |
payloadComplete(State state,
HttpHeaders trailers)
Invoked once all
Payload instances are accepted and the payload stream
has successfully completed. |
@Nullable State newState()
State
.State
.Payload accept(@Nullable State state, Payload payload)
Payload
.state
- State
instance created previously by this transformer.payload
- Payload
to accept.Payload
instance.HttpHeaders payloadComplete(@Nullable State state, HttpHeaders trailers)
Payload
instances are accepted
and the payload stream
has successfully completed.state
- State
instance created previously by this transformer.trailers
- Trailer for the streaming HTTP request/response that is transformed.HttpHeaders catchPayloadFailure(@Nullable State state, java.lang.Throwable cause, HttpHeaders trailers) throws java.lang.Throwable
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.
state
- 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 propagated