public class JerseyClient extends Object implements javax.ws.rs.client.Client, Initializable<JerseyClient>
JAX-RS Client
contract.Modifier | Constructor and Description |
---|---|
protected |
JerseyClient()
Create a new Jersey client instance using a default configuration.
|
protected |
JerseyClient(javax.ws.rs.core.Configuration config,
SSLContext sslContext,
HostnameVerifier verifier)
Create a new Jersey client instance.
|
protected |
JerseyClient(javax.ws.rs.core.Configuration config,
SSLContext sslContext,
HostnameVerifier verifier,
DefaultSslContextProvider defaultSslContextProvider)
Create a new Jersey client instance.
|
protected |
JerseyClient(javax.ws.rs.core.Configuration config,
org.glassfish.jersey.internal.util.collection.UnsafeValue<SSLContext,IllegalStateException> sslContextProvider,
HostnameVerifier verifier)
Create a new Jersey client instance.
|
protected |
JerseyClient(javax.ws.rs.core.Configuration config,
org.glassfish.jersey.internal.util.collection.UnsafeValue<SSLContext,IllegalStateException> sslContextProvider,
HostnameVerifier verifier,
DefaultSslContextProvider defaultSslContextProvider)
Create a new Jersey client instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
ClientConfig |
getConfiguration()
Get a live view of an internal client configuration state of this initializable instance.
|
ExecutorService |
getExecutorService() |
HostnameVerifier |
getHostnameVerifier() |
ScheduledExecutorService |
getScheduledExecutorService() |
SSLContext |
getSslContext() |
JerseyInvocation.Builder |
invocation(javax.ws.rs.core.Link link) |
boolean |
isClosed()
Check client state.
|
boolean |
isDefaultSslContext()
Get information about used
SSLContext . |
JerseyClient |
preInitialize()
Pre-initializes the runtime and runtime
configuration of this component
in order to improve performance during the first request. |
JerseyClient |
property(String name,
Object value) |
JerseyClient |
register(Class<?> providerClass) |
JerseyClient |
register(Class<?> providerClass,
Class<?>... contracts) |
JerseyClient |
register(Class<?> providerClass,
int bindingPriority) |
JerseyClient |
register(Class<?> providerClass,
Map<Class<?>,Integer> contracts) |
JerseyClient |
register(Object provider) |
JerseyClient |
register(Object provider,
Class<?>... contracts) |
JerseyClient |
register(Object provider,
int bindingPriority) |
JerseyClient |
register(Object provider,
Map<Class<?>,Integer> contracts) |
JerseyWebTarget |
target(javax.ws.rs.core.Link link) |
JerseyWebTarget |
target(String uri) |
JerseyWebTarget |
target(URI uri) |
JerseyWebTarget |
target(javax.ws.rs.core.UriBuilder uriBuilder) |
protected JerseyClient()
protected JerseyClient(javax.ws.rs.core.Configuration config, SSLContext sslContext, HostnameVerifier verifier)
config
- jersey client configuration.sslContext
- jersey client SSL context.verifier
- jersey client host name verifier.protected JerseyClient(javax.ws.rs.core.Configuration config, SSLContext sslContext, HostnameVerifier verifier, DefaultSslContextProvider defaultSslContextProvider)
config
- jersey client configuration.sslContext
- jersey client SSL context.verifier
- jersey client host name verifier.defaultSslContextProvider
- default SSL context provider.protected JerseyClient(javax.ws.rs.core.Configuration config, org.glassfish.jersey.internal.util.collection.UnsafeValue<SSLContext,IllegalStateException> sslContextProvider, HostnameVerifier verifier)
config
- jersey client configuration.sslContextProvider
- jersey client SSL context provider.verifier
- jersey client host name verifier.protected JerseyClient(javax.ws.rs.core.Configuration config, org.glassfish.jersey.internal.util.collection.UnsafeValue<SSLContext,IllegalStateException> sslContextProvider, HostnameVerifier verifier, DefaultSslContextProvider defaultSslContextProvider)
config
- jersey client configuration.sslContextProvider
- jersey client SSL context provider. Non null
provider is expected to
return non-default value.verifier
- jersey client host name verifier.defaultSslContextProvider
- default SSL context provider.public void close()
close
in interface javax.ws.rs.client.Client
public boolean isClosed()
true
if current JerseyClient
instance is closed, otherwise false
.close()
public boolean isDefaultSslContext()
SSLContext
.true
when used SSLContext
is acquired from SslConfigurator.getDefaultContext()
,
false
otherwise.public JerseyWebTarget target(String uri)
target
in interface javax.ws.rs.client.Client
public JerseyWebTarget target(URI uri)
target
in interface javax.ws.rs.client.Client
public JerseyWebTarget target(javax.ws.rs.core.UriBuilder uriBuilder)
target
in interface javax.ws.rs.client.Client
public JerseyWebTarget target(javax.ws.rs.core.Link link)
target
in interface javax.ws.rs.client.Client
public JerseyInvocation.Builder invocation(javax.ws.rs.core.Link link)
invocation
in interface javax.ws.rs.client.Client
public JerseyClient register(Class<?> providerClass)
register
in interface javax.ws.rs.core.Configurable<javax.ws.rs.client.Client>
public JerseyClient register(Object provider)
register
in interface javax.ws.rs.core.Configurable<javax.ws.rs.client.Client>
public JerseyClient register(Class<?> providerClass, int bindingPriority)
register
in interface javax.ws.rs.core.Configurable<javax.ws.rs.client.Client>
public JerseyClient register(Class<?> providerClass, Class<?>... contracts)
register
in interface javax.ws.rs.core.Configurable<javax.ws.rs.client.Client>
public JerseyClient register(Class<?> providerClass, Map<Class<?>,Integer> contracts)
register
in interface javax.ws.rs.core.Configurable<javax.ws.rs.client.Client>
public JerseyClient register(Object provider, int bindingPriority)
register
in interface javax.ws.rs.core.Configurable<javax.ws.rs.client.Client>
public JerseyClient register(Object provider, Class<?>... contracts)
register
in interface javax.ws.rs.core.Configurable<javax.ws.rs.client.Client>
public JerseyClient register(Object provider, Map<Class<?>,Integer> contracts)
register
in interface javax.ws.rs.core.Configurable<javax.ws.rs.client.Client>
public JerseyClient property(String name, Object value)
property
in interface javax.ws.rs.core.Configurable<javax.ws.rs.client.Client>
public ClientConfig getConfiguration()
Initializable
getConfiguration
in interface javax.ws.rs.core.Configurable<javax.ws.rs.client.Client>
getConfiguration
in interface Initializable<JerseyClient>
public SSLContext getSslContext()
getSslContext
in interface javax.ws.rs.client.Client
public HostnameVerifier getHostnameVerifier()
getHostnameVerifier
in interface javax.ws.rs.client.Client
public ExecutorService getExecutorService()
public ScheduledExecutorService getScheduledExecutorService()
public JerseyClient preInitialize()
Initializable
configuration
of this component
in order to improve performance during the first request.
Once this method is called no other method implementing Configurable
should be called
on this pre initialized component, otherwise the initialized client runtime will be discarded and the configuration
will change back to uninitialized.
preInitialize
in interface Initializable<JerseyClient>
Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.