Package com.iizix.push.vapid
Class PushService
Field Summary
Fields inherited from class com.iizix.push.vapid.AbstractPushService
SERVER_KEY_CURVE, SERVER_KEY_ID
Constructor Summary
ConstructorDescriptionPushService
(String gcmApiKey) PushService
(String publicKey, String privateKey) PushService
(String publicKey, String privateKey, String subject) PushService
(KeyPair keyPair) PushService
(KeyPair keyPair, String subject) Method Summary
Modifier and TypeMethodDescriptionorg.apache.http.client.methods.HttpPost
preparePost
(Notification notification, Encoding encoding) Prepare a HttpPost for Apache async http clientorg.apache.http.HttpResponse
send
(Notification notification) org.apache.http.HttpResponse
send
(Notification notification, Encoding encoding) Send a notification and wait for the response.Future<org.apache.http.HttpResponse>
sendAsync
(Notification notification) Deprecated.Future<org.apache.http.HttpResponse>
sendAsync
(Notification notification, Encoding encoding) Deprecated.UsePushAsyncService.send(Notification, Encoding)
instead.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
PushService
public PushService()PushService
PushService
PushService
PushService
- Throws:
GeneralSecurityException
PushService
public PushService(String publicKey, String privateKey, String subject) throws GeneralSecurityException - Throws:
GeneralSecurityException
Method Details
send
public org.apache.http.HttpResponse send(Notification notification, Encoding encoding) throws GeneralSecurityException, IOException, org.jose4j.lang.JoseException, ExecutionException, InterruptedException Send a notification and wait for the response.- Parameters:
notification
-encoding
-- Returns:
- Throws:
GeneralSecurityException
IOException
org.jose4j.lang.JoseException
ExecutionException
InterruptedException
send
public org.apache.http.HttpResponse send(Notification notification) throws GeneralSecurityException, IOException, org.jose4j.lang.JoseException, ExecutionException, InterruptedException - Throws:
GeneralSecurityException
IOException
org.jose4j.lang.JoseException
ExecutionException
InterruptedException
sendAsync
@Deprecated public Future<org.apache.http.HttpResponse> sendAsync(Notification notification, Encoding encoding) throws GeneralSecurityException, IOException, org.jose4j.lang.JoseException Deprecated.UsePushAsyncService.send(Notification, Encoding)
instead.Send a notification, but don't wait for the response.- Parameters:
notification
-encoding
-- Returns:
- Throws:
GeneralSecurityException
IOException
org.jose4j.lang.JoseException
sendAsync
@Deprecated public Future<org.apache.http.HttpResponse> sendAsync(Notification notification) throws GeneralSecurityException, IOException, org.jose4j.lang.JoseException Deprecated.UsePushAsyncService.send(Notification)
instead.- Throws:
GeneralSecurityException
IOException
org.jose4j.lang.JoseException
preparePost
public org.apache.http.client.methods.HttpPost preparePost(Notification notification, Encoding encoding) throws GeneralSecurityException, IOException, org.jose4j.lang.JoseException Prepare a HttpPost for Apache async http client- Parameters:
notification
-encoding
-- Returns:
- Throws:
GeneralSecurityException
IOException
org.jose4j.lang.JoseException
PushAsyncService.send(Notification)
instead.