com.acsinet_solutions.cetia4.http
Class SimpleHttpCommandProcessor

java.lang.Object
  extended by com.acsinet_solutions.cetia4.http.SimpleHttpCommandProcessor
All Implemented Interfaces:
HttpCommandProcessor
Direct Known Subclasses:
J2EEFormHttpCommandProcessor

public class SimpleHttpCommandProcessor
extends java.lang.Object
implements HttpCommandProcessor

Simple implmentation of a command processor on services that require no authentication. Jakarta Commons HTTPClient is used internally.

Author:
Santiago Arriaga

Constructor Summary
SimpleHttpCommandProcessor()
          Default constructor
SimpleHttpCommandProcessor(java.lang.String base)
          Constructor that receives the base path
 
Method Summary
protected  int execute(org.apache.commons.httpclient.HttpClient client, HttpCommand command, java.io.OutputStream ostream)
          Execute the HTTP request and return it's results.
 int execute(HttpCommand command, java.io.OutputStream ostream)
          Execute the command request and write the result's contents to the given output stream.
protected  java.lang.String getBase()
          Get the reference to the base path for subclasses
 void setBase(java.lang.String base)
          Sets the basic url prepended to requests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleHttpCommandProcessor

public SimpleHttpCommandProcessor()
Default constructor


SimpleHttpCommandProcessor

public SimpleHttpCommandProcessor(java.lang.String base)
Constructor that receives the base path

Method Detail

setBase

public final void setBase(java.lang.String base)
Sets the basic url prepended to requests. This may point to the web application and will be used to create authentication URL


execute

public int execute(HttpCommand command,
                   java.io.OutputStream ostream)
            throws java.io.IOException
Description copied from interface: HttpCommandProcessor
Execute the command request and write the result's contents to the given output stream.

Specified by:
execute in interface HttpCommandProcessor
ostream - The stream where to write the response; may be null.
Returns:
the response status code
Throws:
java.io.IOException

execute

protected final int execute(org.apache.commons.httpclient.HttpClient client,
                            HttpCommand command,
                            java.io.OutputStream ostream)
                     throws java.io.IOException
Execute the HTTP request and return it's results.

Throws:
java.io.IOException

getBase

protected final java.lang.String getBase()
Get the reference to the base path for subclasses