Search in sources :

Example 11 with Alarm

use of org.thingsboard.server.common.data.alarm.Alarm in project thingsboard by thingsboard.

the class BaseController method checkAlarmId.

Alarm checkAlarmId(AlarmId alarmId) throws ThingsboardException {
    try {
        validateId(alarmId, "Incorrect alarmId " + alarmId);
        Alarm alarm = alarmService.findAlarmByIdAsync(alarmId).get();
        checkAlarm(alarm);
        return alarm;
    } catch (Exception e) {
        throw handleException(e, false);
    }
}
Also used : Alarm(org.thingsboard.server.common.data.alarm.Alarm) MessagingException(javax.mail.MessagingException) IncorrectParameterException(org.thingsboard.server.dao.exception.IncorrectParameterException) ThingsboardException(org.thingsboard.server.exception.ThingsboardException) DataValidationException(org.thingsboard.server.dao.exception.DataValidationException)

Aggregations

Alarm (org.thingsboard.server.common.data.alarm.Alarm)11 TenantId (org.thingsboard.server.common.data.id.TenantId)6 UUID (java.util.UUID)3 AlarmId (org.thingsboard.server.common.data.alarm.AlarmId)3 RuleException (org.thingsboard.server.extensions.api.rules.RuleException)3 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)2 Function (com.google.common.base.Function)2 AsyncFunction (com.google.common.util.concurrent.AsyncFunction)2 Futures (com.google.common.util.concurrent.Futures)2 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 ScriptException (javax.script.ScriptException)2 Slf4j (lombok.extern.slf4j.Slf4j)2 VelocityContext (org.apache.velocity.VelocityContext)2 Autowired (org.springframework.beans.factory.annotation.Autowired)2 Component (org.springframework.stereotype.Component)2 EntityType (org.thingsboard.server.common.data.EntityType)2 AlarmInfo (org.thingsboard.server.common.data.alarm.AlarmInfo)2