Commit 08f8ed2feb81723b717dd173e0db30d7de32b9cd
Committed by
Andrew Shvayka
1 parent
d1c89fe1
Claim device improvements (#1913)
* add-device-to-claim-result * code update * code-update * added-condition-on-empty-cache-clause * remove empty row * update code
Showing
1 changed file
with
2 additions
and
2 deletions
@@ -112,14 +112,14 @@ public class ClaimDevicesServiceImpl implements ClaimDevicesService { | @@ -112,14 +112,14 @@ public class ClaimDevicesServiceImpl implements ClaimDevicesService { | ||
112 | Device savedDevice = deviceService.saveDevice(device); | 112 | Device savedDevice = deviceService.saveDevice(device); |
113 | return Futures.transform(removeClaimingSavedData(cache, key, device), result -> new ClaimResult(savedDevice, ClaimResponse.SUCCESS)); | 113 | return Futures.transform(removeClaimingSavedData(cache, key, device), result -> new ClaimResult(savedDevice, ClaimResponse.SUCCESS)); |
114 | } | 114 | } |
115 | - return Futures.transform(removeClaimingSavedData(cache, key, device), result -> new ClaimResult(device, ClaimResponse.CLAIMED)); | 115 | + return Futures.transform(removeClaimingSavedData(cache, key, device), result -> new ClaimResult(null, ClaimResponse.CLAIMED)); |
116 | } | 116 | } |
117 | } else { | 117 | } else { |
118 | log.warn("Failed to find the device's claiming message![{}]", device.getName()); | 118 | log.warn("Failed to find the device's claiming message![{}]", device.getName()); |
119 | if(device.getCustomerId().getId().equals(ModelConstants.NULL_UUID)) { | 119 | if(device.getCustomerId().getId().equals(ModelConstants.NULL_UUID)) { |
120 | return Futures.immediateFuture(new ClaimResult(null, ClaimResponse.FAILURE)); | 120 | return Futures.immediateFuture(new ClaimResult(null, ClaimResponse.FAILURE)); |
121 | } else { | 121 | } else { |
122 | - return Futures.immediateFuture(new ClaimResult(device, ClaimResponse.CLAIMED)); | 122 | + return Futures.immediateFuture(new ClaimResult(null, ClaimResponse.CLAIMED)); |
123 | } | 123 | } |
124 | } | 124 | } |
125 | } | 125 | } |