Search in sources :

Example 1 with ConsistencyCheckTask

use of org.exist.storage.ConsistencyCheckTask in project exist by eXist-db.

the class SanityReport method triggerCheck.

@Override
public void triggerCheck(String output, String backup, String incremental) {
    try {
        this.output = output;
        final SystemTask task = new ConsistencyCheckTask();
        final Properties properties = parseParameter(output, backup, incremental);
        task.configure(pool.getConfiguration(), properties);
        pool.triggerSystemTask(task);
    } catch (final EXistException existException) {
        taskstatus.setStatus(TaskStatus.Status.STOPPED_ERROR);
        final List<ErrorReport> errors = new ArrayList<>();
        errors.add(new ErrorReport(ErrorReport.CONFIGURATION_FAILD, existException.getMessage(), existException));
        taskstatus.setReason(errors);
        changeStatus(taskstatus);
        taskstatus.setStatusChangeTime();
        taskstatus.setReason(existException.toString());
        LOG.warn("Failed to trigger db sanity check: {}", existException.getMessage(), existException);
    }
}
Also used : ErrorReport(org.exist.backup.ErrorReport) SystemTask(org.exist.storage.SystemTask) ConsistencyCheckTask(org.exist.storage.ConsistencyCheckTask) EXistException(org.exist.EXistException)

Aggregations

EXistException (org.exist.EXistException)1 ErrorReport (org.exist.backup.ErrorReport)1 ConsistencyCheckTask (org.exist.storage.ConsistencyCheckTask)1 SystemTask (org.exist.storage.SystemTask)1