Package com.iizix.push.vapid
Class PushAsyncService
Field Summary
Fields inherited from class com.iizix.push.vapid.AbstractPushService
SERVER_KEY_CURVE, SERVER_KEY_ID
Constructor Summary
ConstructorDescriptionPushAsyncService
(String gcmApiKey) PushAsyncService
(String publicKey, String privateKey) PushAsyncService
(String publicKey, String privateKey, String subject) PushAsyncService
(KeyPair keyPair) PushAsyncService
(KeyPair keyPair, String subject) Method Summary
Modifier and TypeMethodDescriptionorg.asynchttpclient.BoundRequestBuilder
preparePost
(Notification notification, Encoding encoding) Prepare a POST request for AHC.CompletableFuture<org.asynchttpclient.Response>
send
(Notification notification) CompletableFuture<org.asynchttpclient.Response>
send
(Notification notification, Encoding encoding) Send a notification asynchronously.Methods inherited from class com.iizix.push.vapid.AbstractPushService
encrypt, getGcmApiKey, getKeyPair, getPrivateKey, getPublicKey, getSubject, prepareRequest, setGcmApiKey, setKeyPair, setPrivateKey, setPrivateKey, setPublicKey, setPublicKey, setSubject, vapidEnabled
Constructor Details
PushAsyncService
public PushAsyncService()PushAsyncService
PushAsyncService
PushAsyncService
PushAsyncService
- Throws:
GeneralSecurityException
PushAsyncService
public PushAsyncService(String publicKey, String privateKey, String subject) throws GeneralSecurityException - Throws:
GeneralSecurityException
Method Details
send
public CompletableFuture<org.asynchttpclient.Response> send(Notification notification, Encoding encoding) throws GeneralSecurityException, IOException, org.jose4j.lang.JoseException Send a notification asynchronously.- Parameters:
notification
-encoding
-- Returns:
- Throws:
GeneralSecurityException
IOException
org.jose4j.lang.JoseException
send
public CompletableFuture<org.asynchttpclient.Response> send(Notification notification) throws GeneralSecurityException, IOException, org.jose4j.lang.JoseException - Throws:
GeneralSecurityException
IOException
org.jose4j.lang.JoseException
preparePost
public org.asynchttpclient.BoundRequestBuilder preparePost(Notification notification, Encoding encoding) throws GeneralSecurityException, IOException, org.jose4j.lang.JoseException Prepare a POST request for AHC.- Parameters:
notification
-encoding
-- Returns:
- Throws:
GeneralSecurityException
IOException
org.jose4j.lang.JoseException