org.xins.common.http
Class HTTPCallRequest

java.lang.Object
  extended byorg.xins.common.service.CallRequest
      extended byorg.xins.common.http.HTTPCallRequest
All Implemented Interfaces:
Serializable

public final class HTTPCallRequest
extends CallRequest

A request towards an HTTP service.

Since XINS 1.1.0, an HTTP method is not a mandatory property anymore. If the HTTP method is not specified in a request, then it will from the applicable HTTPCallConfig.

Since:
XINS 1.0.0
Version:
$Revision: 1.36 $ $Date: 2008/07/04 10:22:45 $
Author:
Ernst de Haan
See Also:
HTTPServiceCaller, Serialized Form

Constructor Summary
HTTPCallRequest()
          Constructs a new HTTPCallRequest with no parameters.
HTTPCallRequest(HTTPMethod method)
          Constructs a new HTTPCallRequest with the specified HTTP method.
HTTPCallRequest(HTTPMethod method, PropertyReader parameters)
          Constructs a new HTTPCallRequest with the specified HTTP method and parameters.
HTTPCallRequest(HTTPMethod method, PropertyReader parameters, boolean failOverAllowed, HTTPStatusCodeVerifier statusCodeVerifier)
          Constructs a new HTTPCallRequest with the specified HTTP method, parameters and status code verifier, optionally allowing unconditional fail-over.
HTTPCallRequest(PropertyReader parameters)
          Constructs a new HTTPCallRequest with the specified parameters.
HTTPCallRequest(PropertyReader parameters, HTTPStatusCodeVerifier statusCodeVerifier)
          Constructs a new HTTPCallRequest with the specified parameters and status code verifier.
 
Method Summary
 String describe()
          Describes this request.
 HTTPCallConfig getHTTPCallConfig()
          Returns the HTTP call configuration.
 HTTPMethod getMethod()
          Returns the HTTP method associated with this call request.
 PropertyReader getParameters()
          Returns the parameters associated with this call request.
 HTTPStatusCodeVerifier getStatusCodeVerifier()
          Returns the HTTP status code verifier.
 boolean isFailOverAllowed()
          Determines whether fail-over is in principle allowed, even if the request was already sent to the other end.
 void setHTTPCallConfig(HTTPCallConfig callConfig)
          Sets the associated HTTP call configuration.
 
Methods inherited from class org.xins.common.service.CallRequest
getCallConfig, setCallConfig, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTTPCallRequest

public HTTPCallRequest(PropertyReader parameters,
                       HTTPStatusCodeVerifier statusCodeVerifier)
Constructs a new HTTPCallRequest with the specified parameters and status code verifier. Fail-over is not unconditionally allowed.

Parameters:
parameters - the parameters for the HTTP call, can be null if there are none to pass down.
statusCodeVerifier - the HTTP status code verifier, or null if all HTTP status codes are allowed.
Since:
XINS 1.1.0

HTTPCallRequest

public HTTPCallRequest(PropertyReader parameters)
Constructs a new HTTPCallRequest with the specified parameters. Unconditional fail-over is disabled.

Parameters:
parameters - the parameters for the HTTP call, can be null if there are none to pass down.
Since:
XINS 1.1.0

HTTPCallRequest

public HTTPCallRequest()
Constructs a new HTTPCallRequest with no parameters. Unconditional fail-over is disabled.

Since:
XINS 1.1.0

HTTPCallRequest

public HTTPCallRequest(HTTPMethod method)
Constructs a new HTTPCallRequest with the specified HTTP method. No arguments are passed to the URL. Unconditional fail-over is disabled.

Parameters:
method - the HTTP method to use, or null if the method should be determined when the call is made.

HTTPCallRequest

public HTTPCallRequest(HTTPMethod method,
                       PropertyReader parameters)
Constructs a new HTTPCallRequest with the specified HTTP method and parameters. Unconditional fail-over is disabled.

Parameters:
method - the HTTP method to use, or null if the method should be determined when the call is made.
parameters - the parameters for the HTTP call, can be null.

HTTPCallRequest

public HTTPCallRequest(HTTPMethod method,
                       PropertyReader parameters,
                       boolean failOverAllowed,
                       HTTPStatusCodeVerifier statusCodeVerifier)
Constructs a new HTTPCallRequest with the specified HTTP method, parameters and status code verifier, optionally allowing unconditional fail-over.

Parameters:
method - the HTTP method to use, or null if the method should be determined when the call is made.
parameters - the parameters for the HTTP call, can be null.
failOverAllowed - flag that indicates whether fail-over is unconditionally allowed.
statusCodeVerifier - the HTTP status code verifier, or null if all HTTP status codes are allowed.
Method Detail

describe

public String describe()
Describes this request.

Specified by:
describe in class CallRequest
Returns:
the description of this request, never null.

getHTTPCallConfig

public HTTPCallConfig getHTTPCallConfig()
Returns the HTTP call configuration.

Returns:
the HTTP call configuration object, or null.
Since:
XINS 1.1.0

setHTTPCallConfig

public void setHTTPCallConfig(HTTPCallConfig callConfig)
Sets the associated HTTP call configuration.

Parameters:
callConfig - the HTTP call configuration object to associate with this request, or null.
Since:
XINS 1.1.0

getMethod

public HTTPMethod getMethod()
Returns the HTTP method associated with this call request. This is determined by getting the HTTP method on the associated call config, see getHTTPCallConfig(). If the associated call config is null, then null is returned.

Returns:
the HTTP method, or null if none is set for the call configuration associated with this request.

getParameters

public PropertyReader getParameters()
Returns the parameters associated with this call request.

Since XINS 1.1.0, this method will never return null.

Returns:
the parameters, never null.

isFailOverAllowed

public boolean isFailOverAllowed()
Determines whether fail-over is in principle allowed, even if the request was already sent to the other end.

Returns:
true if fail-over is in principle allowed, even if the request was already sent to the other end, false otherwise.

getStatusCodeVerifier

public HTTPStatusCodeVerifier getStatusCodeVerifier()
Returns the HTTP status code verifier. If all HTTP status codes are allowed, then null is returned.

Returns:
the HTTP status code verifier, or null.


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