org.xins.common.http
Class HTTPCallConfig

java.lang.Object
  extended byorg.xins.common.service.CallConfig
      extended byorg.xins.common.http.HTTPCallConfig
All Implemented Interfaces:
Serializable

public final class HTTPCallConfig
extends CallConfig

Call configuration for the HTTP service caller. The HTTP method and the User-Agent string can be configured. By default the HTTP method is POST and the no User-Agent string is set.

This class is not thread safe.

Since:
XINS 1.1.0
Version:
$Revision: 1.25 $ $Date: 2008/12/22 09:40:44 $
Author:
Ernst de Haan
See Also:
Serialized Form

Constructor Summary
HTTPCallConfig()
          Constructs a new HTTPCallConfig object.
 
Method Summary
 String describe()
          Describes this configuration.
 boolean getFollowRedirect()
          Returns the action performed when a redirect is returned from the server.
 HTTPMethod getMethod()
          Returns the HTTP method associated with this configuration.
 String getUserAgent()
          Returns the HTTP user agent associated with the HTTP call.
 void setFollowRedirect(boolean follow)
          Sets the action to perform if a redirect is returned from the server.
 void setMethod(HTTPMethod method)
          Sets the HTTP method associated with this configuration.
 void setUserAgent(String agent)
          Sets the user agent associated with the HTTP call.
 
Methods inherited from class org.xins.common.service.CallConfig
isFailOverAllowed, setFailOverAllowed, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTTPCallConfig

public HTTPCallConfig()
Constructs a new HTTPCallConfig object.

Method Detail

getMethod

public HTTPMethod getMethod()
Returns the HTTP method associated with this configuration.

Returns:
the HTTP method, never null.

setMethod

public void setMethod(HTTPMethod method)
               throws IllegalArgumentException
Sets the HTTP method associated with this configuration.

Parameters:
method - the HTTP method to be associated with this configuration, cannot be null.
Throws:
IllegalArgumentException - if method == null.

getFollowRedirect

public boolean getFollowRedirect()
Returns the action performed when a redirect is returned from the server.

Returns:
true if it should call the redirected link, false if it should fail.
Since:
XINS 2.2

setFollowRedirect

public void setFollowRedirect(boolean follow)
Sets the action to perform if a redirect is returned from the server.

Parameters:
follow - true if it should call the redirected link, false if it should fail.
Since:
XINS 2.2

setUserAgent

public void setUserAgent(String agent)
Sets the user agent associated with the HTTP call.

Parameters:
agent - the HTTP user agent, or null if no user-agent header should be sent.
Since:
XINS 1.3.0

getUserAgent

public String getUserAgent()
Returns the HTTP user agent associated with the HTTP call.

Returns:
the HTTP user agent or null no user agent has been specified.
Since:
XINS 1.3.0

describe

public String describe()
Describes this configuration.

Overrides:
describe in class CallConfig
Returns:
the description of this configuration, should never be null, should never be empty and should never start or end with whitespace characters.


See http://www.xins.org/.