Search in sources :

Example 11 with ManagementService

use of org.camunda.bpm.engine.ManagementService in project camunda-bpm-platform by camunda.

the class JobResourceImpl method setJobDuedate.

@Override
public void setJobDuedate(JobDuedateDto dto) {
    try {
        ManagementService managementService = engine.getManagementService();
        managementService.setJobDuedate(jobId, dto.getDuedate());
    } catch (AuthorizationException e) {
        throw e;
    } catch (ProcessEngineException e) {
        throw new InvalidRequestException(Status.INTERNAL_SERVER_ERROR, e.getMessage());
    }
}
Also used : ManagementService(org.camunda.bpm.engine.ManagementService) AuthorizationException(org.camunda.bpm.engine.AuthorizationException) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Example 12 with ManagementService

use of org.camunda.bpm.engine.ManagementService in project camunda-bpm-platform by camunda.

the class JobResourceImpl method setJobPriority.

@Override
public void setJobPriority(PriorityDto dto) {
    if (dto.getPriority() == null) {
        throw new RestException(Status.BAD_REQUEST, "Priority for job '" + jobId + "' cannot be null.");
    }
    try {
        ManagementService managementService = engine.getManagementService();
        managementService.setJobPriority(jobId, dto.getPriority());
    } catch (AuthorizationException e) {
        throw e;
    } catch (NotFoundException e) {
        throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage());
    } catch (ProcessEngineException e) {
        throw new RestException(Status.INTERNAL_SERVER_ERROR, e.getMessage());
    }
}
Also used : ManagementService(org.camunda.bpm.engine.ManagementService) AuthorizationException(org.camunda.bpm.engine.AuthorizationException) RestException(org.camunda.bpm.engine.rest.exception.RestException) NotFoundException(org.camunda.bpm.engine.exception.NotFoundException) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Example 13 with ManagementService

use of org.camunda.bpm.engine.ManagementService in project camunda-bpm-platform by camunda.

the class JmxManagedProcessEngine method reportDbMetrics.

public void reportDbMetrics() {
    ManagementService managementService = processEngine.getManagementService();
    managementService.reportDbMetricsNow();
}
Also used : ManagementService(org.camunda.bpm.engine.ManagementService)

Example 14 with ManagementService

use of org.camunda.bpm.engine.ManagementService in project camunda-bpm-platform by camunda.

the class JmxManagedProcessEngine method registerDeployment.

public void registerDeployment(String deploymentId) {
    ManagementService managementService = processEngine.getManagementService();
    managementService.registerDeploymentForJobExecutor(deploymentId);
}
Also used : ManagementService(org.camunda.bpm.engine.ManagementService)

Example 15 with ManagementService

use of org.camunda.bpm.engine.ManagementService in project camunda-bpm-platform by camunda.

the class JmxManagedProcessEngine method unregisterDeployment.

public void unregisterDeployment(String deploymentId) {
    ManagementService managementService = processEngine.getManagementService();
    managementService.unregisterDeploymentForJobExecutor(deploymentId);
}
Also used : ManagementService(org.camunda.bpm.engine.ManagementService)

Aggregations

ManagementService (org.camunda.bpm.engine.ManagementService)20 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)11 AuthorizationException (org.camunda.bpm.engine.AuthorizationException)6 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)6 HistoryService (org.camunda.bpm.engine.HistoryService)4 Batch (org.camunda.bpm.engine.batch.Batch)4 ArrayList (java.util.ArrayList)3 HistoricBatch (org.camunda.bpm.engine.batch.history.HistoricBatch)3 Job (org.camunda.bpm.engine.runtime.Job)3 StatisticsResultDto (org.camunda.bpm.engine.rest.dto.StatisticsResultDto)2 RestException (org.camunda.bpm.engine.rest.exception.RestException)2 HashMap (java.util.HashMap)1 BadUserRequestException (org.camunda.bpm.engine.BadUserRequestException)1 CaseService (org.camunda.bpm.engine.CaseService)1 ExternalTaskService (org.camunda.bpm.engine.ExternalTaskService)1 FilterService (org.camunda.bpm.engine.FilterService)1 FormService (org.camunda.bpm.engine.FormService)1 IdentityService (org.camunda.bpm.engine.IdentityService)1 RepositoryService (org.camunda.bpm.engine.RepositoryService)1 RuntimeService (org.camunda.bpm.engine.RuntimeService)1