Skip to content

Commit 2d16fdd

Browse files
author
Max Presman
committed
connect announcement
1 parent 413935c commit 2d16fdd

24 files changed

Lines changed: 147 additions & 13 deletions

‎src/main/java/com/pubnub/api/endpoints/Endpoint.java‎

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -230,18 +230,22 @@ protected final Map<String, String> createBaseParams() {
230230
params.put("uuid", this.pubnub.getConfiguration().getUuid());
231231

232232
// add the auth key for publish and subscribe.
233-
if (this.pubnub.getConfiguration().getAuthKey() != null) {
234-
if (getOperationType() == PNOperationType.PNPublishOperation
235-
|| getOperationType() == PNOperationType.PNSubscribeOperation
236-
|| getOperationType() == PNOperationType.PNHistoryOperation) {
233+
if (this.pubnub.getConfiguration().getAuthKey() != null && isAuthRequired()) {
237234
params.put("auth", pubnub.getConfiguration().getAuthKey());
238-
}
239235
}
240236

241237

242238
return params;
243239
}
244240

241+
protected List<String> getAffectedChannels() {
242+
return null;
243+
}
244+
245+
protected List<String> getAffectedChannelGroups() {
246+
return null;
247+
}
248+
245249
protected abstract void validateParams() throws PubNubException;
246250

247251
protected abstract Call<Input> doWork(Map<String, String> baseParams) throws PubNubException;
@@ -255,13 +259,6 @@ protected final Map<String, String> createBaseParams() {
255259

256260
protected abstract PNOperationType getOperationType();
257261

258-
protected List<String> getAffectedChannels() {
259-
return null;
260-
}
261-
262-
protected List<String> getAffectedChannelGroups() {
263-
return null;
264-
}
265-
262+
protected abstract boolean isAuthRequired();
266263

267264
}

‎src/main/java/com/pubnub/api/endpoints/History.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ protected PNOperationType getOperationType() {
131131
return PNOperationType.PNHistoryOperation;
132132
}
133133

134+
@Override
135+
protected boolean isAuthRequired() {
136+
return true;
137+
}
138+
134139
private Object processMessage(JsonNode message) throws PubNubException {
135140
if (this.getPubnub().getConfiguration().getCipherKey() == null) {
136141
return message;

‎src/main/java/com/pubnub/api/endpoints/Time.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,9 @@ protected PNOperationType getOperationType() {
6060
return PNOperationType.PNTimeOperation;
6161
}
6262

63+
@Override
64+
protected boolean isAuthRequired() {
65+
return false;
66+
}
67+
6368
}

‎src/main/java/com/pubnub/api/endpoints/access/Audit.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,9 @@ protected PNOperationType getOperationType() {
119119
return PNOperationType.PNAccessManagerAudit;
120120
}
121121

122+
@Override
123+
protected boolean isAuthRequired() {
124+
return false;
125+
}
126+
122127
}

‎src/main/java/com/pubnub/api/endpoints/access/Grant.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,9 @@ protected PNOperationType getOperationType() {
178178
return PNOperationType.PNAccessManagerGrant;
179179
}
180180

181+
@Override
182+
protected boolean isAuthRequired() {
183+
return false;
184+
}
185+
181186
}

‎src/main/java/com/pubnub/api/endpoints/channel_groups/AddChannelChannelGroup.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,9 @@ protected PNOperationType getOperationType() {
7272
return PNOperationType.PNAddChannelsToGroupOperation;
7373
}
7474

75+
@Override
76+
protected boolean isAuthRequired() {
77+
return true;
78+
}
79+
7580
}

‎src/main/java/com/pubnub/api/endpoints/channel_groups/AllChannelsChannelGroup.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,9 @@ protected PNOperationType getOperationType() {
6868
return PNOperationType.PNChannelsForGroupOperation;
6969
}
7070

71+
@Override
72+
protected boolean isAuthRequired() {
73+
return true;
74+
}
75+
7176
}

‎src/main/java/com/pubnub/api/endpoints/channel_groups/DeleteChannelGroup.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,9 @@ protected PNOperationType getOperationType() {
5858
return PNOperationType.PNRemoveGroupOperation;
5959
}
6060

61+
@Override
62+
protected boolean isAuthRequired() {
63+
return true;
64+
}
65+
6166
}

‎src/main/java/com/pubnub/api/endpoints/channel_groups/ListAllChannelGroup.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,9 @@ protected PNOperationType getOperationType() {
6363
return PNOperationType.PNChannelGroupsOperation;
6464
}
6565

66+
@Override
67+
protected boolean isAuthRequired() {
68+
return true;
69+
}
70+
6671
}

‎src/main/java/com/pubnub/api/endpoints/channel_groups/RemoveChannelChannelGroup.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,9 @@ protected PNOperationType getOperationType() {
7272
return PNOperationType.PNRemoveChannelsFromGroupOperation;
7373
}
7474

75+
@Override
76+
protected boolean isAuthRequired() {
77+
return true;
78+
}
79+
7580
}

0 commit comments

Comments
 (0)