Enum Class SystemChannel

java.lang.Object
java.lang.Enum<SystemChannel>
me.internalizable.numdrassl.api.messaging.channel.SystemChannel
All Implemented Interfaces:
Serializable, Comparable<SystemChannel>, Constable

public enum SystemChannel extends Enum<SystemChannel>
Predefined system channels for cross-proxy messaging.

These channels are built into Numdrassl and are used for core functionality. Plugins can subscribe to these channels to receive system-level messages.

Usage with @MessageSubscribe

@MessageSubscribe(SystemChannel.HEARTBEAT)
public void onHeartbeat(HeartbeatMessage msg) {
    logger.info("Proxy {} is alive", msg.sourceProxyId());
}

@MessageSubscribe(SystemChannel.CHAT)
public void onChat(ChatMessage msg) {
    if (msg.isBroadcast()) {
        broadcastToAll(msg.message());
    }
}
See Also:
  • Enum Constant Details

  • Method Details

    • values

      public static SystemChannel[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SystemChannel valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getChannelId

      @Nonnull public String getChannelId()
      Get the channel ID.
      Returns:
      the full channel ID (e.g., "numdrassl:heartbeat")
    • toMessageChannel

      @Nullable public MessageChannel toMessageChannel()
      Get the corresponding MessageChannel instance.

      For NONE, this method returns null.

      For all other system channels, this method is guaranteed to return a non-null MessageChannel because system channels are pre-registered in Channels during class initialization.

      Returns:
      the MessageChannel, or null if this is NONE