com.ibm.wbi.plugin
Class RequestEditor

com.ibm.wbi.plugin.Meg
  |
  +--com.ibm.wbi.plugin.RequestEditor
Direct Known Subclasses:
HttpRequestEditor

public abstract class RequestEditor
extends Meg

A request editor has the ability to edit the request before it gets to the generator.


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright information.
 
Fields inherited from class com.ibm.wbi.plugin.Meg
COPYRIGHT, EDITOR, GENERATOR, MONITOR, REQUEST_EDITOR, UNDEFINED
 
Constructor Summary
RequestEditor()
          Constucts a new request editor with default characteristics.
RequestEditor(java.lang.String name, java.lang.String condition, int priority)
          Constructs a new request editor with the specified characteristics and is enabled.
RequestEditor(java.lang.String name, java.lang.String condition, int priority, boolean enabled)
          Constructs a new request editor with the specified characteristics.
 
Method Summary
 int getMegType()
          Get the request editor meg type.
abstract  void handleRequest(RequestEvent event)
          Handle the specified request event.
protected  void processRejectedRequest(RequestEvent request)
          Copy the input stream to the output stream, leaving the contents unaffected.
 
Methods inherited from class com.ibm.wbi.plugin.Meg
forwardRequest, getCondition, getEnabled, getName, getPlugin, getPriority, isEnabled, setCondition, setEnabled, setName, setPriority, setup, setup, setup, setup, threadManagerRun
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
IBM copyright information.
Constructor Detail

RequestEditor

public RequestEditor()
Constucts a new request editor with default characteristics.

RequestEditor

public RequestEditor(java.lang.String name,
                     java.lang.String condition,
                     int priority)
Constructs a new request editor with the specified characteristics and is enabled.
Parameters:
name - The name of the request editor.
condition - The condition under which this request editor should be invoked.
priority - The priority of the request editor incase of a condition tie.

RequestEditor

public RequestEditor(java.lang.String name,
                     java.lang.String condition,
                     int priority,
                     boolean enabled)
Constructs a new request editor with the specified characteristics.
Parameters:
name - The name of the request editor.
condition - The condition under which this request editor should be invoked.
priority - The priority of the request editor incase of a condition tie.
enabled - true if enabled.
Method Detail

getMegType

public final int getMegType()
Get the request editor meg type.
Returns:
Meg.REQUEST_EDITOR.
Overrides:
getMegType in class Meg

handleRequest

public abstract void handleRequest(RequestEvent event)
                            throws RequestRejectedException,
                                   java.io.IOException
Handle the specified request event.
Parameters:
event - The request event with an input and output stream.
Throws:
RequestRejectedException - If rejecting request, this must be thrown before the first write() is made to the output stream.
java.io.Exception - can be thrown if an exception was generated by the meg while processing the MegInput/OutputStreams.
Overrides:
handleRequest in class Meg

processRejectedRequest

protected void processRejectedRequest(RequestEvent request)
                               throws java.io.IOException
Copy the input stream to the output stream, leaving the contents unaffected.
Parameters:
request - the original request that was passed to the editor's handleRequest(...) method
Overrides:
processRejectedRequest in class Meg