Class Target
java.lang.Object
dev.ua.theroer.magicutils.messaging.Target
Addressing hint describing which network members should receive a message.
Targets are transport-agnostic. The default plugin-messaging transport and
the Redis transport interpret each Target.Kind on a best-effort basis; where a
transport cannot honour a target precisely it falls back to a broadcast and
lets receivers filter by serverName() / playerId().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumClassifies the intended recipients of a message. -
Method Summary
Modifier and TypeMethodDescriptionstatic TargetA message for every backend server, excluding the proxy.static TargetA message for every subscriber on the channel, on every member.booleaninthashCode()kind()Returns the target kind.static TargetA message for whichever backend currently hosts the given player.@Nullable UUIDplayerId()Returns the destination player id forTarget.Kind.PLAYER.static Targetproxy()A message for the proxy only.static TargetA message for a single backend server by its registered name.@Nullable StringReturns the destination server name forTarget.Kind.SERVER.toString()
-
Method Details
-
broadcast
A message for every subscriber on the channel, on every member.- Returns:
- broadcast target
-
allBackends
A message for every backend server, excluding the proxy.- Returns:
- all-backends target
-
proxy
-
server
-
player
-
kind
-
serverName
Returns the destination server name forTarget.Kind.SERVER.- Returns:
- server name, or null for other kinds
-
playerId
Returns the destination player id forTarget.Kind.PLAYER.- Returns:
- player id, or null for other kinds
-
equals
-
hashCode
-
toString
-