Search in sources :

Example 1 with CompoundEventDetectorDao

use of com.serotonin.m2m2.db.dao.CompoundEventDetectorDao in project ma-core-public by infiniteautomation.

the class CompoundDetectorEventType method jsonWrite.

// 
// 
// Serialization
// 
@Override
public void jsonWrite(ObjectWriter writer) throws IOException, JsonException {
    super.jsonWrite(writer);
    writer.writeEntry("XID", new CompoundEventDetectorDao().getCompoundEventDetector(compoundDetectorId).getXid());
}
Also used : CompoundEventDetectorDao(com.serotonin.m2m2.db.dao.CompoundEventDetectorDao)

Example 2 with CompoundEventDetectorDao

use of com.serotonin.m2m2.db.dao.CompoundEventDetectorDao in project ma-core-public by infiniteautomation.

the class CompoundDetectorEventType method getCompoundEventDetectorId.

protected int getCompoundEventDetectorId(JsonObject json, String name) throws JsonException {
    String xid = json.getString(name);
    if (xid == null)
        throw new TranslatableJsonException("emport.error.eventType.missing.reference", name);
    CompoundEventDetectorVO ced = new CompoundEventDetectorDao().getCompoundEventDetector(xid);
    if (ced == null)
        throw new TranslatableJsonException("emport.error.eventType.invalid.reference", name, xid);
    return ced.getId();
}
Also used : CompoundEventDetectorDao(com.serotonin.m2m2.db.dao.CompoundEventDetectorDao) CompoundEventDetectorVO(com.serotonin.m2m2.vo.event.CompoundEventDetectorVO) TranslatableJsonException(com.serotonin.m2m2.i18n.TranslatableJsonException)

Aggregations

CompoundEventDetectorDao (com.serotonin.m2m2.db.dao.CompoundEventDetectorDao)2 TranslatableJsonException (com.serotonin.m2m2.i18n.TranslatableJsonException)1 CompoundEventDetectorVO (com.serotonin.m2m2.vo.event.CompoundEventDetectorVO)1