Skip to content

Commit b69a8f5

Browse files
Added ClientToken to ShadowDeltaUpdated (#263)
1 parent 1c75f3d commit b69a8f5

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

samples/Shadow/src/main/java/shadow/ShadowSample.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ static void onShadowDeltaUpdated(ShadowDeltaUpdatedEvent response) {
8484
if (response.state != null && response.state.containsKey(SHADOW_PROPERTY)) {
8585
String value = response.state.get(SHADOW_PROPERTY).toString();
8686
System.out.println(" Delta wants to change value to '" + value + "'. Changing local value...");
87+
if (!response.clientToken.isEmpty()) {
88+
System.out.print(" ClientToken: " + response.clientToken + "\n");
89+
}
8790
changeShadowValue(value);
8891
} else {
8992
System.out.println(" Delta did not report a change in " + SHADOW_PROPERTY);

sdk/src/main/java/software/amazon/awssdk/iot/iotshadow/model/ShadowDeltaUpdatedEvent.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
*/
1717
public class ShadowDeltaUpdatedEvent {
1818

19+
/**
20+
* An opaque token used to correlate requests and responses. Present only if a client token was used in the request.
21+
*
22+
*/
23+
public String clientToken;
24+
25+
1926
/**
2027
* The current version of the document for the device's shadow.
2128
*

0 commit comments

Comments
 (0)