Package com.iizix.push.vapid
Class PushService
- java.lang.Object
-
- com.iizix.push.vapid.AbstractPushService<PushService>
-
- com.iizix.push.vapid.PushService
-
public class PushService extends AbstractPushService<PushService>
-
-
Field Summary
-
Fields inherited from class com.iizix.push.vapid.AbstractPushService
SERVER_KEY_CURVE, SERVER_KEY_ID
-
-
Constructor Summary
Constructors Constructor Description PushService()
PushService(java.lang.String gcmApiKey)
PushService(java.lang.String publicKey, java.lang.String privateKey)
PushService(java.lang.String publicKey, java.lang.String privateKey, java.lang.String subject)
PushService(java.security.KeyPair keyPair)
PushService(java.security.KeyPair keyPair, java.lang.String subject)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.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.java.util.concurrent.Future<org.apache.http.HttpResponse>
sendAsync(Notification notification)
Deprecated.UsePushAsyncService.send(Notification)
instead.java.util.concurrent.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 Detail
-
PushService
public PushService()
-
PushService
public PushService(java.lang.String gcmApiKey)
-
PushService
public PushService(java.security.KeyPair keyPair)
-
PushService
public PushService(java.security.KeyPair keyPair, java.lang.String subject)
-
PushService
public PushService(java.lang.String publicKey, java.lang.String privateKey) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
PushService
public PushService(java.lang.String publicKey, java.lang.String privateKey, java.lang.String subject) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
-
Method Detail
-
send
public org.apache.http.HttpResponse send(Notification notification, Encoding encoding) throws java.security.GeneralSecurityException, java.io.IOException, org.jose4j.lang.JoseException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
Send a notification and wait for the response.- Parameters:
notification
-encoding
-- Returns:
- Throws:
java.security.GeneralSecurityException
java.io.IOException
org.jose4j.lang.JoseException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
send
public org.apache.http.HttpResponse send(Notification notification) throws java.security.GeneralSecurityException, java.io.IOException, org.jose4j.lang.JoseException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
- Throws:
java.security.GeneralSecurityException
java.io.IOException
org.jose4j.lang.JoseException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
sendAsync
@Deprecated public java.util.concurrent.Future<org.apache.http.HttpResponse> sendAsync(Notification notification, Encoding encoding) throws java.security.GeneralSecurityException, java.io.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:
java.security.GeneralSecurityException
java.io.IOException
org.jose4j.lang.JoseException
-
sendAsync
@Deprecated public java.util.concurrent.Future<org.apache.http.HttpResponse> sendAsync(Notification notification) throws java.security.GeneralSecurityException, java.io.IOException, org.jose4j.lang.JoseException
Deprecated.UsePushAsyncService.send(Notification)
instead.- Throws:
java.security.GeneralSecurityException
java.io.IOException
org.jose4j.lang.JoseException
-
preparePost
public org.apache.http.client.methods.HttpPost preparePost(Notification notification, Encoding encoding) throws java.security.GeneralSecurityException, java.io.IOException, org.jose4j.lang.JoseException
Prepare a HttpPost for Apache async http client- Parameters:
notification
-encoding
-- Returns:
- Throws:
java.security.GeneralSecurityException
java.io.IOException
org.jose4j.lang.JoseException
-
-