Class Message


  • public class Message
    extends Object

    Encapsulates a full dbserver message, made up of a list of Field objects, and having a particular structure, as described in the Packet Analysis document.

    Known message types are found in Message.KnownType. Many requests return a series of messages that represent menu items; the known versions of these are reflected in Message.MenuItemType.

    Author:
    James Elliott
    • Field Detail

      • MESSAGE_START

        public static final NumberField MESSAGE_START
        The special field that marks the start of a new message.
      • KNOWN_TYPE_MAP

        public static final Map<Long,​Message.KnownType> KNOWN_TYPE_MAP
        Allows a known message type to be looked up by the message type number.
      • ALNZ_FILE_TYPE_DAT

        public static final int ALNZ_FILE_TYPE_DAT
        The value to pass for the file type argument of a Message.KnownType.ANLZ_TAG_REQ request in order to obtain an element of an ANLZnnnn.DAT file. (The characters "DAT" and NUL as a byte-swapped integer.)
        See Also:
        Constant Field Values
      • ALNZ_FILE_TYPE_EXT

        public static final int ALNZ_FILE_TYPE_EXT
        The value to pass for the file type argument of a Message.KnownType.ANLZ_TAG_REQ request in order to obtain an element of an ANLZnnnn.EXT file. (The characters "EXT" and NUL as a byte-swapped integer.)
        See Also:
        Constant Field Values
      • ANLZ_FILE_TAG_COLOR_WAVEFORM_PREVIEW

        public static final int ANLZ_FILE_TAG_COLOR_WAVEFORM_PREVIEW
        The value to pass for the tag type argument of a Message.KnownType.ANLZ_TAG_REQ request in order to obtain the color waveform preview data. (The characters "PWV4" as a byte-swapped integer.)
        See Also:
        Constant Field Values
      • ANLZ_FILE_TAG_COLOR_WAVEFORM_DETAIL

        public static final int ANLZ_FILE_TAG_COLOR_WAVEFORM_DETAIL
        The value to pass for the tag type argument of a Message.KnownType.ANLZ_TAG_REQ request in order to obtain the scrollable color waveform data. (The characters "PWV5" as a byte-swapped integer.)
        See Also:
        Constant Field Values
      • ANLZ_FILE_TAG_SONG_STRUCTURE

        public static final int ANLZ_FILE_TAG_SONG_STRUCTURE
        The value to pass for the tag type argument of a Message.KnownType.ANLZ_TAG_REQ request in order to obtain the song structure information data. (The characters "PSSI" as a byte-swapped integer.)
        See Also:
        Constant Field Values
      • ANLZ_FILE_TAG_CUE_COMMENT

        public static final int ANLZ_FILE_TAG_CUE_COMMENT
        The value to pass for the tag type argument of a Message.KnownType.ANLZ_TAG_REQ request in order to obtain the enhanced cue and loop data, but does not seem to work. (The characters "PCO2" as a byte-swapped integer.)
        See Also:
        Constant Field Values
      • transaction

        public final NumberField transaction
        The 4-byte number field that provides the sequence number tying a query to its response messages, immediately following the message start field.
      • messageType

        public final NumberField messageType
        The 2-byte number field that identifies what type of message this is, immediately following the transaction sequence number.
      • knownType

        public final Message.KnownType knownType
        The recognized type, if any, of this message.
      • argumentCount

        public final NumberField argumentCount
        The 1-byte number field that specifies how many arguments the message has.
      • arguments

        public final List<Field> arguments
        The arguments being sent as part of this message.
      • fields

        public final List<Field> fields
        The entire list of fields that make up the message.
      • MENU_IDENTIFIER_MAP

        public static final Map<Byte,​Message.MenuIdentifier> MENU_IDENTIFIER_MAP
        Allows a menu/destination to be looked up by the value seen in the second byte of the first argument of many request messages.
      • NO_MENU_RESULTS_AVAILABLE

        public static final long NO_MENU_RESULTS_AVAILABLE
        The value returned by getMenuResultsCount() when there is no data available for the request that was made.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Message

        public Message​(long transaction,
                       long messageType,
                       Field... arguments)
        Constructor for experimenting with new message types.
        Parameters:
        transaction - the transaction ID (sequence number) that ties a message to its responses
        messageType - identifies the purpose and structure of the message
        arguments - the arguments to send with the message
      • Message

        public Message​(long transaction,
                       Message.KnownType messageType,
                       Field... arguments)
        Constructor from code using known message types.
        Parameters:
        transaction - the transaction ID (sequence number) that ties a message to its responses
        messageType - identifies the purpose and structure of the message
        arguments - the arguments to send with the message
      • Message

        public Message​(NumberField transaction,
                       NumberField messageType,
                       Field... arguments)
        Constructor when being read from the network, so already have all the fields created.
        Parameters:
        transaction - the transaction ID (sequence number) that ties a message to its responses
        messageType - identifies the purpose and structure of the message
        arguments - the arguments to send with the message