Search in sources :

Example 1 with JobNotFoundException

use of org.codelibs.fess.exception.JobNotFoundException in project fess by codelibs.

the class ProcessHelper method sendCommand.

public void sendCommand(final String sessionId, final String command) {
    final JobProcess jobProcess = runningProcessMap.get(sessionId);
    if (jobProcess == null) {
        throw new JobNotFoundException("Job for " + sessionId + " is not found.");
    }
    try {
        final OutputStream out = jobProcess.getProcess().getOutputStream();
        IOUtils.write(command + "\n", out, Constants.CHARSET_UTF_8);
        out.flush();
    } catch (final IOException e) {
        throw new JobProcessingException(e);
    }
}
Also used : OutputStream(java.io.OutputStream) JobNotFoundException(org.codelibs.fess.exception.JobNotFoundException) IOException(java.io.IOException) JobProcess(org.codelibs.fess.util.JobProcess) JobProcessingException(org.codelibs.fess.exception.JobProcessingException)

Aggregations

IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 JobNotFoundException (org.codelibs.fess.exception.JobNotFoundException)1 JobProcessingException (org.codelibs.fess.exception.JobProcessingException)1 JobProcess (org.codelibs.fess.util.JobProcess)1