Search in sources :

Example 1 with PollingDataSourceVO

use of com.serotonin.m2m2.vo.dataSource.PollingDataSourceVO in project ma-core-public by infiniteautomation.

the class DataSourceService method forceDataSourcePoll.

private void forceDataSourcePoll(DataSourceVO vo) {
    if (vo instanceof PollingDataSourceVO) {
        PermissionHolder user = Common.getUser();
        ensureEditPermission(user, vo);
        Common.runtimeManager.forceDataSourcePoll(vo.getId());
    } else {
        throw new TranslatableIllegalStateException(new TranslatableMessage("dsEdit.failedForcePoll", vo.getName()));
    }
}
Also used : PollingDataSourceVO(com.serotonin.m2m2.vo.dataSource.PollingDataSourceVO) TranslatableIllegalStateException(com.infiniteautomation.mango.util.exception.TranslatableIllegalStateException) TranslatableMessage(com.serotonin.m2m2.i18n.TranslatableMessage) PermissionHolder(com.serotonin.m2m2.vo.permission.PermissionHolder)

Aggregations

TranslatableIllegalStateException (com.infiniteautomation.mango.util.exception.TranslatableIllegalStateException)1 TranslatableMessage (com.serotonin.m2m2.i18n.TranslatableMessage)1 PollingDataSourceVO (com.serotonin.m2m2.vo.dataSource.PollingDataSourceVO)1 PermissionHolder (com.serotonin.m2m2.vo.permission.PermissionHolder)1