Package com.eatthepath.pushy.apns.proxy
Class HttpProxyHandlerFactory
- java.lang.Object
-
- com.eatthepath.pushy.apns.proxy.HttpProxyHandlerFactory
-
- All Implemented Interfaces:
ProxyHandlerFactory
public class HttpProxyHandlerFactory extends Object implements ProxyHandlerFactory
A concreteProxyHandlerFactoryimplementation that createsHttpProxyHandlerinstances.- Since:
- 0.6
- Author:
- Jon Chambers
-
-
Constructor Summary
Constructors Constructor Description HttpProxyHandlerFactory(SocketAddress proxyAddress)Creates a new proxy handler factory that will create HTTP proxy handlers that use the proxy at the given address and that will not perform authentication.HttpProxyHandlerFactory(SocketAddress proxyAddress, String username, String password)Creates a new proxy handler factory that will create HTTP proxy handlers that use the proxy at the given address and that will authenticate with the given username and password.
-
Method Summary
Modifier and Type Method Description ProxyHandlercreateProxyHandler()Constructs a new proxy handler.static HttpProxyHandlerFactoryfromSystemProxies(String apnsHost)Constructs anHttpProxyHandlerFactorythat uses the HTTP proxy (if any) specified in Java's standard proxy system properties.StringtoString()
-
-
-
Constructor Detail
-
HttpProxyHandlerFactory
public HttpProxyHandlerFactory(SocketAddress proxyAddress)
Creates a new proxy handler factory that will create HTTP proxy handlers that use the proxy at the given address and that will not perform authentication.- Parameters:
proxyAddress- the address of the HTTP proxy server- Since:
- 0.6
-
HttpProxyHandlerFactory
public HttpProxyHandlerFactory(SocketAddress proxyAddress, String username, String password)
Creates a new proxy handler factory that will create HTTP proxy handlers that use the proxy at the given address and that will authenticate with the given username and password.- Parameters:
proxyAddress- the address of the HTTP proxy serverusername- the username to use when connecting to the given proxy serverpassword- the password to use when connecting to the given proxy server- Since:
- 0.6
-
-
Method Detail
-
fromSystemProxies
public static HttpProxyHandlerFactory fromSystemProxies(String apnsHost) throws URISyntaxException
Constructs anHttpProxyHandlerFactorythat uses the HTTP proxy (if any) specified in Java's standard proxy system properties.- Parameters:
apnsHost- the APNs host for which to find proxy settings- Returns:
- an HTTP proxy factory if a proxy is configured for the given APNs host, or
nullif no proxy is configured for the given host - Throws:
URISyntaxException- ifapnsHostis malformed in some way- Since:
- 0.13.11
- See Also:
- Java™ Platform, Standard Edition 7 - Networking Properties - Proxies
-
createProxyHandler
public ProxyHandler createProxyHandler()
Description copied from interface:ProxyHandlerFactoryConstructs a new proxy handler.- Specified by:
createProxyHandlerin interfaceProxyHandlerFactory- Returns:
- a new proxy handler; must not be
null
-
-