Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit ff82560

Browse files
committed
JavaDoc fixes.
1 parent a73e935 commit ff82560

File tree

6 files changed

+66
-44
lines changed

6 files changed

+66
-44
lines changed

src/main/java/com/devsu/push/sender/service/async/AsyncAndroidPushService.java

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public class AsyncAndroidPushService extends AsyncPushServiceBase {
1515
private static final String BUILDER_OBJECT = Message.Builder.class.getSimpleName();
1616

1717
/**
18-
* @see com.devsu.push.sender.service.sync.SyncAndroidPushService#AndroidPushService(String)
18+
* Single param constructor.
19+
* @param gcmApiKey The GCM API Key (also known as Sender ID).
1920
*/
2021
public AsyncAndroidPushService(String gcmApiKey){
2122
super(new SyncAndroidPushService(gcmApiKey), null);
@@ -34,8 +35,6 @@ public AsyncAndroidPushService(String gcmApiKey, PushCallback pushCallback) {
3435
* Sends a single push message.
3536
* @param msgBuilder The Message.Builder object.
3637
* @param token The push token.
37-
* @return <i>true</i> if the push message request was sent.
38-
* @throws Exception
3938
*/
4039
public void sendPush(final Message.Builder msgBuilder, final String token) {
4140
ExecutorService executorService = Executors.newSingleThreadExecutor();
@@ -61,9 +60,7 @@ public void run() {
6160
/**
6261
* Sends a bulk push message.
6362
* @param msgBuilder The Message.Builder object.
64-
* @param token The push token.
65-
* @return <i>true</i> if the push message request was sent.
66-
* @throws Exception
63+
* @param tokens The push tokens.
6764
*/
6865
public void sendPushInBulk(final Message.Builder msgBuilder, final String... tokens) {
6966
ExecutorService executorService = Executors.newSingleThreadExecutor();
@@ -87,56 +84,66 @@ public void run() {
8784
}
8885

8986
/**
90-
* @see com.devsu.push.sender.service.sync.SyncAndroidPushService#setMaxRetries(int)
87+
* Sets the number of max retries when sending a push message.
88+
* @param maxRetries The number of max retries when sending a push message.
9189
*/
9290
public void setMaxRetries(int maxRetries) {
9391
((SyncAndroidPushService)pushService).setMaxRetries(maxRetries);
9492
}
9593

9694
/**
97-
* @see com.devsu.push.sender.service.sync.SyncAndroidPushService#setMessageKey(java.lang.String)
95+
* Sets the message key that will store the key-value pair for the push message content.
96+
* @param messageKey The message key that will store the key-value pair for the push message content.
9897
*/
9998
public void setMessageKey(String messageKey) {
10099
((SyncAndroidPushService)pushService).setMessageKey(messageKey);
101100
}
102101

103102
/**
104-
* @see com.devsu.push.sender.service.sync.SyncAndroidPushService#setTitleKey(java.lang.String)
103+
* Sets the title key that will store the key-value pair for the push message title.
104+
* @param titleKey The title key that will store the key-value pair for the push message title.
105105
*/
106106
public void setTitleKey(String titleKey) {
107107
((SyncAndroidPushService)pushService).setTitleKey(titleKey);
108108
}
109109

110110
/**
111-
* @see com.devsu.push.sender.service.sync.SyncAndroidPushService#setMaxBulkSize(int)
111+
* Sets the quantity of push messages to be sent simultaneously on multicast requests.
112+
* <b>NOTE:</b> As of December 2016, GCM states that there's a max limit of 1.000 simultaneous
113+
* registration ids on multicast requests. See the <i>registration_ids</i> parameter <a href="https://developers.google.com/cloud-messaging/http-server-ref">here</a>.
114+
* @param maxBulkSize The quantity of push messages to be sent simultaneously on multicast requests. Has a max value of 1000.
112115
*/
113116
public void setMaxBulkSize(int maxBulkSize) {
114117
((SyncAndroidPushService)pushService).setMaxBulkSize(maxBulkSize);
115118
}
116119

117120
/**
118-
* @see com.devsu.push.sender.service.sync.SyncAndroidPushService#setCollapseKeySingle(java.lang.String)
121+
* Sets the collapse key for identifying single messages.
122+
* @param collapseKeySingle The collapse key for identifying single messages.
119123
*/
120124
public void setCollapseKeySingle(String collapseKeySingle) {
121125
((SyncAndroidPushService)pushService).setCollapseKeySingle(collapseKeySingle);
122126
}
123127

124-
/**
125-
* @see com.devsu.push.sender.service.sync.SyncAndroidPushService#setCollapseKeyBulk(java.lang.String)
128+
/**
129+
* Sets the collapse key for identifying bulk messages.
130+
* @param collapseKeyBulk The collapse key for identifying bulk messages.
126131
*/
127132
public void setCollapseKeyBulk(String collapseKeyBulk) {
128133
((SyncAndroidPushService)pushService).setCollapseKeyBulk(collapseKeyBulk);
129134
}
130135

131136
/**
132-
* @see com.devsu.push.sender.service.sync.SyncAndroidPushService#setGcmApiKey(java.lang.String)
137+
* Sets the GCM API Key (also known as Sender ID).
138+
* @param gcmApiKey The GCM API Key (also known as Sender ID).
133139
*/
134140
public void setGcmApiKey(String gcmApiKey) {
135141
((SyncAndroidPushService)pushService).setGcmApiKey(gcmApiKey);
136142
}
137143

138144
/**
139-
* @see com.devsu.push.sender.service.sync.SyncPushServiceBase#setPushEnabled(boolean)
145+
* Enables/disables this service.
146+
* @param pushEnabled The parameter that enables/disables this service.
140147
*/
141148
public void setPushEnabled(boolean pushEnabled) {
142149
((SyncAndroidPushService)pushService).setPushEnabled(pushEnabled);

src/main/java/com/devsu/push/sender/service/async/AsyncApplePushService.java

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ public class AsyncApplePushService extends AsyncPushServiceBase {
1919
private static final String BUILDER_OBJECT = PayloadBuilder.class.getSimpleName();
2020

2121
/**
22-
* @see com.devsu.push.sender.service.sync.SyncApplePushService#ApplePushService(String, String, boolean)
22+
* 3 param constructor.
23+
* @param certificatePath The path of the p12 certificate file.
24+
* @param certificatePassword The password for the p12 certificate.
25+
* @param useProductionServer Indicates if the services uses a Production environment or a Sandbox environment.
26+
* @throws RuntimeIOException An IO exception.
27+
* @throws InvalidSSLConfig Certificates are corrupted, wrong or password is wrong.
2328
*/
2429
public AsyncApplePushService(String certificatePath, String certificatePassword, boolean useProductionServer)
2530
throws RuntimeIOException, InvalidSSLConfig {
@@ -32,8 +37,8 @@ public AsyncApplePushService(String certificatePath, String certificatePassword,
3237
* @param certificatePassword The password for the p12 certificate.
3338
* @param useProductionServer Indicates if the services uses a Production environment or a Sandbox environment.
3439
* @param pushCallback The push callback.
35-
* @throws RuntimeIOException
36-
* @throws InvalidSSLConfig
40+
* @throws RuntimeIOException An IO exception.
41+
* @throws InvalidSSLConfig Certificates are corrupted, wrong or password is wrong.
3742
*/
3843
public AsyncApplePushService(String certificatePath, String certificatePassword, boolean useProductionServer, PushCallback pushCallback)
3944
throws RuntimeIOException, InvalidSSLConfig {
@@ -44,8 +49,6 @@ public AsyncApplePushService(String certificatePath, String certificatePassword,
4449
* Sends a single push message.
4550
* @param msgBuilder The PayloadBuilder object.
4651
* @param token The push token.
47-
* @return <i>true</i> if the push message request was sent.
48-
* @throws Exception
4952
*/
5053
public void sendPush(final PayloadBuilder msgBuilder, final String token) {
5154
ExecutorService executorService = Executors.newSingleThreadExecutor();
@@ -71,9 +74,7 @@ public void run() {
7174
/**
7275
* Sends a bulk push message.
7376
* @param msgBuilder The Message.Builder object.
74-
* @param token The push token.
75-
* @return <i>true</i> if the push message request was sent.
76-
* @throws Exception
77+
* @param tokens The push token.
7778
*/
7879
public void sendPushInBulk(final PayloadBuilder msgBuilder, final String... tokens) {
7980
ExecutorService executorService = Executors.newSingleThreadExecutor();
@@ -97,26 +98,39 @@ public void run() {
9798
}
9899

99100
/**
100-
* @see com.devsu.push.sender.service.sync.SyncApplePushService#setupDevelopmentServer(java.lang.String, java.lang.String)
101+
* Sets up the APNS Sandbox environment.
102+
* @param certificatePath The path of the p12 certificate file.
103+
* @param certificatePassword The password for the p12 certificate.
104+
* @throws RuntimeIOException An IO exception.
105+
* @throws InvalidSSLConfig Certificates are corrupted, wrong or password is wrong.
101106
*/
102107
public void setupDevelopmentServer(String certificatePath, String certificatePassword) throws RuntimeIOException, InvalidSSLConfig {
103108
((SyncApplePushService)pushService).setupDevelopmentServer(certificatePath, certificatePassword);
104109
}
105110

106111
/**
107-
* @see com.devsu.push.sender.service.sync.SyncApplePushService#setupProductionServer(java.lang.String, java.lang.String)
112+
* Sets up the APNS Production environment.
113+
* @param certificatePath The path of the p12 certificate file.
114+
* @param certificatePassword The password for the p12 certificate.
115+
* @throws RuntimeIOException An IO exception.
116+
* @throws InvalidSSLConfig Certificates are corrupted, wrong or password is wrong.
108117
*/
109118
public void setupProductionServer(String certificatePath, String certificatePassword) throws RuntimeIOException, InvalidSSLConfig {
110119
((SyncApplePushService)pushService).setupProductionServer(certificatePath, certificatePassword);
111120
}
112121

113122
/**
114-
* @see com.devsu.push.sender.service.sync.SyncPushServiceBase#setPushEnabled(boolean)
123+
* Enables/disables this service.
124+
* @param pushEnabled The parameter that enables/disables this service.
115125
*/
116126
public void setPushEnabled(boolean pushEnabled) {
117127
((SyncApplePushService)pushService).setPushEnabled(pushEnabled);
118128
}
119129

130+
/**
131+
* Gets a map of inactive devices.
132+
* @return a map of inactive devices.
133+
*/
120134
public Map<String, Date> getInactiveDevices() {
121135
return ((SyncApplePushService)pushService).getInactiveDevices();
122136
}

src/main/java/com/devsu/push/sender/service/sync/SyncAndroidPushService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public boolean sendPush(final String title, final String message, final Map<Stri
9797
* @param msgBuilder The Message.Builder object.
9898
* @param token The push token.
9999
* @return <i>true</i> if the push message request was sent.
100-
* @throws Exception
100+
* @throws Exception Any exception that may arise.
101101
*/
102102
public boolean sendPush(Message.Builder msgBuilder, String token) throws Exception {
103103
if (!validateToken(log, token)) {
@@ -129,9 +129,9 @@ public boolean sendPushInBulk(final String title, final String message,
129129
/**
130130
* Sends a bulk push message.
131131
* @param msgBuilder The Message.Builder object.
132-
* @param token The push token.
132+
* @param tokens The push token.
133133
* @return <i>true</i> if the push message request was sent.
134-
* @throws Exception
134+
* @throws Exception Any exception that may arise.
135135
*/
136136
public boolean sendPushInBulk(Message.Builder msgBuilder, String... tokens) throws Exception {
137137
boolean booleanResult = true;

src/main/java/com/devsu/push/sender/service/sync/SyncApplePushService.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public class SyncApplePushService extends SyncPushServiceBase {
3535
* @param certificatePath The path of the p12 certificate file.
3636
* @param certificatePassword The password for the p12 certificate.
3737
* @param useProductionServer Indicates if the services uses a Production environment or a Sandbox environment.
38-
* @throws RuntimeIOException
39-
* @throws InvalidSSLConfig
38+
* @throws RuntimeIOException An IO exception.
39+
* @throws InvalidSSLConfig Certificates are corrupted, wrong or password is wrong.
4040
*/
4141
public SyncApplePushService(String certificatePath, String certificatePassword, boolean useProductionServer)
4242
throws RuntimeIOException, InvalidSSLConfig {
@@ -77,7 +77,7 @@ public boolean sendPush(String title, String message, Map<String, String> additi
7777
* @param msgBuilder The PayloadBuilder object.
7878
* @param token The push token.
7979
* @return <i>true</i> if the push message request was sent.
80-
* @throws Exception
80+
* @throws Exception Any exception that may arise.
8181
*/
8282
public boolean sendPush(PayloadBuilder msgBuilder, String token) throws Exception {
8383
if (!validateToken(log, token)) {
@@ -111,9 +111,9 @@ public boolean sendPushInBulk(String title, String message,
111111
/**
112112
* Sends a bulk push message.
113113
* @param msgBuilder The PayloadBuilder object.
114-
* @param token The push token.
114+
* @param tokens The push token.
115115
* @return <i>true</i> if the push message request was sent.
116-
* @throws Exception
116+
* @throws Exception Any exception that may arise.
117117
*/
118118
public boolean sendPushInBulk(PayloadBuilder msgBuilder, String... tokens) throws Exception {
119119
apnsService.start();
@@ -146,8 +146,8 @@ private PayloadBuilder generateBuilder(String title, String message, Map<String,
146146
* Sets up the APNS Sandbox environment.
147147
* @param certificatePath The path of the p12 certificate file.
148148
* @param certificatePassword The password for the p12 certificate.
149-
* @throws RuntimeIOException
150-
* @throws InvalidSSLConfig
149+
* @throws RuntimeIOException An IO exception.
150+
* @throws InvalidSSLConfig Certificates are corrupted, wrong or password is wrong.
151151
*/
152152
public void setupDevelopmentServer(String certificatePath, String certificatePassword) throws RuntimeIOException, InvalidSSLConfig {
153153
apnsService = APNS.newService().withCert(certificatePath, certificatePassword).withSandboxDestination().build();
@@ -158,8 +158,8 @@ public void setupDevelopmentServer(String certificatePath, String certificatePas
158158
* Sets up the APNS Production environment.
159159
* @param certificatePath The path of the p12 certificate file.
160160
* @param certificatePassword The password for the p12 certificate.
161-
* @throws RuntimeIOException
162-
* @throws InvalidSSLConfig
161+
* @throws RuntimeIOException An IO exception.
162+
* @throws InvalidSSLConfig Certificates are corrupted, wrong or password is wrong.
163163
*/
164164
public void setupProductionServer(String certificatePath, String certificatePassword) throws RuntimeIOException, InvalidSSLConfig {
165165
apnsService = APNS.newService().withCert(certificatePath, certificatePassword).withProductionDestination().build();

src/main/java/com/devsu/push/sender/service/sync/SyncPushService.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public interface SyncPushService {
99
* @param message The push message content.
1010
* @param token The push token.
1111
* @return <i>true</i> if the push message request was sent.
12-
* @throws Exception
12+
* @throws Exception Any exception that may arise.
1313
*/
1414
boolean sendPush(String message, String token) throws Exception;
1515

@@ -19,7 +19,7 @@ public interface SyncPushService {
1919
* @param message The push message content.
2020
* @param token The push token.
2121
* @return <i>true</i> if the push message request was sent.
22-
* @throws Exception
22+
* @throws Exception Any exception that may arise.
2323
*/
2424
boolean sendPush(String title, String message, String token) throws Exception;
2525

@@ -30,7 +30,7 @@ public interface SyncPushService {
3030
* @param additionalFields The additional fields sent on the push message.
3131
* @param token The push token.
3232
* @return <i>true</i> if the push message request was sent.
33-
* @throws Exception
33+
* @throws Exception Any exception that may arise.
3434
*/
3535
boolean sendPush(String title, String message, Map<String, String> additionalFields, String token) throws Exception;
3636

@@ -39,7 +39,7 @@ public interface SyncPushService {
3939
* @param message The push message content.
4040
* @param tokens The push tokens.
4141
* @return <i>true</i> if the push message request was sent.
42-
* @throws Exception
42+
* @throws Exception Any exception that may arise.
4343
*/
4444
boolean sendPushInBulk(String message, String... tokens) throws Exception;
4545

@@ -49,7 +49,7 @@ public interface SyncPushService {
4949
* @param message The push message content.
5050
* @param tokens The push tokens.
5151
* @return <i>true</i> if the push message request was sent.
52-
* @throws Exception
52+
* @throws Exception Any exception that may arise.
5353
*/
5454
boolean sendPushInBulk(String title, String message, String... tokens) throws Exception;
5555

@@ -60,7 +60,7 @@ public interface SyncPushService {
6060
* @param additionalFields The additional fields sent on the push message.
6161
* @param tokens The push tokens.
6262
* @return <i>true</i> if the push message request was sent.
63-
* @throws Exception
63+
* @throws Exception Any exception that may arise.
6464
*/
6565
boolean sendPushInBulk(String title, String message, Map<String, String> additionalFields, String... tokens) throws Exception;
6666
}

src/main/java/com/devsu/push/sender/util/ArrayUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class ArrayUtil {
1111

1212
/**
1313
* Splits an array in a list of subarrays of size <i>maxSubArraySize</i>.
14+
* @param <T> The class of the elements in the array.
1415
* @param elementArray The array to be split.
1516
* @param maxSubArraySize The final size of the subarrays.
1617
* @return The list containing the subarrays.

0 commit comments

Comments
 (0)