Search in sources :

Example 1 with ProcessingPauseLockedException

use of org.graylog2.plugin.ProcessingPauseLockedException in project graylog2-server by Graylog2.

the class SystemProcessingResource method resumeProcessing.

@PUT
@Timed
@ApiOperation(value = "Resume message processing")
@Path("resume")
@AuditEvent(type = AuditEventTypes.MESSAGE_PROCESSING_START)
public void resumeProcessing() {
    checkPermission(RestPermissions.PROCESSING_CHANGESTATE, serverStatus.getNodeId().toString());
    try {
        serverStatus.resumeMessageProcessing();
    } catch (ProcessingPauseLockedException e) {
        LOG.error("Message processing pause is locked. Returning HTTP 403.");
        throw new ForbiddenException(e);
    }
    LOG.info("Resumed message processing - triggered by REST call.");
}
Also used : ForbiddenException(javax.ws.rs.ForbiddenException) ProcessingPauseLockedException(org.graylog2.plugin.ProcessingPauseLockedException) Path(javax.ws.rs.Path) Timed(com.codahale.metrics.annotation.Timed) ApiOperation(io.swagger.annotations.ApiOperation) AuditEvent(org.graylog2.audit.jersey.AuditEvent) PUT(javax.ws.rs.PUT)

Aggregations

Timed (com.codahale.metrics.annotation.Timed)1 ApiOperation (io.swagger.annotations.ApiOperation)1 ForbiddenException (javax.ws.rs.ForbiddenException)1 PUT (javax.ws.rs.PUT)1 Path (javax.ws.rs.Path)1 AuditEvent (org.graylog2.audit.jersey.AuditEvent)1 ProcessingPauseLockedException (org.graylog2.plugin.ProcessingPauseLockedException)1