MAX_CHANNEL_SIZE, MAX_MESSAGE_SIZE| Constructor and Description | 
|---|
| StandardMessenger() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | dispatchIncomingMessage(Player source,
                       String channel,
                       byte[] message)Dispatches the specified incoming message to any registered listeners. | 
| Set<PluginMessageListenerRegistration> | getIncomingChannelRegistrations(Plugin plugin)Gets a set containing all the incoming plugin channel registrations
 that the specified plugin has. | 
| Set<PluginMessageListenerRegistration> | getIncomingChannelRegistrations(Plugin plugin,
                               String channel)Gets a set containing all the incoming plugin channel registrations
 that the specified plugin has on the requested channel. | 
| Set<PluginMessageListenerRegistration> | getIncomingChannelRegistrations(String channel)Gets a set containing all the incoming plugin channel registrations
 that are on the requested channel. | 
| Set<String> | getIncomingChannels()Gets a set containing all the incoming plugin channels. | 
| Set<String> | getIncomingChannels(Plugin plugin)Gets a set containing all the incoming plugin channels that the
 specified plugin is registered for. | 
| Set<String> | getOutgoingChannels()Gets a set containing all the outgoing plugin channels. | 
| Set<String> | getOutgoingChannels(Plugin plugin)Gets a set containing all the outgoing plugin channels that the
 specified plugin is registered to. | 
| boolean | isIncomingChannelRegistered(Plugin plugin,
                           String channel)Checks if the specified plugin has registered to receive incoming
 messages through the requested channel. | 
| boolean | isOutgoingChannelRegistered(Plugin plugin,
                           String channel)Checks if the specified plugin has registered to send outgoing messages
 through the requested channel. | 
| boolean | isRegistrationValid(PluginMessageListenerRegistration registration)Checks if the specified plugin message listener registration is valid. | 
| boolean | isReservedChannel(String channel)Checks if the specified channel is a reserved name. | 
| PluginMessageListenerRegistration | registerIncomingPluginChannel(Plugin plugin,
                             String channel,
                             PluginMessageListener listener)Registers the specific plugin for listening on the requested incoming
 plugin channel, allowing it to act upon any plugin messages. | 
| void | registerOutgoingPluginChannel(Plugin plugin,
                             String channel)Registers the specific plugin to the requested outgoing plugin channel,
 allowing it to send messages through that channel to any clients. | 
| void | unregisterIncomingPluginChannel(Plugin plugin)Unregisters the specific plugin from listening on all plugin channels
 through all listeners. | 
| void | unregisterIncomingPluginChannel(Plugin plugin,
                               String channel)Unregisters the specific plugin from listening on the requested
 incoming plugin channel, no longer allowing it to act upon any plugin
 messages. | 
| void | unregisterIncomingPluginChannel(Plugin plugin,
                               String channel,
                               PluginMessageListener listener)Unregisters the specific plugin's listener from listening on the
 requested incoming plugin channel, no longer allowing it to act upon
 any plugin messages. | 
| void | unregisterOutgoingPluginChannel(Plugin plugin)Unregisters the specific plugin from all outgoing plugin channels, no
 longer allowing it to send any plugin messages. | 
| void | unregisterOutgoingPluginChannel(Plugin plugin,
                               String channel)Unregisters the specific plugin from the requested outgoing plugin
 channel, no longer allowing it to send messages through that channel to
 any clients. | 
| static void | validateChannel(String channel)Validates a Plugin Channel name. | 
| static void | validatePluginMessage(Messenger messenger,
                     Plugin source,
                     String channel,
                     byte[] message)Validates the input of a Plugin Message, ensuring the arguments are all
 valid. | 
public boolean isReservedChannel(String channel)
MessengerisReservedChannel in interface Messengerchannel - Channel name to check.public void registerOutgoingPluginChannel(Plugin plugin, String channel)
MessengerregisterOutgoingPluginChannel in interface Messengerplugin - Plugin that wishes to send messages through the channel.channel - Channel to register.public void unregisterOutgoingPluginChannel(Plugin plugin, String channel)
MessengerunregisterOutgoingPluginChannel in interface Messengerplugin - Plugin that no longer wishes to send messages through the
     channel.channel - Channel to unregister.public void unregisterOutgoingPluginChannel(Plugin plugin)
MessengerunregisterOutgoingPluginChannel in interface Messengerplugin - Plugin that no longer wishes to send plugin messages.public PluginMessageListenerRegistration registerIncomingPluginChannel(Plugin plugin, String channel, PluginMessageListener listener)
MessengerregisterIncomingPluginChannel in interface Messengerplugin - Plugin that wishes to register to this channel.channel - Channel to register.listener - Listener to receive messages on.public void unregisterIncomingPluginChannel(Plugin plugin, String channel, PluginMessageListener listener)
MessengerunregisterIncomingPluginChannel in interface Messengerplugin - Plugin that wishes to unregister from this channel.channel - Channel to unregister.listener - Listener to stop receiving messages on.public void unregisterIncomingPluginChannel(Plugin plugin, String channel)
MessengerunregisterIncomingPluginChannel in interface Messengerplugin - Plugin that wishes to unregister from this channel.channel - Channel to unregister.public void unregisterIncomingPluginChannel(Plugin plugin)
MessengerunregisterIncomingPluginChannel in interface Messengerplugin - Plugin that wishes to unregister from this channel.public Set<String> getOutgoingChannels()
MessengergetOutgoingChannels in interface Messengerpublic Set<String> getOutgoingChannels(Plugin plugin)
MessengergetOutgoingChannels in interface Messengerplugin - Plugin to retrieve channels for.public Set<String> getIncomingChannels()
MessengergetIncomingChannels in interface Messengerpublic Set<String> getIncomingChannels(Plugin plugin)
MessengergetIncomingChannels in interface Messengerplugin - Plugin to retrieve channels for.public Set<PluginMessageListenerRegistration> getIncomingChannelRegistrations(Plugin plugin)
MessengergetIncomingChannelRegistrations in interface Messengerplugin - Plugin to retrieve registrations for.public Set<PluginMessageListenerRegistration> getIncomingChannelRegistrations(String channel)
MessengergetIncomingChannelRegistrations in interface Messengerchannel - Channel to retrieve registrations for.public Set<PluginMessageListenerRegistration> getIncomingChannelRegistrations(Plugin plugin, String channel)
MessengergetIncomingChannelRegistrations in interface Messengerplugin - Plugin to retrieve registrations for.channel - Channel to filter registrations by.public boolean isRegistrationValid(PluginMessageListenerRegistration registration)
MessengerA registration is considered valid if it has not be unregistered and that the plugin is still enabled.
isRegistrationValid in interface Messengerregistration - Registration to check.public boolean isIncomingChannelRegistered(Plugin plugin, String channel)
MessengerisIncomingChannelRegistered in interface Messengerplugin - Plugin to check registration for.channel - Channel to test for.public boolean isOutgoingChannelRegistered(Plugin plugin, String channel)
MessengerisOutgoingChannelRegistered in interface Messengerplugin - Plugin to check registration for.channel - Channel to test for.public void dispatchIncomingMessage(Player source, String channel, byte[] message)
MessengerdispatchIncomingMessage in interface Messengersource - Source of the message.channel - Channel that the message was sent by.message - Raw payload of the message.public static void validateChannel(String channel)
channel - Channel name to validate.public static void validatePluginMessage(Messenger messenger, Plugin source, String channel, byte[] message)
messenger - Messenger to use for validation.source - Source plugin of the Message.channel - Plugin Channel to send the message by.message - Raw message payload to send.IllegalArgumentException - Thrown if the source plugin is
     disabled.IllegalArgumentException - Thrown if source, channel or message
     is null.MessageTooLargeException - Thrown if the message is too big.ChannelNameTooLongException - Thrown if the channel name is too
     long.ChannelNotRegisteredException - Thrown if the channel is not
     registered for this plugin.Copyright © 2016. All rights reserved.