Enum Class PipesMessageType

java.lang.Object
java.lang.Enum<PipesMessageType>
org.apache.tika.pipes.core.protocol.PipesMessageType
All Implemented Interfaces:
Serializable, Comparable<PipesMessageType>, Constable

public enum PipesMessageType extends Enum<PipesMessageType>
Unified message types for the PipesClient/PipesServer IPC protocol.

Replaces the separate PipesClient.COMMANDS and PipesServer.PROCESSING_STATUS enums with a single enum that carries explicit wire bytes, ACK requirements, and exit codes.

  • Enum Constant Details

  • Method Details

    • values

      public static PipesMessageType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PipesMessageType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getByte

      public byte getByte()
      Returns the single byte used on the wire for this message type.
    • requiresAck

      public boolean requiresAck()
      Returns true if the receiver must send an ACK after reading a message of this type.
    • getExitCode

      public OptionalInt getExitCode()
      Returns the exit code the server should use when exiting due to this condition, or empty if this message type does not trigger an exit.
    • lookup

      public static PipesMessageType lookup(int b)
      Looks up a message type by its wire byte.
      Parameters:
      b - the wire byte
      Returns:
      the matching message type
      Throws:
      IllegalArgumentException - if no type matches