Class ClusterCommunicationManager

  • All Implemented Interfaces:
    org.onosproject.store.cluster.messaging.ClusterCommunicationService

    public class ClusterCommunicationManager
    extends java.lang.Object
    implements org.onosproject.store.cluster.messaging.ClusterCommunicationService
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.onosproject.cluster.ClusterService clusterService  
      protected org.onosproject.store.cluster.messaging.MessagingService messagingService  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void activate()  
      <M> void addSubscriber​(org.onosproject.store.cluster.messaging.MessageSubject subject, java.util.function.Function<byte[],​M> decoder, java.util.function.Consumer<M> handler, java.util.concurrent.Executor executor)  
      <M,​R>
      void
      addSubscriber​(org.onosproject.store.cluster.messaging.MessageSubject subject, java.util.function.Function<byte[],​M> decoder, java.util.function.Function<M,​java.util.concurrent.CompletableFuture<R>> handler, java.util.function.Function<R,​byte[]> encoder)  
      <M,​R>
      void
      addSubscriber​(org.onosproject.store.cluster.messaging.MessageSubject subject, java.util.function.Function<byte[],​M> decoder, java.util.function.Function<M,​R> handler, java.util.function.Function<R,​byte[]> encoder, java.util.concurrent.Executor executor)  
      void addSubscriber​(org.onosproject.store.cluster.messaging.MessageSubject subject, org.onosproject.store.cluster.messaging.ClusterMessageHandler subscriber, java.util.concurrent.ExecutorService executor)  
      <M> void broadcast​(M message, org.onosproject.store.cluster.messaging.MessageSubject subject, java.util.function.Function<M,​byte[]> encoder)  
      <M> void broadcastIncludeSelf​(M message, org.onosproject.store.cluster.messaging.MessageSubject subject, java.util.function.Function<M,​byte[]> encoder)  
      void deactivate()  
      <M> void multicast​(M message, org.onosproject.store.cluster.messaging.MessageSubject subject, java.util.function.Function<M,​byte[]> encoder, java.util.Set<org.onosproject.cluster.NodeId> nodes)  
      void removeSubscriber​(org.onosproject.store.cluster.messaging.MessageSubject subject)  
      <M,​R>
      java.util.concurrent.CompletableFuture<R>
      sendAndReceive​(M message, org.onosproject.store.cluster.messaging.MessageSubject subject, java.util.function.Function<M,​byte[]> encoder, java.util.function.Function<byte[],​R> decoder, org.onosproject.cluster.NodeId toNodeId, java.time.Duration timeout)  
      <M> java.util.concurrent.CompletableFuture<java.lang.Void> unicast​(M message, org.onosproject.store.cluster.messaging.MessageSubject subject, java.util.function.Function<M,​byte[]> encoder, org.onosproject.cluster.NodeId toNodeId)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.onosproject.store.cluster.messaging.ClusterCommunicationService

        sendAndReceive
    • Field Detail

      • clusterService

        protected org.onosproject.cluster.ClusterService clusterService
      • messagingService

        protected org.onosproject.store.cluster.messaging.MessagingService messagingService
    • Constructor Detail

      • ClusterCommunicationManager

        public ClusterCommunicationManager()
    • Method Detail

      • activate

        public void activate()
      • deactivate

        public void deactivate()
      • broadcast

        public <M> void broadcast​(M message,
                                  org.onosproject.store.cluster.messaging.MessageSubject subject,
                                  java.util.function.Function<M,​byte[]> encoder)
        Specified by:
        broadcast in interface org.onosproject.store.cluster.messaging.ClusterCommunicationService
      • broadcastIncludeSelf

        public <M> void broadcastIncludeSelf​(M message,
                                             org.onosproject.store.cluster.messaging.MessageSubject subject,
                                             java.util.function.Function<M,​byte[]> encoder)
        Specified by:
        broadcastIncludeSelf in interface org.onosproject.store.cluster.messaging.ClusterCommunicationService
      • unicast

        public <M> java.util.concurrent.CompletableFuture<java.lang.Void> unicast​(M message,
                                                                                  org.onosproject.store.cluster.messaging.MessageSubject subject,
                                                                                  java.util.function.Function<M,​byte[]> encoder,
                                                                                  org.onosproject.cluster.NodeId toNodeId)
        Specified by:
        unicast in interface org.onosproject.store.cluster.messaging.ClusterCommunicationService
      • multicast

        public <M> void multicast​(M message,
                                  org.onosproject.store.cluster.messaging.MessageSubject subject,
                                  java.util.function.Function<M,​byte[]> encoder,
                                  java.util.Set<org.onosproject.cluster.NodeId> nodes)
        Specified by:
        multicast in interface org.onosproject.store.cluster.messaging.ClusterCommunicationService
      • sendAndReceive

        public <M,​R> java.util.concurrent.CompletableFuture<R> sendAndReceive​(M message,
                                                                                    org.onosproject.store.cluster.messaging.MessageSubject subject,
                                                                                    java.util.function.Function<M,​byte[]> encoder,
                                                                                    java.util.function.Function<byte[],​R> decoder,
                                                                                    org.onosproject.cluster.NodeId toNodeId,
                                                                                    java.time.Duration timeout)
        Specified by:
        sendAndReceive in interface org.onosproject.store.cluster.messaging.ClusterCommunicationService
      • addSubscriber

        public void addSubscriber​(org.onosproject.store.cluster.messaging.MessageSubject subject,
                                  org.onosproject.store.cluster.messaging.ClusterMessageHandler subscriber,
                                  java.util.concurrent.ExecutorService executor)
        Specified by:
        addSubscriber in interface org.onosproject.store.cluster.messaging.ClusterCommunicationService
      • removeSubscriber

        public void removeSubscriber​(org.onosproject.store.cluster.messaging.MessageSubject subject)
        Specified by:
        removeSubscriber in interface org.onosproject.store.cluster.messaging.ClusterCommunicationService
      • addSubscriber

        public <M,​R> void addSubscriber​(org.onosproject.store.cluster.messaging.MessageSubject subject,
                                              java.util.function.Function<byte[],​M> decoder,
                                              java.util.function.Function<M,​R> handler,
                                              java.util.function.Function<R,​byte[]> encoder,
                                              java.util.concurrent.Executor executor)
        Specified by:
        addSubscriber in interface org.onosproject.store.cluster.messaging.ClusterCommunicationService
      • addSubscriber

        public <M,​R> void addSubscriber​(org.onosproject.store.cluster.messaging.MessageSubject subject,
                                              java.util.function.Function<byte[],​M> decoder,
                                              java.util.function.Function<M,​java.util.concurrent.CompletableFuture<R>> handler,
                                              java.util.function.Function<R,​byte[]> encoder)
        Specified by:
        addSubscriber in interface org.onosproject.store.cluster.messaging.ClusterCommunicationService
      • addSubscriber

        public <M> void addSubscriber​(org.onosproject.store.cluster.messaging.MessageSubject subject,
                                      java.util.function.Function<byte[],​M> decoder,
                                      java.util.function.Consumer<M> handler,
                                      java.util.concurrent.Executor executor)
        Specified by:
        addSubscriber in interface org.onosproject.store.cluster.messaging.ClusterCommunicationService