|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.degreedays.api.processing.XmlHttpRequestProcessor
public final class XmlHttpRequestProcessor
A concrete implementation of the RequestProcessor
interface that
turns Request
objects into XML, adds the necessary security details,
sends them over HTTP to the Degree Days.net API servers, and parses the XML
responses into Response
object models.
To create an instance of this class, you'll need to use the XmlHttpRequestProcessor.Builder
class. Using a Builder
you can heavily customize the way in
which the created XmlHttpRequestProcessor
works. For example, a
default XmlHttpRequestProcessor
uses java.net
classes to manage connections to the API servers, but you might want to swap
in HttpClient-based functionality if the rest of your application uses
HttpClient.
For more on the customization options, see the docs for the XmlHttpRequestProcessor.Builder
.
This class is designed to be safe for use in a multi-threaded environment. However, if you create a customized instance of this class, then the thread-safety of its operation will depend on the thread-safety of any custom processing components that you introduce.
Nested Class Summary | |
---|---|
static class |
XmlHttpRequestProcessor.Builder
Builds XmlHttpRequestProcessor objects: create and configure a
Builder object, then call XmlHttpRequestProcessor.Builder.build() to create an
XmlHttpRequestProcessor object. |
Method Summary | |
---|---|
Response |
process(Request request)
Processes the Request object and returns a
Response object which is either a
FailureResponse or a
Response that's type is the counterpart to
that of the Request object passed in. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Response process(Request request) throws TransportException
RequestProcessor
Request
object and returns a
Response
object which is either a
FailureResponse
or a
Response
that's type is the counterpart to
that of the Request
object passed in.
For example, successful processing of a
LocationDataRequest
will result in a
LocationDataResponse
.
process
in interface RequestProcessor
request
- the Request
to be processed. Cannot be null.
Response
object which is either a
FailureResponse
or a
Response
that's type is is the
counterpart to that of the Request
passed in.
TransportException
- if there is a network- or stream-related
error.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |