Package org.deepsymmetry.beatlink.dbserver
Provides an interface to the database servers running on Pioneer players.
The ConnectionManager
knows how to locate the database servers running
on the players, and once started, can establish and share connections to them using the
ConnectionManager.invokeWithClientSession(int, org.deepsymmetry.beatlink.dbserver.ConnectionManager.ClientTask, java.lang.String)
method.
Requests and responses to and from the database servers are structured as messages, encapsulated by the
Message
class, and these are made up of fields, encapsulated by
subclasses of Field
. The known message types are found in
Message.KnownType
Background
This project is based on research performed with dysentery, and the packet analysis resulting from that project.
- Author:
- James Elliott
-
Interface Summary Interface Description ConnectionManager.ClientTask<T> An interface for all the kinds of activities that need a connection to the dbserver, so we can keep track of how many sessions are in effect, clean up after them, and know when the client is idle and can be closed. -
Class Summary Class Description BinaryField A binary field holds an arbitrary sequence of bytes whose length is determined by the 4-byte big-endian integer that follows the type tag.Client Manages a connection to the dbserver port on a particular player, allowing queries to be sent, and their responses to be interpreted.ConnectionManager Manges connections to dbserver ports on the players, offering sessions that can be used to perform transactions, and allowing the connections to close when there are no active sessions.Field All dbserver messages are made up of lists of fields, which are type-tagged values.Message Encapsulates a full dbserver message, made up of a list ofField
objects, and having a particular structure, as described in the Packet Analysis document.NumberField A number field represents an integer, and can take up 1, 2, or 4 bytes, depending on the tag which introduces it.StringField A string field holds a UTF8-BE encoded string whose length is determined by the 4-byte big-endian integer that follows the type tag. -
Enum Summary Enum Description Message.KnownType Defines all the message types we know about, with any information we know about their arguments.Message.MenuIdentifier For many types of query messages, the first argument of the message is a 4-byte integer which we currently refer to as r:m:s:t, because the first byte is the player number of the player making the request, the second byte identifies the menu or destination for which information is being loaded, the third byte identifies the media slot (USB or SD) being asked about (as described inCdjStatus.TrackSourceSlot
), and the fourth byte identifies the type of track being worked with (for most requests this is 1, meaning rekordbox).Message.MenuItemType Defines all the known types of entries that an be returned for a menu request.