public class JerseyClient extends Object implements 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(Configuration config,
SSLContext sslContext,
HostnameVerifier verifier)
Create a new Jersey client instance.
|
protected |
JerseyClient(Configuration config,
SSLContext sslContext,
HostnameVerifier verifier,
DefaultSslContextProvider defaultSslContextProvider)
Create a new Jersey client instance.
|
protected |
JerseyClient(Configuration config,
org.glassfish.jersey.internal.util.collection.UnsafeValue<SSLContext,IllegalStateException> sslContextProvider,
HostnameVerifier verifier)
Create a new Jersey client instance.
|
protected |
JerseyClient(Configuration config,
org.glassfish.jersey.internal.util.collection.UnsafeValue<SSLContext,IllegalStateException> sslContextProvider,
HostnameVerifier verifier,
DefaultSslContextProvider defaultSslContextProvider)
Create a new Jersey client instance.
|
protected JerseyClient()
protected JerseyClient(Configuration config, SSLContext sslContext, HostnameVerifier verifier)
config
- jersey client configuration.sslContext
- jersey client SSL context.verifier
- jersey client host name verifier.protected JerseyClient(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(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(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 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)
public JerseyWebTarget target(URI uri)
public JerseyWebTarget target(UriBuilder uriBuilder)
public JerseyWebTarget target(Link link)
public JerseyInvocation.Builder invocation(Link link)
invocation
in interface Client
public JerseyClient register(Class<?> providerClass)
register
in interface Configurable<Client>
public JerseyClient register(Object provider)
register
in interface Configurable<Client>
public JerseyClient register(Class<?> providerClass, int bindingPriority)
register
in interface Configurable<Client>
public JerseyClient register(Class<?> providerClass, Class<?>... contracts)
register
in interface Configurable<Client>
public JerseyClient register(Class<?> providerClass, Map<Class<?>,Integer> contracts)
register
in interface Configurable<Client>
public JerseyClient register(Object provider, int bindingPriority)
register
in interface Configurable<Client>
public JerseyClient register(Object provider, Class<?>... contracts)
register
in interface Configurable<Client>
public JerseyClient register(Object provider, Map<Class<?>,Integer> contracts)
register
in interface Configurable<Client>
public JerseyClient property(String name, Object value)
property
in interface Configurable<Client>
public ClientConfig getConfiguration()
Initializable
getConfiguration
in interface Configurable<Client>
getConfiguration
in interface Initializable<JerseyClient>
public SSLContext getSslContext()
getSslContext
in interface Client
public HostnameVerifier getHostnameVerifier()
getHostnameVerifier
in interface 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-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.