// Path: src/main/java/javapns/communication/exceptions/CommunicationException.java
// public class CommunicationException extends Exception {
//   private static final long serialVersionUID = 1286560293829685555L;
// 
//   public CommunicationException(final String message, final Exception cause) {
//     super(message, cause);
//   }
// }
// 
// Path: src/main/java/javapns/communication/exceptions/KeystoreException.java
// public class KeystoreException extends Exception {
// 
//   private static final long serialVersionUID = 2549063865160633139L;
// 
//   /**
//    * Constructor with custom message
//    *
//    * @param message
//    */
//   public KeystoreException(final String message) {
//     super(message);
//   }
// 
//   /**
//    * Constructor with custom message
//    *
//    * @param message
//    */
//   public KeystoreException(final String message, final Exception cause) {
//     super(message, cause);
//   }
// 
// }


import javapns.communication.exceptions.CommunicationException;
import javapns.communication.exceptions.KeystoreException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.net.ssl.*;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.Socket;
import java.security.KeyStore;
  }

  public abstract String getServerHost();

  protected abstract int getServerPort();

  /**
   * Return a SSLSocketFactory for creating sockets to communicate with Apple.
   *
   * @return SSLSocketFactory
   * @throws KeystoreException
   */
  private SSLSocketFactory createSSLSocketFactory() throws KeystoreException {
    return createSSLSocketFactoryWithTrustManagers(new TrustManager[]{new ServerTrustingTrustManager()});
  }

  private SSLSocketFactory getSSLSocketFactory() throws KeystoreException {
    if (socketFactory == null) {
      socketFactory = createSSLSocketFactory();
    }
    return socketFactory;
  }

  /**
   * Create a SSLSocket which will be used to send data to Apple
   *
   * @return the SSLSocket
   * @throws KeystoreException
   * @throws CommunicationException
   */
// Path: src/main/java/javapns/communication/exceptions/CommunicationException.java
// public class CommunicationException extends Exception {
//   private static final long serialVersionUID = 1286560293829685555L;
// 
//   public CommunicationException(final String message, final Exception cause) {
//     super(message, cause);
//   }
// }
// 
// Path: src/main/java/javapns/communication/exceptions/KeystoreException.java
// public class KeystoreException extends Exception {
// 
//   private static final long serialVersionUID = 2549063865160633139L;
// 
//   /**
//    * Constructor with custom message
//    *
//    * @param message
//    */
//   public KeystoreException(final String message) {
//     super(message);
//   }
// 
//   /**
//    * Constructor with custom message
//    *
//    * @param message
//    */
//   public KeystoreException(final String message, final Exception cause) {
//     super(message, cause);
//   }
// 
// }


// Path: src/main/java/javapns/communication/ConnectionToAppleServer.java
import javapns.communication.exceptions.CommunicationException;
import javapns.communication.exceptions.KeystoreException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.net.ssl.*;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.Socket;
import java.security.KeyStore;

  }

  public abstract String getServerHost();

  protected abstract int getServerPort();

  /**
   * Return a SSLSocketFactory for creating sockets to communicate with Apple.
   *
   * @return SSLSocketFactory
   * @throws KeystoreException
   */
  private SSLSocketFactory createSSLSocketFactory() throws KeystoreException {
    return createSSLSocketFactoryWithTrustManagers(new TrustManager[]{new ServerTrustingTrustManager()});
  }

  private SSLSocketFactory getSSLSocketFactory() throws KeystoreException {
    if (socketFactory == null) {
      socketFactory = createSSLSocketFactory();
    }
    return socketFactory;
  }

  /**
   * Create a SSLSocket which will be used to send data to Apple
   *
   * @return the SSLSocket
   * @throws KeystoreException
   * @throws CommunicationException
   */
  public SSLSocket getSSLSocket() throws KeystoreException, CommunicationException {