Class ChannelMessageTarget

java.lang.Object
eu.cloudnetservice.driver.channel.ChannelMessageTarget

public final class ChannelMessageTarget extends Object
Represents a receiver of a channel message. A channel message can be sent to a variety of receiver types including:
  • ALL: includes all network components which are within the network
  • NODE: includes all nodes which are within the network
  • SERVICE: includes all services which are within the network
  • TASK: includes all services of the given task
  • GROUP: includes all services which are in the given group
  • ENVIRONMENT: includes all services which are using the given environment. See environment(ServiceEnvironmentType)

A channel message target can optionally take a name of the target. If no name is provided its interpreted as "all components of the given type". It is illegal to create a target with no name given for the types ChannelMessageTarget.Type.TASK and ChannelMessageTarget.Type.GROUP. However, a creation of these types in combination with null as the name is a valid operation and will not fail.

Note: Types are not overriding meaning that setting a target for all services and (for example) specifically the service Abc-1 is valid and will cause the service to receive the channel message twice.

Do not extend this class to get access to it's constructors, use of(Type, String) or for targeting a specific environment environment(ServiceEnvironmentType) instead.

Since:
4.0
See Also: