com.ibm.workflow.servlet.client
Interface CommandHandler

All Known Implementing Classes:
GenericCommandHandler, CommandHandlerAdapter

public interface CommandHandler

This class allows you to add new commands to the Web Client's servlet and also to extend the servlet's commands. It is recommended that your custom commands all have a "x-" prefix to avoid name clashes with any future extensions to the Web Client's commands. If a custom command has the same name as a builtin command, the custom command will never be called.

If the names of your custom commands correspond with the names of the methods implementing them (apart from the "x-" prefix), then you should extend GenericCommandHandler instead of implementing this interface (see the AuditTrailHandler sample).

The custom commands are accessible through the 'trigger tag' returned by the getTriggerTagFor() method. Note that the Viewer used must call this method in order for the trigger tags to be displayed.


Method Summary
 void destroy()
          This method is called by the Web Client in its servlet's destroy() method.
 ResponsePage execute(java.lang.String command, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This method is called every time a custom command is to be executed.
 byte[] getCredentials(javax.servlet.http.HttpServletRequest request)
          This method is called by the BuiltinHandler as a pre-logon hook to enable third party authentication.
 java.lang.String getHandlerInfo()
          Returns a String that contains information about the handler such as its author, version, and copyright information.
 java.lang.String getTriggerTagFor(int list, RequestContext context)
          This method can be called by Viewers to obtain a HTML tag that triggers user-defined commands.
 void init(Config config)
          This method is called by the Web Client in its servlet's init() method.
 void logon3(ExecutionService service, byte[] credentials, SessionMode mode, AbsenceIndicator absenceIndicator)
          Deprecated. This method will no longer be called when using MQSeries Workflow V3.3 which provides an authentication exit for the Administration server.
 void onLogoff(SessionContext context)
          This method is called whenever a user has logged off.
 void onLogon(RequestContext context)
          This method is called whenever a new user has logged on.
 void onLogon(SessionContext context)
          Deprecated. Use onLogon(com.ibm.workflow.servlet.client.RequestContext) instead.
 

Method Detail

init

public void init(Config config)
This method is called by the Web Client in its servlet's init() method. Here you have access to the servlet's properties file as well as the default command handler.
Parameters:
config - The servlet's configuration and initialization parameters

destroy

public void destroy()
This method is called by the Web Client in its servlet's destroy() method. Free any resources here that you might have cached.

getHandlerInfo

public java.lang.String getHandlerInfo()
Returns a String that contains information about the handler such as its author, version, and copyright information.
Returns:
A String containing version information.

getTriggerTagFor

public java.lang.String getTriggerTagFor(int list,
                                         RequestContext context)
This method can be called by Viewers to obtain a HTML tag that triggers user-defined commands.
Parameters:
list - Denotes the list for which the trigger tag is queried.
context - The RequestContext which was passed to the Viewer calling this method.
Returns:
A string containing HTML tags for the icons to be displayed on list.

execute

public ResponsePage execute(java.lang.String command,
                            javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response)
                     throws java.lang.NoSuchMethodException,
                            ClientException
This method is called every time a custom command is to be executed. It must return the ResponsePage representing the results of command.
Parameters:
command - The name of the command (the value of the command request parameter)
request - The request the client has made of the servlet
response - The response the servlet sends to the client
Returns:
The page representing the results of command
Throws:
ClientException - If an error occurred.
java.lang.NoSuchMethodException - If the command was not handled.

onLogon

public void onLogon(SessionContext context)
Deprecated. Use onLogon(com.ibm.workflow.servlet.client.RequestContext) instead.

This method is called whenever a new user has logged on.
Parameters:
context - The SessionContext for the newly added session.

onLogon

public void onLogon(RequestContext context)
This method is called whenever a new user has logged on.
Parameters:
context - The RequestContext for the newly added session.

onLogoff

public void onLogoff(SessionContext context)
This method is called whenever a user has logged off.
Parameters:
context - The SessionContext for the session that will be removed.

getCredentials

public byte[] getCredentials(javax.servlet.http.HttpServletRequest request)
                      throws ClientException
This method is called by the BuiltinHandler as a pre-logon hook to enable third party authentication.
Parameters:
request - The logon request sent by the client
Returns:
null if normal logon processing is required. If a non-null value is returned, the logon3() method is called instead of the ExecutionService.logon2() method. For MQSeries Workflow V3.3 and subsequent release levels, the ExecutionService.logon4() method will be called and an authentication exit must have been installed on the server.
Throws:
ClientException - If an error occurred.

logon3

public void logon3(ExecutionService service,
                   byte[] credentials,
                   SessionMode mode,
                   AbsenceIndicator absenceIndicator)
            throws FmcException
Deprecated. This method will no longer be called when using MQSeries Workflow V3.3 which provides an authentication exit for the Administration server.

When the getCredentials() method returned a non-null value, and MQSeries Workflow V3.2.2 is being used, this method will be called instead of ExecutionService.logon2(). The postcondition of this method is that Service.isLoggedOn() returns true.
Parameters:
service - The service to log on to
credentials - The credentials returned by getCredentials()
mode - See ExecutionService.logon2()
absenceIndicator - See ExecutionService.logon2()
Throws:
FmcException - If an error occurred.


© Copyright IBM Corporation 1999, 2001. All Rights Reserved.