Interface CloudMessenger


  • public interface CloudMessenger
    A messenger to communicate between services in CloudNet.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void sendChannelMessage​(@NotNull ServiceEnvironmentType targetEnvironment, @NotNull java.lang.String channel, @NotNull java.lang.String message, @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument data)
      Sends a channel message to all services of a specific environment in the cluster.
      void sendChannelMessage​(@NotNull ServiceInfoSnapshot targetServiceInfoSnapshot, @NotNull java.lang.String channel, @NotNull java.lang.String message, @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument data)
      Sends a channel message to a specific service in the cluster.
      void sendChannelMessage​(@NotNull ServiceTask targetServiceTask, @NotNull java.lang.String channel, @NotNull java.lang.String message, @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument data)
      Sends a channel message to all services of a specific task in the cluster.
      void sendChannelMessage​(@NotNull java.lang.String channel, @NotNull java.lang.String message, @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument data)
      Sends a channel message to all services in the cluster.
    • Method Detail

      • sendChannelMessage

        void sendChannelMessage​(@NotNull
                                @NotNull java.lang.String channel,
                                @NotNull
                                @NotNull java.lang.String message,
                                @NotNull
                                @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument data)
        Sends a channel message to all services in the cluster. It can be received with the ChannelMessageReceiveEvent.
        Parameters:
        channel - the channel to identify the message, this can be anything and doesn't have to be registered
        message - the message to identify the message, this can be anything and doesn't have to be registered
        data - extra data for the message
      • sendChannelMessage

        void sendChannelMessage​(@NotNull
                                @NotNull ServiceInfoSnapshot targetServiceInfoSnapshot,
                                @NotNull
                                @NotNull java.lang.String channel,
                                @NotNull
                                @NotNull java.lang.String message,
                                @NotNull
                                @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument data)
        Sends a channel message to a specific service in the cluster. It can be received with the ChannelMessageReceiveEvent.
        Parameters:
        targetServiceInfoSnapshot - the info of the service which will receive the message
        channel - the channel to identify the message, this can be anything and doesn't have to be registered
        message - the message to identify the message, this can be anything and doesn't have to be registered
        data - extra data for the message
      • sendChannelMessage

        void sendChannelMessage​(@NotNull
                                @NotNull ServiceTask targetServiceTask,
                                @NotNull
                                @NotNull java.lang.String channel,
                                @NotNull
                                @NotNull java.lang.String message,
                                @NotNull
                                @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument data)
        Sends a channel message to all services of a specific task in the cluster. It can be received with the ChannelMessageReceiveEvent.
        Parameters:
        targetServiceTask - the task which will receive the message
        channel - the channel to identify the message, this can be anything and doesn't have to be registered
        message - the message to identify the message, this can be anything and doesn't have to be registered
        data - extra data for the message
      • sendChannelMessage

        void sendChannelMessage​(@NotNull
                                @NotNull ServiceEnvironmentType targetEnvironment,
                                @NotNull
                                @NotNull java.lang.String channel,
                                @NotNull
                                @NotNull java.lang.String message,
                                @NotNull
                                @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument data)
        Sends a channel message to all services of a specific environment in the cluster. It can be received with the ChannelMessageReceiveEvent.
        Parameters:
        targetEnvironment - the environment which will receive the message
        channel - the channel to identify the message, this can be anything and doesn't have to be registered
        message - the message to identify the message, this can be anything and doesn't have to be registered
        data - extra data for the message