Package com.swiftmq.mgmt
Class Command
java.lang.Object
com.swiftmq.mgmt.Command
- All Implemented Interfaces:
Dumpable
A Command object. Commands are
registered at a CommandRegistry, attach to Entities and EntityLists, and
performed by CLI and SwiftMQ Explorer. The acutal command action is performed
through a CommandExecutor, attached to the Command object.
- Author:
- IIT GmbH, Bremen/Germany, Copyright (c) 2000-2002, All Rights Reserved
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCommand
(String name, String pattern, String description, boolean enabled, CommandExecutor commandExecutor) Create a new Command.Command
(String name, String pattern, String description, boolean enabled, CommandExecutor commandExecutor, boolean guiEnabled, boolean guiForChild) Create a new Command. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares this command's tokenized command with another one.Returns the command executor.Retuns the description.int
Returns a unique dump id for this object.getName()
Returns the name.Returns the parent entity.Returns the pattern.String[]
Returns the tokenized name.boolean
Returns the enabled state.boolean
Returns whether the command is enabled for the SwiftMQ Explorer.boolean
Returns whether this command is for childs of an EntityList.void
readContent
(DataInput in) Read the content of this object from the stream.void
setEnabled
(boolean enabled) Enables/disables the command.void
setGuiEnabled
(boolean guiEnabled) Enables/disables this command for the SwiftMQ Explorer.void
setGuiForChild
(boolean guiForChild) Enables/disables this command for the childs of an EntityList (SwiftMQ Explorer).protected void
Internal use.toJson()
toString()
void
writeContent
(DataOutput out) Write the content of this object to the stream.
-
Constructor Details
-
Command
public Command(String name, String pattern, String description, boolean enabled, CommandExecutor commandExecutor) Create a new Command.- Parameters:
name
- the name of the command, e.g. "new".pattern
- a help pattern, displayed from CLI, e.g. "new[ ...]". description
- a command description, e.g. "New Entity"enabled
- true/false.commandExecutor
- the executor.
-
Command
public Command(String name, String pattern, String description, boolean enabled, CommandExecutor commandExecutor, boolean guiEnabled, boolean guiForChild) Create a new Command.- Parameters:
name
- the name of the command, e.g. "new".pattern
- a help pattern, displayed from CLI, e.g. "new[ ...]". description
- a command description, e.g. "New Entity"enabled
- true/false.commandExecutor
- the executor.guiEnabled
- states whether it is a command shown in the SwiftMQ Explorer.guiForChild
- states whether it is a command to be attached to each child of an Entity instead of the ENtity itself.
-
-
Method Details
-
getDumpId
public int getDumpId()Description copied from interface:Dumpable
Returns a unique dump id for this object. -
writeContent
Description copied from interface:Dumpable
Write the content of this object to the stream.- Specified by:
writeContent
in interfaceDumpable
- Parameters:
out
- output stream- Throws:
IOException
- if an error occurs
-
readContent
Description copied from interface:Dumpable
Read the content of this object from the stream.- Specified by:
readContent
in interfaceDumpable
- Parameters:
in
- input stream- Throws:
IOException
- if an error occurs
-
getPattern
Returns the pattern.- Returns:
- pattern.
-
getName
Returns the name.- Returns:
- name.
-
getTokens
Returns the tokenized name. For example, "show template" returns String[]{"show","template"}- Returns:
- tokenized name.
-
getDescription
Retuns the description.- Returns:
- description.
-
isEnabled
public boolean isEnabled()Returns the enabled state.- Returns:
- enabled state.
-
setEnabled
public void setEnabled(boolean enabled) Enables/disables the command.- Parameters:
enabled
- true/false.
-
getParent
Returns the parent entity.- Returns:
- parent entity.
-
setParent
Internal use.- Parameters:
parent
- parent.
-
getCommandExecutor
Returns the command executor.- Returns:
- command executor.
-
isGuiEnabled
public boolean isGuiEnabled()Returns whether the command is enabled for the SwiftMQ Explorer.- Returns:
- true/false.
-
setGuiEnabled
public void setGuiEnabled(boolean guiEnabled) Enables/disables this command for the SwiftMQ Explorer.- Parameters:
guiEnabled
- true/false.
-
isGuiForChild
public boolean isGuiForChild()Returns whether this command is for childs of an EntityList.- Returns:
- true/false.
-
setGuiForChild
public void setGuiForChild(boolean guiForChild) Enables/disables this command for the childs of an EntityList (SwiftMQ Explorer). Enabled, the command is shown on every child instead of the EntityList itself.- Parameters:
guiForChild
- description.
-
equals
Compares this command's tokenized command with another one.- Parameters:
cmd
- tokenized command.- Returns:
- true/false.
-
toJson
-
toString
-