X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcds-access-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fconcepts%2FRequestEnvelope.java;h=46d5d1f99620b83304b49e7d160a6648768dce65;hp=cb9034d32483f086a97fc4b1324dcb71856abc27;hb=b998131396132a7630f271f9baea225b45fde789;hpb=cd2a6fa0d8fa6281be28d3c7b9828ecf4e932811 diff --git a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/RequestEnvelope.java b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/RequestEnvelope.java index cb9034d324..46d5d1f996 100644 --- a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/RequestEnvelope.java +++ b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/RequestEnvelope.java @@ -40,7 +40,18 @@ public final class RequestEnvelope extends Envelope> { * @throws NullPointerException if success is null */ public void sendSuccess(final RequestSuccess success, final long executionTimeNanos) { - sendResponse(new SuccessEnvelope(success, getSessionId(), getTxSequence(), executionTimeNanos)); + sendResponse(newSuccessEnvelope(success, executionTimeNanos)); + } + + /** + * Creates a successful ResponseEnvelope that wraps the given successful Request response message. + * + * @param success the successful Request response message + * @param executionTimeNanos the execution time of the request + * @return a {@link ResponseEnvelope} instance + */ + public ResponseEnvelope newSuccessEnvelope(final RequestSuccess success, final long executionTimeNanos) { + return new SuccessEnvelope(success, getSessionId(), getTxSequence(), executionTimeNanos); } private void sendResponse(final ResponseEnvelope envelope) {