|
|
@ -97,7 +97,7 @@ public class DeviceTaskManagerImpl implements DeviceTaskManager {
|
|
|
|
List<Device> devices = deviceManagementProviderService.getAllDevices();
|
|
|
|
List<Device> devices = deviceManagementProviderService.getAllDevices();
|
|
|
|
List<String> operations = this.getValidOperationNames();
|
|
|
|
List<String> operations = this.getValidOperationNames();
|
|
|
|
|
|
|
|
|
|
|
|
if(!devices.isEmpty()) {
|
|
|
|
if (!devices.isEmpty()) {
|
|
|
|
|
|
|
|
|
|
|
|
for (String str : operations) {
|
|
|
|
for (String str : operations) {
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
@ -107,7 +107,7 @@ public class DeviceTaskManagerImpl implements DeviceTaskManager {
|
|
|
|
deviceManagementProviderService.addOperation(operation, DeviceManagerUtil.convertDevices(devices));
|
|
|
|
deviceManagementProviderService.addOperation(operation, DeviceManagerUtil.convertDevices(devices));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if(log.isDebugEnabled()){
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
log.debug("No devices are available to perform the operations.");
|
|
|
|
log.debug("No devices are available to perform the operations.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -142,10 +142,26 @@ public class DeviceTaskManagerImpl implements DeviceTaskManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(log.isDebugEnabled()){
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
log.debug("Valid operation names are : " + Arrays.toString(opNames.toArray()));
|
|
|
|
log.debug("Valid operation names are : " + Arrays.toString(opNames.toArray()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return opNames;
|
|
|
|
return opNames;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public boolean isTaskOperation(String opName) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
List<TaskOperation> taskOperations = this.getOperationList();
|
|
|
|
|
|
|
|
for (TaskOperation taop : taskOperations) {
|
|
|
|
|
|
|
|
if (taop.getTaskName().equalsIgnoreCase(opName)) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (DeviceMgtTaskException e) {
|
|
|
|
|
|
|
|
// ignoring the error, no need to throw, If error occurs, return value will be false.
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|