public abstract class RestClient extends Object
| Modifier and Type | Field and Description |
|---|---|
protected RestClientConfiguration |
configuration
rest client configuration
|
protected RestSession |
session
rest session
|
| Constructor and Description |
|---|
RestClient() |
RestClient(RestClientConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
askData(RestRequest request)
Ask some data from the server
|
void |
close()
Close the client.
|
protected abstract void |
close(RestSession session)
Close the client.
|
RestClientConfiguration |
getConfiguration() |
RestRequest |
getRequest(String id,
Object... args)
Obtain a request given his id and the args given.
|
abstract RequestFactory |
getRequestFactory()
Obtains the underlying factory of requests.
|
RestSession |
getSession() |
boolean |
isOpen()
Is the client opened ?
|
void |
open()
Open the client.
|
protected abstract void |
open(RestSession session)
Open the client.
|
InputStream |
sendData(RestRequest request)
Send some datas to the server.
|
void |
setConfiguration(RestClientConfiguration configuration)
Use a new configuration.
|
protected RestClientConfiguration configuration
protected RestSession session
public RestClient()
public RestClient(RestClientConfiguration configuration)
public abstract RequestFactory getRequestFactory()
protected abstract void open(RestSession session) throws IOException
isOpen() must returns true.session - the rest sessionIOException - if any pbprotected abstract void close(RestSession session) throws IOException
isOpen() must returns false.session - the rest sessionIOException - if any pbpublic RestRequest getRequest(String id, Object... args)
id - id of the requestargs - args passed to build the requestpublic InputStream askData(RestRequest request) throws RestException
request - request used for asking dataRestException - if any pb while asking datapublic InputStream sendData(RestRequest request) throws RestException
request - the request used for sending dataRestException - if any pb while sending datapublic void open()
throws RestException
session and invoke
the method open(RestSession).RestException - if any pb while opening sessionpublic void close()
throws RestException
session and invoke
the method close(RestSession).RestException - if any pb while closing sessionpublic boolean isOpen()
true if the internal session is opened,
false otherwise.public RestSession getSession()
sessionpublic RestClientConfiguration getConfiguration()
configurationpublic void setConfiguration(RestClientConfiguration configuration)
configuration - the new configurationCopyright © 2009-2012 CodeLutin. All Rights Reserved.