com.relayrides.pushy.apns
Class ApnsEnvironment

java.lang.Object
  extended by com.relayrides.pushy.apns.ApnsEnvironment

public class ApnsEnvironment
extends Object

An APNs environment is a set of servers that provide push notification services. Apple provides two environments: one production environment and one "sandbox" environment. Custom environments may be created for development and testing purposes.

APNs environments may optionally require TLS. Both Apple-provided environments require TLS. See "Provisioning and Development" for details.

Author:
Jon Chambers

Constructor Summary
ApnsEnvironment(String apnsGatewayHost, int apnsGatewayPort, String feedbackHost, int feedbackPort, boolean tlsRequired)
          Constructs a new APenvironment with the given host names and ports.
 
Method Summary
 String getApnsGatewayHost()
          Returns the host name of the APNs gateway in this environment.
 int getApnsGatewayPort()
          Returns the TCP port for the APNs gateway in this environment.
 String getFeedbackHost()
          Returns the host name of the APNs feedback service in this environment.
 int getFeedbackPort()
          Returns the TCP port for the APNs feedback service in this environment.
static ApnsEnvironment getProductionEnvironment()
          Returns an APNs environment for connecting to Apple's production servers.
static ApnsEnvironment getSandboxEnvironment()
          Returns an APNs environment for connecting to Apple's sandbox servers.
 boolean isTlsRequired()
          Indicates whether this environment requires TLS.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApnsEnvironment

public ApnsEnvironment(String apnsGatewayHost,
                       int apnsGatewayPort,
                       String feedbackHost,
                       int feedbackPort,
                       boolean tlsRequired)
Constructs a new APenvironment with the given host names and ports.

Parameters:
apnsGatewayHost - the host name of the APNs gateway
apnsGatewayPort - the TCP port for the APNs gateway
feedbackHost - the host name of the APNs feedback service
feedbackPort - the TCP port for the APNs feedback service
tlsRequired - true if this environment requires TLS or false otherwise
Method Detail

getApnsGatewayHost

public String getApnsGatewayHost()
Returns the host name of the APNs gateway in this environment.

Returns:
the host name of the APNs gateway in this environment

getApnsGatewayPort

public int getApnsGatewayPort()
Returns the TCP port for the APNs gateway in this environment.

Returns:
the TCP port for the APNs gateway in this environment

getFeedbackHost

public String getFeedbackHost()
Returns the host name of the APNs feedback service in this environment.

Returns:
the host name of the APNs feedback service in this environment

getFeedbackPort

public int getFeedbackPort()
Returns the TCP port for the APNs feedback service in this environment.

Returns:
the TCP port for the APNs feedback service in this environment

isTlsRequired

public boolean isTlsRequired()
Indicates whether this environment requires TLS.

Returns:
true if this environment requires TLS or false otherwise

getProductionEnvironment

public static ApnsEnvironment getProductionEnvironment()
Returns an APNs environment for connecting to Apple's production servers.

Returns:
an APNs environment for connecting to Apple's production servers

getSandboxEnvironment

public static ApnsEnvironment getSandboxEnvironment()
Returns an APNs environment for connecting to Apple's sandbox servers.

Returns:
an APNs environment for connecting to Apple's sandbox servers


Copyright © 2013 RelayRides. All rights reserved.