|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Client
Client is the main entry point to the fluent API used to build and execute client requests in order to consume responses returned.
Clients are heavy-weight objects that manage the client-side communication infrastructure. Initialization as well as disposal of aClient instance
may be a rather expensive operation. It is therefore advised to construct only
a small number of Client instances in the application. Client instances
must be properly closed before being disposed to avoid leaking
resources.
Configuration| Method Summary | |
|---|---|
void |
close()
Close client instance and all it's associated resources. |
Configuration |
configuration()
Get access to the underlying configuration of the
client instance. |
Invocation |
invocation(Link link)
Build an invocation from a link. |
Invocation |
invocation(Link link,
Entity<?> entity)
Build an invocation from a link. |
WebTarget |
target(Link link)
Build a new web resource target. |
WebTarget |
target(java.lang.String uri)
Build a new web resource target. |
WebTarget |
target(java.net.URI uri)
Build a new web resource target. |
WebTarget |
target(UriBuilder uriBuilder)
Build a new web resource target. |
| Method Detail |
|---|
void close()
IllegalStateException
being thrown.
Calling this method effectively invalidates all resource targets
produced by the client instance. Invoking any method on such targets once the client
is closed would result in an IllegalStateException being thrown.
Configuration configuration()
configuration of the
client instance.
WebTarget target(java.lang.String uri)
throws java.lang.IllegalArgumentException,
java.lang.NullPointerException
uri - web resource URI. May contain template parameters.
java.lang.IllegalArgumentException - in case the supplied string is not a valid URI template.
java.lang.NullPointerException - in case the supplied argument is null.
WebTarget target(java.net.URI uri)
throws java.lang.NullPointerException
uri - web resource URI.
java.lang.NullPointerException - in case the supplied argument is null.
WebTarget target(UriBuilder uriBuilder)
throws java.lang.NullPointerException
uriBuilder - web resource URI represented as URI builder.
java.lang.NullPointerException - in case the supplied argument is null.
WebTarget target(Link link)
throws java.lang.NullPointerException
link - link to a web resource.
java.lang.NullPointerException - in case the supplied argument is null.
Invocation invocation(Link link)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException
Build an invocation from a link. The method and URI are obtained from the link. The HTTP Accept header is initialized to the value of the "produces" parameter in the link. If the operation requires an entity, use the overloaded form of this method.
This method will throw an IllegalArgumentException if there
is not enough information to build an invocation (e.g. no HTTP method or entity
when required).
link - link to build invocation from.
java.lang.NullPointerException - in case argument is null.
java.lang.IllegalArgumentException - in case link is incomplete to build invocation.
Invocation invocation(Link link,
Entity<?> entity)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException
Build an invocation from a link. The method and URI are obtained from the link. The HTTP Accept header is initialized to the value of the "produces" parameter in the link.If the operation does not require an entity, use the overloaded form of this method.
This method will throw an IllegalArgumentException if there
is not enough information to build and invocation (e.g. no HTTP method).
link - link to build invocation from.entity - request entity to be send when the invocation is invoked.
java.lang.NullPointerException - in case argument is null.
java.lang.IllegalArgumentException - in case link is incomplete to build invocation.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||