|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wink.client.ClientConfig
public class ClientConfig
Provides client configuration. The ClientConfig is implemented using the
builder pattern so method calls can be easily aggregated. Custom Providers
are defined by calling the applications(Application...)
method.
Custom client handlers are defined by calling the
handlers(ClientHandler...)
method.
Constructor Summary | |
---|---|
ClientConfig()
Construct a new ClientConfig with the following default settings: proxy: none connect timeout: 60 seconds read timeout: 60 seconds follow redirects: true |
Method Summary | |
---|---|
ClientConfig |
acceptHeaderAutoSet(boolean isAcceptHeaderAutoSet)
Set whether client will automatically set an appropriate Accept header |
ClientConfig |
applications(javax.ws.rs.core.Application... applications)
Add applications |
protected ClientConfig |
clone()
|
ClientConfig |
connectTimeout(int connectTimeout)
Convenience method to set the wink.client.connectTimeout property |
ClientConfig |
followRedirects(boolean followRedirects)
Set whether to client will automatically follow redirects |
List<javax.ws.rs.core.Application> |
getApplications()
Get an unmodifiable list of the applications |
boolean |
getBypassHostnameVerification()
Get whether or not hostname verification will be bypassed for SSL certificates. |
protected ConnectionHandler |
getConnectionHandler()
Returns the client handler that acts as the connection handler. |
int |
getConnectTimeout()
Convenience method to get the int value of the wink.client.connectTimeout property |
List<ClientHandler> |
getHandlers()
Get an unmodifiable list of the client handlers |
Properties |
getProperties()
Convenience method for getting all properties registered on this instance. |
String |
getProxyHost()
Get the proxy host |
int |
getProxyPort()
Get the proxy port |
int |
getReadTimeout()
Convenience method to get the int value of the wink.client.readTimeout property |
ClientConfig |
handlers(ClientHandler... handlers)
Add client handlers |
boolean |
isAcceptHeaderAutoSet()
Returns whether client will automatically set an appropriate Accept header |
boolean |
isFollowRedirects()
Returns whether to client will automatically follow redirects |
boolean |
isLoadWinkApplications()
|
boolean |
isSupportDTDExpansion()
Convenience method to get the boolean value of the wink.supportDTDExpansion property |
ClientConfig |
proxyHost(String proxyHost)
Set the proxy host |
ClientConfig |
proxyPort(int proxyPort)
Set the proxy port |
ClientConfig |
readTimeout(int readTimeout)
Convenience method to set the wink.client.readTimeout property |
void |
setBypassHostnameVerification(boolean bypassHostnameVerification)
Set whether or not hostname verification to bypass hostname verification for SSL certificates. |
void |
setLoadWinkApplications(boolean loadWinkApplications)
|
void |
setProperties(Properties properties)
Convenience method to set the client configuration properties. |
ClientConfig |
supportDTDExpansion(boolean supportDTDExpansion)
Convenience method to set the wink.supportDTDExpansion property |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClientConfig()
Method Detail |
---|
public final String getProxyHost()
public final ClientConfig proxyHost(String proxyHost)
proxyHost
- proxy host
ClientConfigException
public final int getProxyPort()
public final ClientConfig proxyPort(int proxyPort)
proxyPort
- proxy port
ClientConfigException
public final int getConnectTimeout()
public final ClientConfig connectTimeout(int connectTimeout)
connectTimeout
- the connect timeout in milliseconds
ClientConfigException
public final int getReadTimeout()
public final ClientConfig readTimeout(int readTimeout)
readTimeout
- the read timeout in milliseconds
ClientConfigException
public final boolean isSupportDTDExpansion()
public final ClientConfig supportDTDExpansion(boolean supportDTDExpansion)
supportDTDExpansion
- boolean
ClientConfigException
public final boolean isFollowRedirects()
public final ClientConfig followRedirects(boolean followRedirects)
followRedirects
- whether to client will automatically follow
redirects
ClientConfigException
public final boolean isAcceptHeaderAutoSet()
public final ClientConfig acceptHeaderAutoSet(boolean isAcceptHeaderAutoSet)
isAcceptHeaderAutoSet
- whether client will automatically set an
appropriate Accept header
ClientConfigException
public final List<ClientHandler> getHandlers()
public final ClientConfig handlers(ClientHandler... handlers)
handlers
- the handlers to add
ClientConfigException
protected ConnectionHandler getConnectionHandler()
This method should be overridden in order to provide an alternate connection handler.
public final List<javax.ws.rs.core.Application> getApplications()
public final ClientConfig applications(javax.ws.rs.core.Application... applications)
applications
- the applications to add
ClientConfigException
protected ClientConfig clone()
clone
in class Object
public void setLoadWinkApplications(boolean loadWinkApplications)
public boolean isLoadWinkApplications()
public Properties getProperties()
getProperties
in interface org.apache.wink.common.internal.WinkConfiguration
public void setProperties(Properties properties)
setProperties
in interface org.apache.wink.common.internal.WinkConfiguration
properties
- the properties object to use. If properties parameter is null, the properties on this ClientConfig will be cleared with Properties.clear()public boolean getBypassHostnameVerification()
public void setBypassHostnameVerification(boolean bypassHostnameVerification)
bypassHostnameVerification
- true to bypass hostname verification
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |