Search in sources :

Example 6 with ApnsServerStub

use of com.notnoop.apns.utils.ApnsServerStub in project camel by apache.

the class ApnsUtils method prepareAndStartServer.

public static ApnsServerStub prepareAndStartServer(int gatePort, int feedPort) {
    InputStream stream = ClassLoader.getSystemResourceAsStream(FixedCertificates.SERVER_STORE);
    SSLContext context = Utilities.newSSLContext(stream, FixedCertificates.SERVER_PASSWORD, "PKCS12", getAlgorithm());
    ApnsServerStub server = new ApnsServerStub(context.getServerSocketFactory(), gatePort, feedPort);
    server.start();
    return server;
}
Also used : ApnsServerStub(com.notnoop.apns.utils.ApnsServerStub) InputStream(java.io.InputStream) SSLContext(javax.net.ssl.SSLContext)

Aggregations

ApnsServerStub (com.notnoop.apns.utils.ApnsServerStub)6 ApnsNotification (com.notnoop.apns.ApnsNotification)5 ApnsService (com.notnoop.apns.ApnsService)5 DeliveryError (com.notnoop.apns.DeliveryError)5 EnhancedApnsNotification (com.notnoop.apns.EnhancedApnsNotification)5 SimpleApnsNotification (com.notnoop.apns.SimpleApnsNotification)5 StartSendingApnsDelegate (com.notnoop.apns.StartSendingApnsDelegate)5 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)5 CountDownLatch (java.util.concurrent.CountDownLatch)4 ApnsDelegate (com.notnoop.apns.ApnsDelegate)2 InputStream (java.io.InputStream)1 SSLContext (javax.net.ssl.SSLContext)1