Package com.tenio.core.command.client
Class ClientCommandManager
java.lang.Object
com.tenio.common.logger.AbstractLogger
com.tenio.common.logger.SystemLogger
com.tenio.core.command.client.ClientCommandManager
The commands' management class.
- Since:
- 0.5.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears all the list of commands.getHandler(Short code) Returns a handler by its codeRetrieves a map of all registered commands.Returns a list of all registered commands.voidInvokes a command handler with given arguments.voidregisterCommand(Short code, AbstractClientCommandHandler command) Registers a command handler.voidunregisterCommand(Short code) Removes a registered command handler.Methods inherited from class com.tenio.common.logger.SystemLogger
debug, debugEvent, isDebugEnabled, isTraceEnabled, trace, traceMethods inherited from class com.tenio.common.logger.AbstractLogger
buildgen, error, error, error, info, info, info, info, info, info, info, info, isErrorEnabled, isInfoEnabled
-
Constructor Details
-
ClientCommandManager
public ClientCommandManager()
-
-
Method Details
-
registerCommand
Registers a command handler.- Parameters:
code- The command codecommand- The command handler
-
unregisterCommand
Removes a registered command handler.- Parameters:
code- The command code
-
getHandlersAsList
Returns a list of all registered commands.- Returns:
- all command handlers as a list
-
getHandlers
Retrieves a map of all registered commands.- Returns:
- a
Mapof all registered commands
-
getHandler
Returns a handler by its code- Parameters:
code- The command code- Returns:
- the command handler
-
invoke
Invokes a command handler with given arguments.- Parameters:
code- The messaged used to invoke the commandplayer- The receiver which gets command from its clientmessage- The message as command
-
clear
public void clear()Clears all the list of commands.
-