BrightSide Workbench Full Report + Source Code
org.turro.push.service.Notification Class Reference

Classes

class  NotificationBuilder
 

Public Member Functions

 Notification (String endpoint, ECPublicKey userPublicKey, byte[] userAuth, byte[] payload, int ttl, Urgency urgency, String topic)
 
 Notification (String endpoint, PublicKey userPublicKey, byte[] userAuth, byte[] payload, int ttl)
 
 Notification (String endpoint, String userPublicKey, String userAuth, byte[] payload, int ttl) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException
 
 Notification (String endpoint, PublicKey userPublicKey, byte[] userAuth, byte[] payload)
 
 Notification (String endpoint, String userPublicKey, String userAuth, byte[] payload) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException
 
 Notification (String endpoint, String userPublicKey, String userAuth, String payload) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException
 
 Notification (String endpoint, String userPublicKey, String userAuth, String payload, Urgency urgency) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException
 
 Notification (Subscription subscription, String payload) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException
 
 Notification (Subscription subscription, String payload, Urgency urgency) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException
 
String getEndpoint ()
 
ECPublicKey getUserPublicKey ()
 
byte[] getUserAuth ()
 
byte[] getPayload ()
 
boolean hasPayload ()
 
boolean hasUrgency ()
 
boolean hasTopic ()
 
boolean isGcm ()
 
boolean isFcm ()
 
int getTTL ()
 
Urgency getUrgency ()
 
String getTopic ()
 
String getOrigin () throws MalformedURLException
 

Static Public Member Functions

static NotificationBuilder builder ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 35 of file Notification.java.

Constructor & Destructor Documentation

◆ Notification() [1/9]

org.turro.push.service.Notification.Notification ( String  endpoint,
ECPublicKey  userPublicKey,
byte[]  userAuth,
byte[]  payload,
int  ttl,
Urgency  urgency,
String  topic 
)

Definition at line 54 of file Notification.java.

54  {
55  this.endpoint = endpoint;
56  this.userPublicKey = userPublicKey;
57  this.userAuth = userAuth;
58  this.payload = payload;
59  this.ttl = ttl;
60  this.urgency = urgency;
61  this.topic = topic;
62  }

◆ Notification() [2/9]

org.turro.push.service.Notification.Notification ( String  endpoint,
PublicKey  userPublicKey,
byte[]  userAuth,
byte[]  payload,
int  ttl 
)

Definition at line 64 of file Notification.java.

64  {
65  this(endpoint, (ECPublicKey) userPublicKey, userAuth, payload, ttl, null, null);
66  }

◆ Notification() [3/9]

org.turro.push.service.Notification.Notification ( String  endpoint,
String  userPublicKey,
String  userAuth,
byte[]  payload,
int  ttl 
) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException

Definition at line 68 of file Notification.java.

68  {
69  this(endpoint, ServerKeys.loadPublicKey(userPublicKey), Base64.decodeBase64(userAuth), payload, ttl);
70  }
Here is the call graph for this function:

◆ Notification() [4/9]

org.turro.push.service.Notification.Notification ( String  endpoint,
PublicKey  userPublicKey,
byte[]  userAuth,
byte[]  payload 
)

Definition at line 72 of file Notification.java.

72  {
73  this(endpoint, userPublicKey, userAuth, payload, DEFAULT_TTL);
74  }

◆ Notification() [5/9]

org.turro.push.service.Notification.Notification ( String  endpoint,
String  userPublicKey,
String  userAuth,
byte[]  payload 
) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException

Definition at line 76 of file Notification.java.

76  {
77  this(endpoint, ServerKeys.loadPublicKey(userPublicKey), Base64.decodeBase64(userAuth), payload);
78  }
Here is the call graph for this function:

◆ Notification() [6/9]

org.turro.push.service.Notification.Notification ( String  endpoint,
String  userPublicKey,
String  userAuth,
String  payload 
) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException

Definition at line 80 of file Notification.java.

80  {
81  this(endpoint, ServerKeys.loadPublicKey(userPublicKey), Base64.decodeBase64(userAuth), payload.getBytes(UTF_8));
82  }
Here is the call graph for this function:

◆ Notification() [7/9]

org.turro.push.service.Notification.Notification ( String  endpoint,
String  userPublicKey,
String  userAuth,
String  payload,
Urgency  urgency 
) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException

Definition at line 84 of file Notification.java.

84  {
85  this(endpoint, ServerKeys.loadPublicKey(userPublicKey), Base64.decodeBase64(userAuth), payload.getBytes(UTF_8));
86  this.urgency = urgency;
87  }
Here is the call graph for this function:

◆ Notification() [8/9]

org.turro.push.service.Notification.Notification ( Subscription  subscription,
String  payload 
) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException

Definition at line 89 of file Notification.java.

89  {
90  this(subscription.endpoint, subscription.keys.p256dh, subscription.keys.auth, payload);
91  }

◆ Notification() [9/9]

org.turro.push.service.Notification.Notification ( Subscription  subscription,
String  payload,
Urgency  urgency 
) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException

Definition at line 93 of file Notification.java.

93  {
94  this(subscription.endpoint, subscription.keys.p256dh, subscription.keys.auth, payload);
95  this.urgency = urgency;
96  }

Member Function Documentation

◆ builder()

static NotificationBuilder org.turro.push.service.Notification.builder ( )
static

Definition at line 152 of file Notification.java.

152  {
153  return new Notification.NotificationBuilder();
154  }
Notification(String endpoint, ECPublicKey userPublicKey, byte[] userAuth, byte[] payload, int ttl, Urgency urgency, String topic)

◆ getEndpoint()

String org.turro.push.service.Notification.getEndpoint ( )

Definition at line 98 of file Notification.java.

98  {
99  return endpoint;
100  }
Here is the caller graph for this function:

◆ getOrigin()

String org.turro.push.service.Notification.getOrigin ( ) throws MalformedURLException

Definition at line 146 of file Notification.java.

146  {
147  URL url = new URL(getEndpoint());
148 
149  return url.getProtocol() + "://" + url.getHost();
150  }
Here is the call graph for this function:

◆ getPayload()

byte [] org.turro.push.service.Notification.getPayload ( )

Definition at line 110 of file Notification.java.

110  {
111  return payload;
112  }
Here is the caller graph for this function:

◆ getTopic()

String org.turro.push.service.Notification.getTopic ( )

Definition at line 142 of file Notification.java.

142  {
143  return topic;
144  }

◆ getTTL()

int org.turro.push.service.Notification.getTTL ( )

Definition at line 134 of file Notification.java.

134  {
135  return ttl;
136  }

◆ getUrgency()

Urgency org.turro.push.service.Notification.getUrgency ( )

Definition at line 138 of file Notification.java.

138  {
139  return urgency;
140  }

◆ getUserAuth()

byte [] org.turro.push.service.Notification.getUserAuth ( )

Definition at line 106 of file Notification.java.

106  {
107  return userAuth;
108  }

◆ getUserPublicKey()

ECPublicKey org.turro.push.service.Notification.getUserPublicKey ( )

Definition at line 102 of file Notification.java.

102  {
103  return userPublicKey;
104  }

◆ hasPayload()

boolean org.turro.push.service.Notification.hasPayload ( )

Definition at line 114 of file Notification.java.

114  {
115  return getPayload().length > 0;
116  }
Here is the call graph for this function:

◆ hasTopic()

boolean org.turro.push.service.Notification.hasTopic ( )

Definition at line 122 of file Notification.java.

122  {
123  return topic != null;
124  }

◆ hasUrgency()

boolean org.turro.push.service.Notification.hasUrgency ( )

Definition at line 118 of file Notification.java.

118  {
119  return urgency != null;
120  }

◆ isFcm()

boolean org.turro.push.service.Notification.isFcm ( )

Definition at line 130 of file Notification.java.

130  {
131  return getEndpoint().indexOf("https://fcm.googleapis.com/fcm/send") == 0;
132  }
Here is the call graph for this function:

◆ isGcm()

boolean org.turro.push.service.Notification.isGcm ( )

Definition at line 126 of file Notification.java.

126  {
127  return getEndpoint().indexOf("https://android.googleapis.com/gcm/send") == 0;
128  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: