Interface CloudMessenger
-
public interface CloudMessengerA messenger to communicate between services in CloudNet.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidsendChannelMessage(@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.voidsendChannelMessage(@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.voidsendChannelMessage(@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.voidsendChannelMessage(@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 theChannelMessageReceiveEvent.- Parameters:
channel- the channel to identify the message, this can be anything and doesn't have to be registeredmessage- the message to identify the message, this can be anything and doesn't have to be registereddata- 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 theChannelMessageReceiveEvent.- Parameters:
targetServiceInfoSnapshot- the info of the service which will receive the messagechannel- the channel to identify the message, this can be anything and doesn't have to be registeredmessage- the message to identify the message, this can be anything and doesn't have to be registereddata- 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 theChannelMessageReceiveEvent.- Parameters:
targetServiceTask- the task which will receive the messagechannel- the channel to identify the message, this can be anything and doesn't have to be registeredmessage- the message to identify the message, this can be anything and doesn't have to be registereddata- 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 theChannelMessageReceiveEvent.- Parameters:
targetEnvironment- the environment which will receive the messagechannel- the channel to identify the message, this can be anything and doesn't have to be registeredmessage- the message to identify the message, this can be anything and doesn't have to be registereddata- extra data for the message
-
-