Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.plugin.messaging.Messenger Interface Reference

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

+ Inheritance diagram for org.bukkit.plugin.messaging.Messenger:

Public Member Functions

boolean isReservedChannel (String channel)
 Checks if the specified channel is a reserved name.
 
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 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.
 
void unregisterOutgoingPluginChannel (Plugin plugin)
 Unregisters the specific plugin from all outgoing plugin channels, no longer allowing it to send any plugin messages.
 
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 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 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)
 Unregisters the specific plugin from listening on all plugin channels through all listeners.
 
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.
 
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
< PluginMessageListenerRegistration
getIncomingChannelRegistrations (Plugin plugin)
 Gets a set containing all the incoming plugin channel registrations that the specified plugin has.
 
Set
< PluginMessageListenerRegistration
getIncomingChannelRegistrations (String channel)
 Gets a set containing all the incoming plugin channel registrations that are on the requested channel.
 
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.
 
boolean isRegistrationValid (PluginMessageListenerRegistration registration)
 Checks if the specified plugin message listener registration is valid.
 
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.
 
void dispatchIncomingMessage (Player source, String channel, byte[] message)
 Dispatches the specified incoming message to any registered listeners.
 

Static Public Attributes

static final int MAX_MESSAGE_SIZE = 32766
 Represents the largest size that an individual Plugin Message may be.
 
static final int MAX_CHANNEL_SIZE = 16
 Represents the largest size that a Plugin Channel may be.
 

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.

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.

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.
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.
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.
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.

Referenced by org.bukkit.plugin.SimplePluginManager.disablePlugin().

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.
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.
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.

Referenced by org.bukkit.plugin.SimplePluginManager.disablePlugin().

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.

Member Data Documentation

final int org.bukkit.plugin.messaging.Messenger.MAX_CHANNEL_SIZE = 16
static
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 15 of file Messenger.java.

Referenced by org.bukkit.plugin.messaging.MessageTooLargeException.MessageTooLargeException(), and org.bukkit.plugin.messaging.StandardMessenger.validatePluginMessage().


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