Skip to content

Commit

Permalink
fix to previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Cioffi committed Jan 29, 2016
1 parent 9caa630 commit 029e41b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ release.properties
dependency-reduced-pom.xml
buildNumber.properties

classpath
.classpath
.project
.settings/
10 changes: 10 additions & 0 deletions src/main/java/com/clevertap/jetty/apns/http2/ApnsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ public interface ApnsClient {
* @return The notification response
*/
NotificationResponse push(Notification notification) throws InterruptedException, ExecutionException, TimeoutException;

/**
* Sends a notification synchronously to the Apple Push Notification Service on topic.
*
* @param topic The topic of notification
* @param notification The notification built using
* {@link Notification.Builder}
* @return The notification response
*/
NotificationResponse push(String topic, Notification notification) throws InterruptedException, ExecutionException, TimeoutException;

/**
* Starts the HTTP client for pushing messages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeoutException;

/**
* A wrapper around Jetty's HttpClient to send out notifications using Apple's HTTP/2 API.
Expand Down Expand Up @@ -151,4 +153,10 @@ private void _push(String topic, Notification notification, NotificationResponse
public void shutdown() throws Exception {
client.stop();
}

@Override
public NotificationResponse push(String topic, Notification notification)
throws InterruptedException, ExecutionException, TimeoutException {
throw new UnsupportedOperationException("Synchronous requests are not supported by this client");
}
}

0 comments on commit 029e41b

Please sign in to comment.