|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.io.rest.RestClient
public abstract class RestClient
Abtract REST client.
| Field Summary | |
|---|---|
protected RestClientConfiguration |
configuration
rest client configuration |
protected java.util.Map<java.lang.String,RestRequestBuilder> |
requestBuilders
registred requests |
protected RestSession |
session
rest session |
| Constructor Summary | |
|---|---|
RestClient()
|
|
RestClient(RestClientConfiguration configuration)
|
|
| Method Summary | |
|---|---|
protected abstract void |
addDefaultRequests()
Add the default available requests for this client. |
void |
addRequestBuilder(RestRequestBuilder builder)
Add a request into the client. |
java.io.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(java.lang.String id,
java.lang.Object... args)
Obtain a request given his id and the args given. |
RestSession |
getSession()
|
boolean |
isOpen()
Is the client opened ? |
void |
open()
Open the client. |
protected abstract void |
open(RestSession session)
Open the client. |
java.io.InputStream |
sendData(RestRequest request)
Send some datas to the server. |
void |
setConfiguration(RestClientConfiguration configuration)
Use a new configuration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected RestClientConfiguration configuration
protected RestSession session
protected final java.util.Map<java.lang.String,RestRequestBuilder> requestBuilders
| Constructor Detail |
|---|
public RestClient()
public RestClient(RestClientConfiguration configuration)
| Method Detail |
|---|
protected abstract void addDefaultRequests()
protected abstract void open(RestSession session)
throws java.io.IOException
isOpen() must returns true.
session - the rest session
java.io.IOException - if any pb
protected abstract void close(RestSession session)
throws java.io.IOException
isOpen() must returns false.
session - the rest session
java.io.IOException - if any pbpublic void addRequestBuilder(RestRequestBuilder builder)
builder - the new request to add
public RestRequest getRequest(java.lang.String id,
java.lang.Object... args)
id - id of the requestargs - args passed to build the request
public java.io.InputStream askData(RestRequest request)
throws RestException
request - request used for asking data
RestException
public java.io.InputStream sendData(RestRequest request)
throws RestException
request - the request used for sending data
RestException
public void open()
throws RestException
session and invoke
the method open(org.nuiton.io.rest.RestSession).
RestException
public void close()
throws RestException
session and invoke
the method close(org.nuiton.io.rest.RestSession).
RestExceptionpublic 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 configuration
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||