Migrate users of Optional.get()
[controller.git] / opendaylight / md-sal / cds-access-client / src / main / java / org / opendaylight / controller / cluster / access / client / ConnectingClientConnection.java
index aa986873d57e03f841e27986d24f57fa5e9cf402..445321b474cd725a03e3e41bf6dd688786e9de42 100644 (file)
@@ -7,10 +7,9 @@
  */
 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> {
     /**
      * A wild estimate on how deep a queue should be. Without having knowledge of the remote actor we can only
@@ -20,8 +19,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 +29,13 @@ public final class ConnectingClientConnection<T extends BackendInfo> extends Abs
     }
 
     @Override
-    ClientActorBehavior<T> reconnectConnection(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);
     }
 }