Class AdHocCommandManager
java.lang.Object
org.jivesoftware.openfire.commands.AdHocCommandManager
An AdHocCommandManager is responsible for keeping the list of available commands offered
by a service and for processing commands requests. Typically, instances of this class
are private to the service offering ad-hoc commands.
- Author:
- Gaston Dombiak
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SystemProperty<Integer>The maximum allowed simultaneous command sessions per user.static final SystemProperty<Duration>The maximum allowed duration of a command session (all stages of a command need to have provided by the user within this time). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommand(AdHocCommand command) Adds a new command to the list of supported ad-hoc commands by this server.getCommand(String code) Returns the command whose code matches the specified code ornullif none was found.Returns a list with the available commands in this command manager.org.xmpp.packet.IQprocess(org.xmpp.packet.IQ packet) booleanremoveCommand(AdHocCommand command) Removes the command from the list of ad-hoc commands supported by this server.voidstop()
-
Field Details
-
COMMAND_LIMIT
The maximum allowed simultaneous command sessions per user. -
COMMAND_TIMEOUT
The maximum allowed duration of a command session (all stages of a command need to have provided by the user within this time).
-
-
Constructor Details
-
AdHocCommandManager
public AdHocCommandManager()
-
-
Method Details
-
addCommand
Adds a new command to the list of supported ad-hoc commands by this server. The new command will appear in the discoverable items list and will be executed for those users with enough permission.- Parameters:
command- the new ad-hoc command to add.
-
removeCommand
Removes the command from the list of ad-hoc commands supported by this server. The command will no longer appear in the discoverable items list.- Parameters:
command- the ad-hoc command to remove.- Returns:
- true if the requested command was removed from the list of available commands.
-
getCommands
Returns a list with the available commands in this command manager.- Returns:
- a list with the available commands in this command manager.
-
getCommand
Returns the command whose code matches the specified code ornullif none was found.- Parameters:
code- the code of the command to find.- Returns:
- the command whose code matches the specified code or null if none was found.
-
process
public org.xmpp.packet.IQ process(org.xmpp.packet.IQ packet) -
stop
public void stop()
-