Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.plugin.messaging.Messenger Interface Reference
Inheritance diagram for org.bukkit.plugin.messaging.Messenger:
org.bukkit.plugin.messaging.StandardMessenger

Public Member Functions

boolean isReservedChannel (String channel)
 
void registerOutgoingPluginChannel (Plugin plugin, String channel)
 
void unregisterOutgoingPluginChannel (Plugin plugin, String channel)
 
void unregisterOutgoingPluginChannel (Plugin plugin)
 
PluginMessageListenerRegistration registerIncomingPluginChannel (Plugin plugin, String channel, PluginMessageListener listener)
 
void unregisterIncomingPluginChannel (Plugin plugin, String channel, PluginMessageListener listener)
 
void unregisterIncomingPluginChannel (Plugin plugin, String channel)
 
void unregisterIncomingPluginChannel (Plugin plugin)
 
Set< String > getOutgoingChannels ()
 
Set< String > getOutgoingChannels (Plugin plugin)
 
Set< String > getIncomingChannels ()
 
Set< String > getIncomingChannels (Plugin plugin)
 
Set< PluginMessageListenerRegistrationgetIncomingChannelRegistrations (Plugin plugin)
 
Set< PluginMessageListenerRegistrationgetIncomingChannelRegistrations (String channel)
 
Set< PluginMessageListenerRegistrationgetIncomingChannelRegistrations (Plugin plugin, String channel)
 
boolean isRegistrationValid (PluginMessageListenerRegistration registration)
 
boolean isIncomingChannelRegistered (Plugin plugin, String channel)
 
boolean isOutgoingChannelRegistered (Plugin plugin, String channel)
 
void dispatchIncomingMessage (Player source, String channel, byte[] message)
 

Static Public Attributes

static final int MAX_MESSAGE_SIZE = 32766
 
static final int MAX_CHANNEL_SIZE = 16
 

Detailed Description

A class responsible for managing the registrations of plugin channels and their listeners.

Definition at line 11 of file Messenger.java.

Member Function Documentation

void org.bukkit.plugin.messaging.Messenger.dispatchIncomingMessage ( Player  source,
String  channel,
byte[]  message 
)

Dispatches the specified incoming message to any registered listeners.

Parameters
sourceSource of the message.
channelChannel that the message was sent by.
messageRaw payload of the message.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

Set<PluginMessageListenerRegistration> org.bukkit.plugin.messaging.Messenger.getIncomingChannelRegistrations ( Plugin  plugin)

Gets a set containing all the incoming plugin channel registrations that the specified plugin has.

Parameters
pluginPlugin to retrieve registrations for.
Returns
List of all registrations that the plugin has.
Exceptions
IllegalArgumentExceptionThrown if plugin is null.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

Set<PluginMessageListenerRegistration> org.bukkit.plugin.messaging.Messenger.getIncomingChannelRegistrations ( String  channel)

Gets a set containing all the incoming plugin channel registrations that are on the requested channel.

Parameters
channelChannel to retrieve registrations for.
Returns
List of all registrations that are on the channel.
Exceptions
IllegalArgumentExceptionThrown if channel is null.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

Set<PluginMessageListenerRegistration> org.bukkit.plugin.messaging.Messenger.getIncomingChannelRegistrations ( Plugin  plugin,
String  channel 
)

Gets a set containing all the incoming plugin channel registrations that the specified plugin has on the requested channel.

Parameters
pluginPlugin to retrieve registrations for.
channelChannel to filter registrations by.
Returns
List of all registrations that the plugin has.
Exceptions
IllegalArgumentExceptionThrown if plugin or channel is null.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

Set<String> org.bukkit.plugin.messaging.Messenger.getIncomingChannels ( )

Gets a set containing all the incoming plugin channels.

Returns
List of all registered incoming plugin channels.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

Set<String> org.bukkit.plugin.messaging.Messenger.getIncomingChannels ( Plugin  plugin)

Gets a set containing all the incoming plugin channels that the specified plugin is registered for.

Parameters
pluginPlugin to retrieve channels for.
Returns
List of all registered incoming plugin channels that the plugin is registered for.
Exceptions
IllegalArgumentExceptionThrown if plugin is null.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

Set<String> org.bukkit.plugin.messaging.Messenger.getOutgoingChannels ( )

Gets a set containing all the outgoing plugin channels.

Returns
List of all registered outgoing plugin channels.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

Set<String> org.bukkit.plugin.messaging.Messenger.getOutgoingChannels ( Plugin  plugin)

Gets a set containing all the outgoing plugin channels that the specified plugin is registered to.

Parameters
pluginPlugin to retrieve channels for.
Returns
List of all registered outgoing plugin channels that a plugin is registered to.
Exceptions
IllegalArgumentExceptionThrown if plugin is null.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

boolean org.bukkit.plugin.messaging.Messenger.isIncomingChannelRegistered ( Plugin  plugin,
String  channel 
)

Checks if the specified plugin has registered to receive incoming messages through the requested channel.

Parameters
pluginPlugin to check registration for.
channelChannel to test for.
Returns
True if the channel is registered, else false.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

boolean org.bukkit.plugin.messaging.Messenger.isOutgoingChannelRegistered ( Plugin  plugin,
String  channel 
)

Checks if the specified plugin has registered to send outgoing messages through the requested channel.

Parameters
pluginPlugin to check registration for.
channelChannel to test for.
Returns
True if the channel is registered, else false.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

Referenced by org.bukkit.plugin.messaging.StandardMessenger.validatePluginMessage().

boolean org.bukkit.plugin.messaging.Messenger.isRegistrationValid ( PluginMessageListenerRegistration  registration)

Checks if the specified plugin message listener registration is valid.

A registration is considered valid if it has not be unregistered and that the plugin is still enabled.

Parameters
registrationRegistration to check.
Returns
True if the registration is valid, otherwise false.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

Referenced by org.bukkit.plugin.messaging.PluginMessageListenerRegistration.isValid().

boolean org.bukkit.plugin.messaging.Messenger.isReservedChannel ( String  channel)

Checks if the specified channel is a reserved name.

Parameters
channelChannel name to check.
Returns
True if the channel is reserved, otherwise false.
Exceptions
IllegalArgumentExceptionThrown if channel is null.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

PluginMessageListenerRegistration org.bukkit.plugin.messaging.Messenger.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.

Parameters
pluginPlugin that wishes to register to this channel.
channelChannel to register.
listenerListener to receive messages on.
Returns
The resulting registration that was made as a result of this method.
Exceptions
IllegalArgumentExceptionThrown if plugin, channel or listener is null, or the listener is already registered for this channel.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

void org.bukkit.plugin.messaging.Messenger.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.

Parameters
pluginPlugin that wishes to send messages through the channel.
channelChannel to register.
Exceptions
IllegalArgumentExceptionThrown if plugin or channel is null.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

void org.bukkit.plugin.messaging.Messenger.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.

Parameters
pluginPlugin that wishes to unregister from this channel.
channelChannel to unregister.
listenerListener to stop receiving messages on.
Exceptions
IllegalArgumentExceptionThrown if plugin, channel or listener is null.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

void org.bukkit.plugin.messaging.Messenger.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.

Parameters
pluginPlugin that wishes to unregister from this channel.
channelChannel to unregister.
Exceptions
IllegalArgumentExceptionThrown if plugin or channel is null.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

void org.bukkit.plugin.messaging.Messenger.unregisterIncomingPluginChannel ( Plugin  plugin)

Unregisters the specific plugin from listening on all plugin channels through all listeners.

Parameters
pluginPlugin that wishes to unregister from this channel.
Exceptions
IllegalArgumentExceptionThrown if plugin is null.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

void org.bukkit.plugin.messaging.Messenger.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.

Parameters
pluginPlugin that no longer wishes to send messages through the channel.
channelChannel to unregister.
Exceptions
IllegalArgumentExceptionThrown if plugin or channel is null.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

void org.bukkit.plugin.messaging.Messenger.unregisterOutgoingPluginChannel ( Plugin  plugin)

Unregisters the specific plugin from all outgoing plugin channels, no longer allowing it to send any plugin messages.

Parameters
pluginPlugin that no longer wishes to send plugin messages.
Exceptions
IllegalArgumentExceptionThrown if plugin is null.

Implemented in org.bukkit.plugin.messaging.StandardMessenger.

Member Data Documentation

final int org.bukkit.plugin.messaging.Messenger.MAX_CHANNEL_SIZE = 16
static

Represents the largest size that a Plugin Channel may be.

Definition at line 21 of file Messenger.java.

Referenced by org.bukkit.plugin.messaging.StandardMessenger.validateChannel().

final int org.bukkit.plugin.messaging.Messenger.MAX_MESSAGE_SIZE = 32766
static

Represents the largest size that an individual Plugin Message may be.

Definition at line 16 of file Messenger.java.

Referenced by org.bukkit.plugin.messaging.StandardMessenger.validatePluginMessage().


The documentation for this interface was generated from the following file: