com.novell.sentinel.client.http
Interface HttpRequestor<T>

Type Parameters:
T - The type of data interface (e.g., JSONParser or org.xml.sax.Parser) that will be reported as the result of the HTTP request.
All Superinterfaces:
HttpRequestMethod
All Known Implementing Classes:
HttpRequestorAsyncJava, HttpRequestorSyncJava, JSONHttpRequestorJava, JSONHttpRequestorJavaSync

public interface HttpRequestor<T>
extends HttpRequestMethod

Interface to execute HTTP requests. To support asynchronous requests all results are reported via callbacks.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.novell.sentinel.client.http.HttpRequestMethod
HttpRequestMethod.HttpMethod
 
Method Summary
 String getLocaleName()
          Get the name of the locale that will be used to create an HTTP "Accept-Language" header, if any.
 void octetRequest(HttpRequestMethod.HttpMethod method, String url, byte[] data, HttpResultHandler<byte[]> resultHandler)
          Issue an HTTP request that requires and optionally returns octet-stream data (e.g., POST, PUT).
 void octetRequest(HttpRequestMethod.HttpMethod method, String url, HttpResultHandler<byte[]> resultHandler)
          Issue an HTTP request the returns octet-stream data (e.g., GET).
 void request(HttpRequestMethod.HttpMethod method, String url, HttpResultHandler<T> resultHandler)
          Issue an HTTP request that does not require request content (e.g., GET, DELETE).
 void request(HttpRequestMethod.HttpMethod method, String url, T parser, HttpResultHandler<T> resultHandler)
          Issue an HTTP request that requires request content (e.g., PUT, POST).
 void setLocaleName(String localeName)
          Set the name of the locale to use for requests.
 

Method Detail

request

void request(HttpRequestMethod.HttpMethod method,
             String url,
             HttpResultHandler<T> resultHandler)
Issue an HTTP request that does not require request content (e.g., GET, DELETE).

Parameters:
method - The HTTP method.
url - The target of the request.
resultHandler - The handler to be notified of the request result.

request

void request(HttpRequestMethod.HttpMethod method,
             String url,
             T parser,
             HttpResultHandler<T> resultHandler)
Issue an HTTP request that requires request content (e.g., PUT, POST).

Parameters:
method - The HTTP method.
url - The target of the request.
parser - The source of the request content.
resultHandler - The handler to be notified of the request result.

octetRequest

void octetRequest(HttpRequestMethod.HttpMethod method,
                  String url,
                  HttpResultHandler<byte[]> resultHandler)
Issue an HTTP request the returns octet-stream data (e.g., GET).

Parameters:
method - The HTTP method.
url - The target of the request.
resultHandler - The handler to be notified of the request result.

octetRequest

void octetRequest(HttpRequestMethod.HttpMethod method,
                  String url,
                  byte[] data,
                  HttpResultHandler<byte[]> resultHandler)
Issue an HTTP request that requires and optionally returns octet-stream data (e.g., POST, PUT).

Parameters:
method - The HTTP method.
url - The target of the request.
data - The request content (may be null).
resultHandler - The handler to be notified of the request result.

setLocaleName

void setLocaleName(String localeName)
Set the name of the locale to use for requests. This will cause an HTTP "Accept-Language" header to be added to requests. If the environment is a browser, it may not be necessary or desirable to set this value.

Parameters:
localeName - The name of the locale (e.g., "en-US" or "de-CH"). May be null.

getLocaleName

String getLocaleName()
Get the name of the locale that will be used to create an HTTP "Accept-Language" header, if any.

Returns:
Locale name (may be null).