dilanua 8 years ago
commit e79eeb6d0f

@ -23,7 +23,6 @@ import org.wso2.carbon.device.mgt.common.license.mgt.License;
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;

@ -399,7 +399,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
monitoringOperation.setCode(OPERATION_MONITOR); monitoringOperation.setCode(OPERATION_MONITOR);
// CommandOperation infoOperation = new CommandOperation(); // CommandOperation infoOperation = new CommandOperation();
// infoOperation.setEnabled(true); // infoOperation.setEnabled(true);
// infoOperation.setType(Operation.Type.COMMAND); // infoOperation.setType(Operation.Type.COMMAND);\\
// infoOperation.setCode(OPERATION_INFO); // infoOperation.setCode(OPERATION_INFO);
// CommandOperation appListOperation = new CommandOperation(); // CommandOperation appListOperation = new CommandOperation();
// appListOperation.setEnabled(true); // appListOperation.setEnabled(true);
@ -411,7 +411,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
if (deviceIdentifiers.size() > 0) { if (deviceIdentifiers.size() > 0) {
type = deviceIdentifiers.get(0).getType(); type = deviceIdentifiers.get(0).getType();
} }
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService service = PolicyManagementDataHolder.getInstance().getDeviceManagementService();
service.addOperation(type, monitoringOperation, deviceIdentifiers); service.addOperation(type, monitoringOperation, deviceIdentifiers);
// service.addOperation(infoOperation, deviceIdentifiers); // service.addOperation(infoOperation, deviceIdentifiers);
// service.addOperation(appListOperation, deviceIdentifiers); // service.addOperation(appListOperation, deviceIdentifiers);

@ -117,10 +117,12 @@ public class MonitoringTask implements Task {
log.debug(device.getDeviceIdentifier()); log.debug(device.getDeviceIdentifier());
} }
} }
if (!notifiableDevices.isEmpty()) {
monitoringManager.addMonitoringOperation(notifiableDevices); monitoringManager.addMonitoringOperation(notifiableDevices);
monitoringService.notifyDevices(notifiableDevices); monitoringService.notifyDevices(notifiableDevices);
} }
} }
}
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Monitoring task running completed."); log.debug("Monitoring task running completed.");
} }

Loading…
Cancel
Save