@@ -56,7 +56,6 @@ public class ShadowSample {
5656 static MqttConnection connection ;
5757 static IotShadowClient shadow ;
5858 static String localValue = null ;
59- static int shadowVersion = 1 ;
6059 static CompletableFuture <Void > gotResponse ;
6160
6261 static void printUsage () {
@@ -124,7 +123,6 @@ static void parseCommandLine(String[] args) {
124123 static void onGetShadowAccepted (GetShadowResponse response ) {
125124 System .out .println ("Received initial shadow state" );
126125
127- shadowVersion = response .version ;
128126 if (response .state != null && localValue == null ) {
129127 gotResponse .complete (null );
130128 if (response .state .delta != null ) {
@@ -158,7 +156,6 @@ static void onGetShadowRejected(ErrorResponse response) {
158156
159157 static void onShadowDeltaUpdated (ShadowDeltaUpdatedEvent response ) {
160158 System .out .println ("Shadow delta updated" );
161- shadowVersion = response .version ;
162159 if (response .state != null && response .state .containsKey (SHADOW_PROPERTY )) {
163160 String value = response .state .get (SHADOW_PROPERTY ).toString ();
164161 System .out .println (" Delta wants to change value to '" + value + "'. Changing local value..." );
@@ -171,7 +168,6 @@ static void onShadowDeltaUpdated(ShadowDeltaUpdatedEvent response) {
171168 static void onUpdateShadowAccepted (UpdateShadowResponse response ) {
172169 String value = response .state .reported .get (SHADOW_PROPERTY ).toString ();
173170 System .out .println ("Shadow updated, value is " + value );
174- shadowVersion = response .version ;
175171 gotResponse .complete (null );
176172 }
177173
@@ -195,7 +191,6 @@ static CompletableFuture<Void> changeShadowValue(String value) {
195191 // build a request to let the service know our current value and desired value, and that we only want
196192 // to update if the version matches the version we know about
197193 UpdateShadowRequest request = new UpdateShadowRequest ();
198- request .version = shadowVersion ;
199194 request .thingName = thingName ;
200195 request .state = new ShadowState ();
201196 request .state .reported = new HashMap <String , Object >() {{
@@ -295,7 +290,7 @@ public void onConnectionResumed(boolean sessionPresent) {
295290 String newValue = "" ;
296291 Scanner scanner = new Scanner (System .in );
297292 while (true ) {
298- System .out .print (SHADOW_PROPERTY + "(" + shadowVersion + ") > " );
293+ System .out .print (SHADOW_PROPERTY + "> " );
299294 System .out .flush ();
300295 newValue = scanner .next ();
301296 if (newValue .compareToIgnoreCase ("quit" ) == 0 ) {
0 commit comments