net.sf.xbus.technical.http
Class HTTPSender

java.lang.Object
  extended by net.sf.xbus.technical.http.HTTPSender
All Implemented Interfaces:
Sender, TextSender
Direct Known Subclasses:
HTTPByteArrayListSender, HTTPParameterSender, HTTPStreamSender

public class HTTPSender
extends java.lang.Object
implements Sender, TextSender

The HTTPSender sends a message to an URL.

For sending SOAPMessages there are two special features:


Constructor Summary
HTTPSender(XBUSSystem destination)
          Stores the destination for later use.
 
Method Summary
 java.lang.String execute(java.lang.String function, java.lang.String callData)
          Sends the callData to the system.
 java.lang.String getType()
          A Sender can send data either as a String or as an Object to the neighboring system.
protected  org.apache.commons.httpclient.methods.PostMethod initialize(java.lang.String function, java.lang.String url)
           
protected  java.lang.String sendMessage(org.apache.commons.httpclient.methods.PostMethod method)
           
protected  void setRequestHeaders(java.lang.String function, org.apache.commons.httpclient.methods.PostMethod method)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPSender

public HTTPSender(XBUSSystem destination)
Stores the destination for later use.

Method Detail

execute

public java.lang.String execute(java.lang.String function,
                                java.lang.String callData)
                         throws XException
Sends the callData to the system. function is ignored.

Specified by:
execute in interface TextSender
Parameters:
function - used by some senders
callData - the data that shall be send to the neighbor system
Returns:
null
Throws:
XException - if something goes wrong

initialize

protected org.apache.commons.httpclient.methods.PostMethod initialize(java.lang.String function,
                                                                      java.lang.String url)
                                                               throws XException
Throws:
XException

setRequestHeaders

protected void setRequestHeaders(java.lang.String function,
                                 org.apache.commons.httpclient.methods.PostMethod method)
                          throws XException
Throws:
XException

sendMessage

protected java.lang.String sendMessage(org.apache.commons.httpclient.methods.PostMethod method)
                                throws XException
Throws:
XException

getType

public java.lang.String getType()
Description copied from interface: Sender
A Sender can send data either as a String or as an Object to the neighboring system.
When working with Strings the Sender must fulfill two preconditions: When working with Objects the Sender must also fulfill two preconditions:

Specified by:
getType in interface Sender