Class ManagementProtocolHeader

java.lang.Object
org.jboss.as.protocol.mgmt.ManagementProtocolHeader
Direct Known Subclasses:
ManagementByeByeHeader, ManagementPingHeader, ManagementPongHeader, ManagementRequestHeader, ManagementResponseHeader

public abstract class ManagementProtocolHeader extends Object
ManagementProtocol header used to send the required information to establish a request with a remote controller. The primary pieces of the request are the protocol signature and the protocol version being used.
Author:
John Bailey, Kabir Khan
  • Constructor Details

    • ManagementProtocolHeader

      protected ManagementProtocolHeader(int version)
      Construct an instance with the protocol version for the header.
      Parameters:
      version - The protocol version
  • Method Details

    • write

      public void write(DataOutput output) throws IOException
      Write the header information to the provided DataOutput.
      Parameters:
      output - The output to write to
      Throws:
      IOException - If any problems occur writing to the output
    • getVersion

      public int getVersion()
      The protocol version for the current communication.
      Returns:
      The protocol version
    • getType

      public abstract byte getType()
      The type
      Returns:
      the protocol byte identifying the type
    • validateSignature

      protected static void validateSignature(DataInput input) throws IOException
      Validate the header signature.
      Parameters:
      input - The input to read the signature from
      Throws:
      IOException - If any read problems occur
    • cast

      protected <T extends ManagementProtocolHeader> T cast(Class<T> expected)
    • parse

      public static ManagementProtocolHeader parse(DataInput input) throws IOException
      Parses the input stream to read the header
      Parameters:
      input - data input to read from
      Returns:
      the parsed protocol header
      Throws:
      IOException