public class HttpSettings extends Object
Modifier and Type | Field and Description |
---|---|
private static String |
lastNonProxyHosts |
private static Object |
lastNonProxyLock |
private static SoftReference |
lastNonProxyPatterns |
private Properties |
props |
private boolean |
ssl |
Modifier | Constructor and Description |
---|---|
private |
HttpSettings(boolean ssl,
Properties props)
Creates new HttpSettings instance which returns values from the given
system properties list.
|
Modifier and Type | Method and Description |
---|---|
private static String |
convertToRegex(String hostPattern)
Converts host pattern obtained from http.nonProxyHosts property to
java.util.regex-style regular expression.
|
long |
getConnectionTimeout()
Returns com.sun.jini.jeri.http[s].idleConnectionTimeout
system property value if set; otherwise returns 15000.
|
boolean |
getDisableProxyPersistentConnections()
Returns com.sun.jini.jeri.http.disableProxyPersistentConnections
system property as boolean value if set and not ssl; otherwise returns
false.
|
static HttpSettings |
getHttpSettings(boolean ssl)
Returns an HttpSettings instance which can be used to query values of
HTTP-related (if ssl is false) or HTTPS-related (if ssl is true) system
properties.
|
boolean |
getPingProxyConnections()
Returns com.sun.jini.jeri.http.pingProxyConnections system
property as boolean value if set; otherwise returns false.
|
long |
getPingProxyConnectionTimeout()
Returns com.sun.jini.jeri.http.pingProxyConnectionTimeout
system property as long value if set; otherwise returns
Long.MAX_VALUE (essentially, never timeout).
|
String |
getProxyHost(String host)
Returns proxy host if given host should be proxied through it,
else empty string.
|
int |
getProxyPort()
Returns http[s].proxyPort system property value if set; else if not
ssl returns proxyPort system property value if set; else returns
443 (if ssl) or 80 (if not ssl).
|
long |
getResponseAckTimeout()
Returns com.sun.jini.jeri.http[s].responseAckTimeout system
property value if set; otherwise returns 15000.
|
long |
getServerConnectionTimeout()
Returns com.sun.jini.jeri.http[s].idleServerConnectionTimeout
system property value if set; otherwise returns getConnectionTimeout()
plus 30000 (if ssl) or 10000 (if not ssl).
|
private boolean |
nonProxied(String host)
If http.nonProxyHosts system property value is set, returns true iff
given host matches any regular expressions contained in value; if
http.nonProxyHosts is unset, returns false.
|
private static final Object lastNonProxyLock
private static String lastNonProxyHosts
private static SoftReference lastNonProxyPatterns
private final boolean ssl
private final Properties props
private HttpSettings(boolean ssl, Properties props)
public static HttpSettings getHttpSettings(boolean ssl)
public String getProxyHost(String host)
public int getProxyPort()
public long getResponseAckTimeout()
public long getConnectionTimeout()
public long getServerConnectionTimeout()
public boolean getDisableProxyPersistentConnections()
public boolean getPingProxyConnections()
public long getPingProxyConnectionTimeout()
private boolean nonProxied(String host)
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.