Class RequestEnvelope
- java.lang.Object
-
- org.opendaylight.controller.cluster.access.concepts.Envelope<Request<?,?>>
-
- org.opendaylight.controller.cluster.access.concepts.RequestEnvelope
-
- All Implemented Interfaces:
Serializable,Immutable,MutationBehaviour<Immutable>
public final class RequestEnvelope extends Envelope<Request<?,?>>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RequestEnvelope(Request<?,?> message, long sessionId, long txSequence)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResponseEnvelope<?>newSuccessEnvelope(RequestSuccess<?,?> success, long executionTimeNanos)Creates a successful ResponseEnvelope that wraps the given successful Request response message.voidsendFailure(RequestException cause, long executionTimeNanos)Respond to this envelope with aRequestFailurecaused by specifiedRequestException.voidsendSuccess(RequestSuccess<?,?> success, long executionTimeNanos)Respond to this envelope with aRequestSuccess.-
Methods inherited from class org.opendaylight.controller.cluster.access.concepts.Envelope
getMessage, getSessionId, getTxSequence, toString
-
-
-
-
Constructor Detail
-
RequestEnvelope
public RequestEnvelope(Request<?,?> message, long sessionId, long txSequence)
-
-
Method Detail
-
sendFailure
public void sendFailure(RequestException cause, long executionTimeNanos)
Respond to this envelope with aRequestFailurecaused by specifiedRequestException.- Parameters:
cause- Cause of thisRequestFailureexecutionTimeNanos- Time to execute the request, in nanoseconds- Throws:
NullPointerException- if cause is null
-
sendSuccess
public void sendSuccess(RequestSuccess<?,?> success, long executionTimeNanos)
Respond to this envelope with aRequestSuccess.- Parameters:
success- Successful response- Throws:
NullPointerException- if success is null
-
newSuccessEnvelope
public ResponseEnvelope<?> newSuccessEnvelope(RequestSuccess<?,?> success, long executionTimeNanos)
Creates a successful ResponseEnvelope that wraps the given successful Request response message.- Parameters:
success- the successful Request response messageexecutionTimeNanos- the execution time of the request- Returns:
- a
ResponseEnvelopeinstance
-
-