Commit d1c89fe1503ae52de3882bab73b434c1999e1f68
Committed by
Andrew Shvayka
1 parent
fa5c86f4
Added condition to response if the cache is empty. (#1912)
* add-device-to-claim-result * code update * code-update * added-condition-on-empty-cache-clause * remove empty row
Showing
1 changed file
with
5 additions
and
1 deletions
@@ -116,7 +116,11 @@ public class ClaimDevicesServiceImpl implements ClaimDevicesService { | @@ -116,7 +116,11 @@ public class ClaimDevicesServiceImpl implements ClaimDevicesService { | ||
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 | - return Futures.immediateFuture(new ClaimResult(device, ClaimResponse.CLAIMED)); | 119 | + if(device.getCustomerId().getId().equals(ModelConstants.NULL_UUID)) { |
120 | + return Futures.immediateFuture(new ClaimResult(null, ClaimResponse.FAILURE)); | ||
121 | + } else { | ||
122 | + return Futures.immediateFuture(new ClaimResult(device, ClaimResponse.CLAIMED)); | ||
123 | + } | ||
120 | } | 124 | } |
121 | } | 125 | } |
122 | 126 |