Improve error reporting for tell-based reads
[controller.git] / opendaylight / md-sal / cds-access-client / src / main / java / org / opendaylight / controller / cluster / access / client / ConnectingClientConnection.java
index 12c520bb17f2af39bbb845660eda161a03ba1585..10159901064c6578f3c530ff00d16aa051c9bb53 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.controller.cluster.access.client;
 
 import com.google.common.annotations.Beta;
 import java.util.Optional;
+import org.opendaylight.controller.cluster.access.concepts.RequestException;
 
 @Beta
 public final class ConnectingClientConnection<T extends BackendInfo> extends AbstractClientConnection<T> {
@@ -20,8 +21,8 @@ public final class ConnectingClientConnection<T extends BackendInfo> extends Abs
     private static final int TARGET_QUEUE_DEPTH = 4000;
 
     // Initial state, never instantiated externally
-    ConnectingClientConnection(final ClientActorContext context, final Long cookie) {
-        super(context, cookie, new TransmitQueue.Halted(TARGET_QUEUE_DEPTH));
+    ConnectingClientConnection(final ClientActorContext context, final Long cookie, final String backendName) {
+        super(context, cookie, backendName, TARGET_QUEUE_DEPTH);
     }
 
     @Override
@@ -30,7 +31,13 @@ public final class ConnectingClientConnection<T extends BackendInfo> extends Abs
     }
 
     @Override
-    ClientActorBehavior<T> lockedReconnect(final ClientActorBehavior<T> current) {
-        throw new UnsupportedOperationException("Attempted to reconnect a connecting connection");
+    long backendSilentTicks(final long now) {
+        // We are still connecting and do not want the timer to attempt a reconnect
+        return 0;
+    }
+
+    @Override
+    ClientActorBehavior<T> lockedReconnect(final ClientActorBehavior<T> current, final RequestException cause) {
+        throw new UnsupportedOperationException("Attempted to reconnect a connecting connection", cause);
     }
 }