Class ServerStatus

java.lang.Object
org.apache.tika.server.core.ServerStatus

public class ServerStatus extends Object
Read-only server status for tracking active tasks and statistics.

This class provides observability into server activity. With pipes-based parsing, timeouts and process crashes are handled by the pipes infrastructure, so this class no longer triggers server shutdowns.

  • Constructor Details

    • ServerStatus

      public ServerStatus()
  • Method Details

    • start

      public long start(ServerStatus.TASK task, String fileName)
      Records the start of a task and returns a task ID for tracking.
      Parameters:
      task - the type of task
      fileName - the file being processed (for diagnostics)
      Returns:
      the task ID
    • complete

      public void complete(long taskId) throws IllegalArgumentException
      Removes the task from the collection of currently running tasks.
      Parameters:
      taskId - the task ID returned from start()
      Throws:
      IllegalArgumentException - if there is no task by that taskId
    • getTasks

      public Map<Long,TaskStatus> getTasks()
      Returns a snapshot of currently running tasks.
    • getFilesProcessed

      public long getFilesProcessed()
      Returns the total number of tasks started since server startup.
    • getMillisSinceLastParseStarted

      public long getMillisSinceLastParseStarted()
      Returns milliseconds since the last task was started.