Skip to content

Commit a263201

Browse files
author
Max Presman
committed
4.1.0
1 parent 9fc2503 commit a263201

10 files changed

Lines changed: 50 additions & 9 deletions

File tree

.pubnub.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
name: java
2-
version: 4.0.14
2+
version: 4.1.0
33
schema: 1
44
scm: github.com/pubnub/java
55
changelog:
6+
- version: v4.1.0
7+
date:
8+
changes:
9+
- type: improvement
10+
text: destory now correctly forces the producer thread to shut down; stop is now deprecated for disconnect
11+
- type: improvement
12+
text: support for sending instance id for presence detection (disabled by default)
13+
- type: improvement
14+
text: support for sending request id to burst cache (enabled by default)
615
- version: v4.0.14
716
date:
817
changes:

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11

2+
## [v4.1.0](https://github.com/pubnub/java/tree/v4.1.0)
3+
4+
5+
[Full Changelog](https://github.com/pubnub/java/compare/v4.0.14...v4.1.0)
6+
7+
8+
- ⭐destory now correctly forces the producer thread to shut down; stop is now deprecated for disconnect
9+
10+
11+
12+
- ⭐support for sending instance id for presence detection (disabled by default)
13+
14+
15+
16+
- ⭐support for sending request id to burst cache (enabled by default)
17+
18+
19+
220
## [v4.0.14](https://github.com/pubnub/java/tree/v4.0.14)
321

422

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ plugins {
1010
id 'findbugs'
1111
}
1212
group = 'com.pubnub'
13-
version = '4.0.14'
13+
version = '4.1.0'
1414

1515
description = """"""
1616

src/main/java/com/pubnub/api/PNConfiguration.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@ public class PNConfiguration {
2626
* Set to true to send a UUID for PubNub instance
2727
*/
2828
@Getter
29-
@Setter(AccessLevel.NONE)
3029
private boolean includeInstanceIdentifier;
3130

3231
/**
3332
* Set to true to send a UUID on each request
3433
*/
3534
@Getter
36-
@Setter(AccessLevel.NONE)
3735
private boolean includeRequestIdentifier;
3836

3937
/**
@@ -138,7 +136,7 @@ public PNConfiguration() {
138136

139137
secure = true;
140138

141-
includeInstanceIdentifier = true;
139+
includeInstanceIdentifier = false;
142140

143141
includeRequestIdentifier = true;
144142

src/main/java/com/pubnub/api/PubNub.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class PubNub {
5656
private static final int TIMESTAMP_DIVIDER = 1000;
5757
private static final int MAX_SEQUENCE = 65535;
5858

59-
private static final String SDK_VERSION = "4.0.14";
59+
private static final String SDK_VERSION = "4.1.0";
6060

6161
public PubNub(final PNConfiguration initialConfig) {
6262
this.configuration = initialConfig;
@@ -256,6 +256,7 @@ public String getVersion() {
256256
/**
257257
* Stop the SDK and terminate all listeners.
258258
*/
259+
@Deprecated
259260
public final void stop() {
260261
subscriptionManager.stop();
261262
}
@@ -265,6 +266,7 @@ public final void stop() {
265266
*/
266267
public final void destroy() {
267268
retrofitManager.destroy();
269+
subscriptionManager.destroy();
268270
}
269271

270272
/**
@@ -274,6 +276,13 @@ public final void reconnect() {
274276
subscriptionManager.reconnect();
275277
}
276278

279+
/**
280+
* Perform a disconnect from the listeners
281+
*/
282+
public final void disconnect() {
283+
subscriptionManager.disconnect();
284+
}
285+
277286
public final Publish fire() {
278287
return publish().shouldStore(false).replicate(false);
279288
}

src/main/java/com/pubnub/api/managers/SubscriptionManager.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,15 @@ public final synchronized void disconnect() {
114114
}
115115

116116

117+
@Deprecated()
117118
public synchronized void stop() {
119+
consumerThread.interrupt();
118120
disconnect();
121+
}
122+
123+
public synchronized void destroy() {
119124
consumerThread.interrupt();
125+
this.disconnect();
120126
}
121127

122128
public final synchronized void adaptStateBuilder(final StateOperation stateOperation) {

src/test/java/com/pubnub/api/PubNubTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void getVersionAndTimeStamp() throws PubNubException {
9191
pubnub = new PubNub(pnConfiguration);
9292
String version = pubnub.getVersion();
9393
int timeStamp = pubnub.getTimestamp();
94-
Assert.assertEquals("4.0.14", version);
94+
Assert.assertEquals("4.1.0", version);
9595
Assert.assertTrue(timeStamp > 0);
9696
}
9797

src/test/java/com/pubnub/api/endpoints/EndpointTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public class EndpointTest extends TestHarness {
2222
@Before
2323
public void beforeEach() throws IOException {
2424
pubnub = this.createPubNubInstance(8080);
25+
pubnub.getConfiguration().setIncludeInstanceIdentifier(true);
2526
}
2627

2728
@Test

src/test/java/com/pubnub/api/endpoints/access/AuditEndpointTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void beforeEach() throws IOException {
3838

3939
pubnub = this.createPubNubInstance(8080);
4040
partialAudit = pubnub.audit();
41-
pubnub.getConfiguration().setSecretKey("secretKey");
41+
pubnub.getConfiguration().setSecretKey("secretKey").setIncludeInstanceIdentifier(true);
4242
wireMockRule.start();
4343

4444
}

src/test/java/com/pubnub/api/endpoints/access/GrantEndpointTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class GrantEndpointTest extends TestHarness {
3636
public void beforeEach() throws IOException {
3737
pubnub = this.createPubNubInstance(8080);
3838
partialGrant = pubnub.grant();
39-
pubnub.getConfiguration().setSecretKey("secretKey");
39+
pubnub.getConfiguration().setSecretKey("secretKey").setIncludeInstanceIdentifier(true);
4040
wireMockRule.start();
4141
}
4242

0 commit comments

Comments
 (0)