Class AmiHeaderParser

java.lang.Object
com.siperf.amistream.protocol.parsers.AmiHeaderParser

public class AmiHeaderParser extends Object
The AmiHeaderParser class provides methods for parsing lines of AMI (Asterisk Manager Interface) headers. It identifies the type of header and creates the corresponding header object. It can also handle special headers that are not part of the standard AMI header types.

This class is static and is used to parse AMI message lines into individual header objects. Each header object is created based on the name and value of the header, and the appropriate class is instantiated based on the header type. Special headers are parsed separately from standard headers.

  • Constructor Details

    • AmiHeaderParser

      public AmiHeaderParser()
  • Method Details

    • parse

      public static Header parse(String amiMessageLine)
      Parses an AMI message line into an appropriate Header object.

      This method processes the input string, trims it, and checks for the presence of a colon (":") delimiter. If the delimiter is found, it treats the string as a standard header. Otherwise, it attempts to create a special header.

      Parameters:
      amiMessageLine - The AMI message line to be parsed, containing the header name and value.
      Returns:
      A Header object corresponding to the header type, or null if the input is invalid.