Search in sources :

Example 56 with PublishedPointVO

use of com.serotonin.m2m2.vo.publish.PublishedPointVO in project ma-core-public by MangoAutomation.

the class PublishedPointDao method saveEnabledColumn.

/**
 * Update the enabled column
 *
 * @param existing point for which to update the enabled column
 * @param enabled if the point should be enabled or disabled
 * @return updated publshed point
 */
public PublishedPointVO saveEnabledColumn(PublishedPointVO existing, boolean enabled) {
    create.update(table).set(table.enabled, boolToChar(enabled)).where(table.id.eq(existing.getId())).execute();
    PublishedPointVO result = existing.copy();
    result.setEnabled(enabled);
    this.publishEvent(new DaoEvent<>(this, DaoEventType.UPDATE, result, existing));
    this.publishAuditEvent(new ToggleAuditEvent<>(this.auditEventType, Common.getUser(), result));
    return result;
}
Also used : PublishedPointVO(com.serotonin.m2m2.vo.publish.PublishedPointVO)

Aggregations

PublishedPointVO (com.serotonin.m2m2.vo.publish.PublishedPointVO)34 MockPublishedPointVO (com.serotonin.m2m2.vo.publish.mock.MockPublishedPointVO)16 Test (org.junit.Test)12 DataPointVO (com.serotonin.m2m2.vo.DataPointVO)9 IDataPoint (com.serotonin.m2m2.vo.IDataPoint)8 MockPublisherVO (com.serotonin.m2m2.vo.publish.mock.MockPublisherVO)8 JsonException (com.serotonin.json.JsonException)6 PermissionHolder (com.serotonin.m2m2.vo.permission.PermissionHolder)6 PublisherVO (com.serotonin.m2m2.vo.publish.PublisherVO)6 NonNull (org.checkerframework.checker.nullness.qual.NonNull)6 NotFoundException (com.infiniteautomation.mango.util.exception.NotFoundException)4 ValidationException (com.infiniteautomation.mango.util.exception.ValidationException)4 ProcessResult (com.serotonin.m2m2.i18n.ProcessResult)4 TranslatableJsonException (com.serotonin.m2m2.i18n.TranslatableJsonException)4 TranslatableMessage (com.serotonin.m2m2.i18n.TranslatableMessage)4 PublisherRT (com.serotonin.m2m2.rt.publish.PublisherRT)4 ApiOperation (io.swagger.annotations.ApiOperation)4 ArrayList (java.util.ArrayList)4 URI (java.net.URI)3 HttpHeaders (org.springframework.http.HttpHeaders)3