javapns.communication
Class ProxyManager

java.lang.Object
  extended by javapns.communication.ProxyManager

public class ProxyManager
extends Object

Main class for dealing with proxies.

Author:
Sylvain Pedneault

Method Summary
static String getProxyHost(AppleServer server)
          Get the proxy host address currently configured.
static int getProxyPort(AppleServer server)
          Get the proxy port currently configured.
static boolean isUsingProxy(AppleServer server)
          Determine if a proxy is currently configured.
static void setJVMProxy(String host, String port)
          Configure a proxy to use for HTTPS connections created anywhere in the JVM (not recommended).
static void setProxy(String host, String port)
          Configure a proxy to use for HTTPS connections created by JavaPNS.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setProxy

public static void setProxy(String host,
                            String port)
Configure a proxy to use for HTTPS connections created by JavaPNS.

Parameters:
host - the proxyHost
port - the proxyPort

setJVMProxy

public static void setJVMProxy(String host,
                               String port)
Configure a proxy to use for HTTPS connections created anywhere in the JVM (not recommended).

Parameters:
host - the proxyHost
port - the proxyPort

getProxyHost

public static String getProxyHost(AppleServer server)
Get the proxy host address currently configured. This method checks if a server-specific proxy has been configured, then checks if a proxy has been configured for the entire library, and finally checks if a JVM-wide proxy setting is available for HTTPS.

Parameters:
server - a specific server to check for proxy settings (may be null)
Returns:
a proxy host, or null if none is configured

getProxyPort

public static int getProxyPort(AppleServer server)
Get the proxy port currently configured. This method first locates a proxy host setting, then returns the proxy port from the same location.

Parameters:
server - a specific server to check for proxy settings (may be null)
Returns:
a network port, or 0 if no proxy is configured

isUsingProxy

public static boolean isUsingProxy(AppleServer server)
Determine if a proxy is currently configured.

Parameters:
server - a specific server to check for proxy settings (may be null)
Returns:
true if a proxy is set, false otherwise


Copyright © 2016. All Rights Reserved.