BUG-5280: refactor AbstractClientConnection
[controller.git] / opendaylight / md-sal / cds-access-client / src / main / java / org / opendaylight / controller / cluster / access / client / ReconnectingClientConnection.java
index 0209f95bce2d8d7676b4ae09330c6e355e5e04dd..e15a949600f4f932c96fc83e1d77a5eb296de1c6 100644 (file)
@@ -7,6 +7,10 @@
  */
 package org.opendaylight.controller.cluster.access.client;
 
+import akka.actor.ActorRef;
+import java.util.Map.Entry;
+import org.opendaylight.controller.cluster.access.concepts.Request;
+import org.opendaylight.controller.cluster.access.concepts.RequestEnvelope;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -24,15 +28,21 @@ public final class ReconnectingClientConnection<T extends BackendInfo> extends A
         super(oldConnection);
     }
 
-    @Override
-    void sendMessages(final int count) {
-        LOG.debug("Connection {} is reconnecting, not transmitting anything", this);
-    }
-
     @Override
     ClientActorBehavior<T> reconnectConnection(final ClientActorBehavior<T> current) {
         // Intentional no-op
         LOG.debug("Skipping reconnect of already-reconnecting connection {}", this);
         return current;
     }
+
+    @Override
+    Entry<ActorRef, RequestEnvelope> prepareForTransmit(final Request<?, ?> req) {
+        // This is guarded by remoteMaxMessages() == 0
+        throw new UnsupportedOperationException("Attempted to transmit on a reconnecting connection");
+    }
+
+    @Override
+    int remoteMaxMessages() {
+        return 0;
+    }
 }