Package com.swiftmq.mgmt
Interface CommandExecutor
-
- All Known Subinterfaces:
Endpoint
- All Known Implementing Classes:
EndpointImpl
,EndpointImpl
,EndpointImpl
,EndpointImpl
public interface CommandExecutor
A CommandExecutor is attached to a Command object and actually executes the commmand.- Author:
- IIT GmbH, Bremen/Germany, Copyright (c) 2000-2002, All Rights Reserved
- See Also:
Command
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String[]
execute(java.lang.String[] context, Entity entity, java.lang.String[] parameter)
Called to execute the command.
-
-
-
Method Detail
-
execute
java.lang.String[] execute(java.lang.String[] context, Entity entity, java.lang.String[] parameter)
Called to execute the command. This method is called from the MgmtSwiftlet when a user performs the command with CLI or SwiftMQ Explorer. Thecontext
parameter contains the current command context, that is, for example,String[]{"sys$queuemanager","queues"}
for "/sys$queuemanager/queues". Theentity
is the Entity object where the command is attached to, andparameter
are the parameters, given to this command. For example, the command "new testqueue1 cache-size 200" will be translated into the parameterString[]{"new","testqueue1","cache-size","200"}
.
This method has to validate the parameters and executes the command. It returns a String array which is either null (means success) or the following structure:
- String[0] contains
"Error:"
if an error has occured or"Information:"
if an information should be displayed to the user. - String[1] contains the error resp. the info message
Examples:
return new String[]{"Information:", "To activate this Change, a Reboot of this Router is required."};
return new String[]{"Error:", "Mandatory Property '" + p.getName() + "' must be set."};
return new String[]{"Error:", e.getMessage()};
- Parameters:
context
- current context.entity
- parent entity.parameter
- command parameter.- Returns:
- state structure.
- String[0] contains
-
-