Class ClusterCommunicationManager

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

    public class ClusterCommunicationManager
    extends Object
    implements org.onosproject.store.cluster.messaging.ClusterCommunicationService
    • 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,
                                  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,
                                             Function<M,​byte[]> encoder)
        Specified by:
        broadcastIncludeSelf in interface org.onosproject.store.cluster.messaging.ClusterCommunicationService
      • unicast

        public <M> CompletableFuture<Void> unicast​(M message,
                                                   org.onosproject.store.cluster.messaging.MessageSubject subject,
                                                   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,
                                  Function<M,​byte[]> encoder,
                                  Set<org.onosproject.cluster.NodeId> nodes)
        Specified by:
        multicast in interface org.onosproject.store.cluster.messaging.ClusterCommunicationService
      • sendAndReceive

        public <M,​R> CompletableFuture<R> sendAndReceive​(M message,
                                                               org.onosproject.store.cluster.messaging.MessageSubject subject,
                                                               Function<M,​byte[]> encoder,
                                                               Function<byte[],​R> decoder,
                                                               org.onosproject.cluster.NodeId toNodeId,
                                                               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,
                                  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,
                                              Function<byte[],​M> decoder,
                                              Function<M,​R> handler,
                                              Function<R,​byte[]> encoder,
                                              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,
                                              Function<byte[],​M> decoder,
                                              Function<M,​CompletableFuture<R>> handler,
                                              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,
                                      Function<byte[],​M> decoder,
                                      Consumer<M> handler,
                                      Executor executor)
        Specified by:
        addSubscriber in interface org.onosproject.store.cluster.messaging.ClusterCommunicationService