Search in sources :

Example 11 with UserCommentVO

use of com.serotonin.m2m2.vo.comment.UserCommentVO in project ma-core-public by infiniteautomation.

the class EventDao method insertEvent.

private void insertEvent(EventInstance event) {
    EventType type = event.getEventType();
    Object[] args = new Object[11];
    args[0] = type.getEventType();
    args[1] = type.getEventSubtype();
    args[2] = type.getReferenceId1();
    args[3] = type.getReferenceId2();
    args[4] = event.getActiveTimestamp();
    args[5] = boolToChar(event.isRtnApplicable());
    if (!event.isActive()) {
        args[6] = event.getRtnTimestamp();
        args[7] = event.getRtnCause();
    }
    args[8] = event.getAlarmLevel();
    args[9] = writeTranslatableMessage(event.getMessage());
    // For None Level Events
    // if (event.getAlarmLevel() == AlarmLevels.DO_NOT_LOG) {
    // event.setAcknowledgedTimestamp(event.getActiveTimestamp());
    // args[10] = event.getAcknowledgedTimestamp();
    // }
    event.setId(doInsert(EVENT_INSERT, args, EVENT_INSERT_TYPES));
    event.setEventComments(new LinkedList<UserCommentVO>());
}
Also used : AuditEventType(com.serotonin.m2m2.rt.event.type.AuditEventType) MissingEventType(com.serotonin.m2m2.rt.event.type.MissingEventType) DataSourceEventType(com.serotonin.m2m2.rt.event.type.DataSourceEventType) EventType(com.serotonin.m2m2.rt.event.type.EventType) SystemEventType(com.serotonin.m2m2.rt.event.type.SystemEventType) DataPointEventType(com.serotonin.m2m2.rt.event.type.DataPointEventType) PublisherEventType(com.serotonin.m2m2.rt.event.type.PublisherEventType) UserCommentVO(com.serotonin.m2m2.vo.comment.UserCommentVO)

Aggregations

UserCommentVO (com.serotonin.m2m2.vo.comment.UserCommentVO)11 UserCommentModel (com.serotonin.m2m2.web.mvc.rest.v1.model.comment.UserCommentModel)5 RestProcessResult (com.serotonin.m2m2.web.mvc.rest.v1.message.RestProcessResult)4 ApiOperation (com.wordnik.swagger.annotations.ApiOperation)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 User (com.serotonin.m2m2.vo.User)3 JsonGetter (com.fasterxml.jackson.annotation.JsonGetter)1 JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)1 JsonSetter (com.fasterxml.jackson.annotation.JsonSetter)1 InvalidRQLRestException (com.infiniteautomation.mango.rest.v2.exception.InvalidRQLRestException)1 ShouldNeverHappenException (com.serotonin.ShouldNeverHappenException)1 EventDao (com.serotonin.m2m2.db.dao.EventDao)1 EventInstance (com.serotonin.m2m2.rt.event.EventInstance)1 AuditEventType (com.serotonin.m2m2.rt.event.type.AuditEventType)1 DataPointEventType (com.serotonin.m2m2.rt.event.type.DataPointEventType)1 DataSourceEventType (com.serotonin.m2m2.rt.event.type.DataSourceEventType)1 EventType (com.serotonin.m2m2.rt.event.type.EventType)1 MissingEventType (com.serotonin.m2m2.rt.event.type.MissingEventType)1 PublisherEventType (com.serotonin.m2m2.rt.event.type.PublisherEventType)1 SystemEventType (com.serotonin.m2m2.rt.event.type.SystemEventType)1