Bug 7449: Slice ReadTransactionSuccess response
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / concepts / RequestEnvelope.java
index cb9034d32483f086a97fc4b1324dcb71856abc27..46d5d1f99620b83304b49e7d160a6648768dce65 100644 (file)
@@ -40,7 +40,18 @@ public final class RequestEnvelope extends Envelope<Request<?, ?>> {
      * @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) {