Package com.symphony.api.bindings.jersey
Class JerseyApiBuilder
- java.lang.Object
-
- com.symphony.api.bindings.AbstractApiBuilder
-
- com.symphony.api.bindings.jersey.JerseyApiBuilder
-
- All Implemented Interfaces:
ApiBuilder
,ConfigurableApiBuilder
public class JerseyApiBuilder extends AbstractApiBuilder
Provides a basic Jersey client creation wrapper which includes:- Setting up ssl context
- Setting proxy details (basic, override if needed)
- Using the
MultipartWebResourceFactory
- Author:
- Rob Moffat
-
-
Field Summary
-
Fields inherited from class com.symphony.api.bindings.AbstractApiBuilder
connectTimeout, keyManagers, password, port, proxyHost, trustManagers, url, user, wrappers
-
-
Constructor Summary
Constructors Constructor Description JerseyApiBuilder()
JerseyApiBuilder(String url)
Call this class to create basic jersey-backed apis.JerseyApiBuilder(String url, KeyManager[] keyManagers)
Call this class to create a basic jersey client for authenticating using certificates.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <X> X
buildProxy(Class<X> c, javax.ws.rs.client.WebTarget wt)
protected org.glassfish.jersey.client.ClientConfig
createConfig()
protected SSLContext
createSSLContext()
<X> X
getApi(Class<X> c)
protected javax.ws.rs.client.WebTarget
newWebTarget()
protected javax.ws.rs.client.WebTarget
newWebTarget(String url)
protected void
registerFeatures(org.glassfish.jersey.client.JerseyClientBuilder jcb)
boolean
testConnection(String url)
Should be overridden by specific implementations-
Methods inherited from class com.symphony.api.bindings.AbstractApiBuilder
getKeyManagers, getTrustManagers, getWrappers, setConnectTimeout, setKeyManagers, setProxyDetails, setTrustManagers, setUrl, setWrappers
-
-
-
-
Constructor Detail
-
JerseyApiBuilder
public JerseyApiBuilder()
-
JerseyApiBuilder
public JerseyApiBuilder(String url)
Call this class to create basic jersey-backed apis.
-
JerseyApiBuilder
public JerseyApiBuilder(String url, KeyManager[] keyManagers)
Call this class to create a basic jersey client for authenticating using certificates.
-
-
Method Detail
-
getApi
public <X> X getApi(Class<X> c)
-
newWebTarget
protected javax.ws.rs.client.WebTarget newWebTarget(String url)
-
newWebTarget
protected javax.ws.rs.client.WebTarget newWebTarget()
-
registerFeatures
protected void registerFeatures(org.glassfish.jersey.client.JerseyClientBuilder jcb)
-
createSSLContext
protected SSLContext createSSLContext() throws NoSuchAlgorithmException, KeyManagementException
-
createConfig
protected org.glassfish.jersey.client.ClientConfig createConfig()
-
buildProxy
protected <X> X buildProxy(Class<X> c, javax.ws.rs.client.WebTarget wt)
-
testConnection
public boolean testConnection(String url)
Description copied from class:AbstractApiBuilder
Should be overridden by specific implementations- Specified by:
testConnection
in interfaceConfigurableApiBuilder
- Overrides:
testConnection
in classAbstractApiBuilder
-
-