Package com.iizix.push.vapid
Class Notification
- java.lang.Object
- com.iizix.push.vapid.Notification
public class Notification extends java.lang.Object
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Notification.NotificationBuilder
Constructor Summary
Constructors Constructor Description Notification(Subscription subscription, java.lang.String payload)
Notification(Subscription subscription, java.lang.String payload, Urgency urgency)
Notification(java.lang.String endpoint, java.lang.String userPublicKey, java.lang.String userAuth, byte[] payload)
Notification(java.lang.String endpoint, java.lang.String userPublicKey, java.lang.String userAuth, byte[] payload, int ttl)
Notification(java.lang.String endpoint, java.lang.String userPublicKey, java.lang.String userAuth, java.lang.String payload)
Notification(java.lang.String endpoint, java.lang.String userPublicKey, java.lang.String userAuth, java.lang.String payload, Urgency urgency)
Notification(java.lang.String endpoint, java.security.PublicKey userPublicKey, byte[] userAuth, byte[] payload)
Notification(java.lang.String endpoint, java.security.PublicKey userPublicKey, byte[] userAuth, byte[] payload, int ttl)
Notification(java.lang.String endpoint, org.bouncycastle.jce.interfaces.ECPublicKey userPublicKey, byte[] userAuth, byte[] payload, int ttl, Urgency urgency, java.lang.String topic)
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Notification.NotificationBuilder
builder()
java.lang.String
getEndpoint()
java.lang.String
getOrigin()
byte[]
getPayload()
java.lang.String
getTopic()
int
getTTL()
Urgency
getUrgency()
byte[]
getUserAuth()
org.bouncycastle.jce.interfaces.ECPublicKey
getUserPublicKey()
boolean
hasPayload()
boolean
hasTopic()
boolean
hasUrgency()
boolean
isFcm()
boolean
isGcm()
Detect if the notification is for a GCM-based subscription
Constructor Detail
Notification
public Notification(java.lang.String endpoint, org.bouncycastle.jce.interfaces.ECPublicKey userPublicKey, byte[] userAuth, byte[] payload, int ttl, Urgency urgency, java.lang.String topic)
Notification
public Notification(java.lang.String endpoint, java.security.PublicKey userPublicKey, byte[] userAuth, byte[] payload, int ttl)
Notification
public Notification(java.lang.String endpoint, java.lang.String userPublicKey, java.lang.String userAuth, byte[] payload, int ttl) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.spec.InvalidKeySpecException
- Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.spec.InvalidKeySpecException
Notification
public Notification(java.lang.String endpoint, java.security.PublicKey userPublicKey, byte[] userAuth, byte[] payload)
Notification
public Notification(java.lang.String endpoint, java.lang.String userPublicKey, java.lang.String userAuth, byte[] payload) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.spec.InvalidKeySpecException
- Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.spec.InvalidKeySpecException
Notification
public Notification(java.lang.String endpoint, java.lang.String userPublicKey, java.lang.String userAuth, java.lang.String payload) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.spec.InvalidKeySpecException
- Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.spec.InvalidKeySpecException
Notification
public Notification(java.lang.String endpoint, java.lang.String userPublicKey, java.lang.String userAuth, java.lang.String payload, Urgency urgency) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.spec.InvalidKeySpecException
- Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.spec.InvalidKeySpecException
Notification
public Notification(Subscription subscription, java.lang.String payload) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.spec.InvalidKeySpecException
- Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.spec.InvalidKeySpecException
Notification
public Notification(Subscription subscription, java.lang.String payload, Urgency urgency) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.spec.InvalidKeySpecException
- Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.spec.InvalidKeySpecException
Method Detail
getEndpoint
public java.lang.String getEndpoint()
getUserPublicKey
public org.bouncycastle.jce.interfaces.ECPublicKey getUserPublicKey()
getUserAuth
public byte[] getUserAuth()
getPayload
public byte[] getPayload()
hasPayload
public boolean hasPayload()
hasUrgency
public boolean hasUrgency()
hasTopic
public boolean hasTopic()
isGcm
public boolean isGcm()
Detect if the notification is for a GCM-based subscription- Returns:
isFcm
public boolean isFcm()
getTTL
public int getTTL()
getUrgency
public Urgency getUrgency()
getTopic
public java.lang.String getTopic()
getOrigin
public java.lang.String getOrigin() throws java.net.MalformedURLException
- Throws:
java.net.MalformedURLException
builder
public static Notification.NotificationBuilder builder()