mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Remove operation existence check in update operation
This commit is contained in:
parent
66a30ef131
commit
1112b285d5
@ -1912,16 +1912,9 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
||||
device.getType());
|
||||
}
|
||||
try {
|
||||
DeviceIdentifier deviceIdentifier = new DeviceIdentifier(device.getDeviceIdentifier(), device.getType());
|
||||
if (!pluginRepository.getOperationManager(device.getType(), this.getTenantId())
|
||||
.isOperationExist(deviceIdentifier, operation.getId())) {
|
||||
String msg = "Operation with operation id: " + operation.getId()
|
||||
+ " does not exist.";
|
||||
log.error(msg);
|
||||
throw new BadRequestException(msg);
|
||||
}
|
||||
pluginRepository.getOperationManager(device.getType(), this.getTenantId())
|
||||
.updateOperation(deviceIdentifier, operation);
|
||||
.updateOperation(device.getEnrolmentInfo().getId(), operation,
|
||||
new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
|
||||
if (DeviceManagerUtil.isPublishOperationResponseEnabled()) {
|
||||
List<String> permittedOperations = DeviceManagerUtil.getEnabledOperationsForResponsePublish();
|
||||
if (permittedOperations.contains(operation.getCode())
|
||||
@ -1948,10 +1941,6 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
||||
String msg = "Error occurred while publishing event.";
|
||||
log.error(msg, e);
|
||||
throw new OperationManagementException(msg, e);
|
||||
} catch (BadRequestException e) {
|
||||
String msg = "Error occurred due to invalid request";
|
||||
log.error(msg, e);
|
||||
throw new OperationManagementException(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user