Class: RequestOk
REQUEST_OK (0x7) answers PUBLISH, REQUEST_UPDATE, TRACK_STATUS, SUBSCRIBE_NAMESPACE, SUBSCRIBE_TRACKS and PUBLISH_NAMESPACE. There is one wire type; the per-request-type names (PUBLISH_OK, TRACK_STATUS_OK, ...) are shorthands for logging, not distinct messages. SUBSCRIBE_OK (0x4) and FETCH_OK (0x18) do keep bodies of their own.
It carries no Request ID: the request stream it arrives on identifies the request.
Constructors
Constructor
new RequestOk(
parameters?,trackProperties?):RequestOk
Parameters
parameters?
MessageParameter[] = []
trackProperties?
TrackProperty[] = []
Returns
RequestOk
Properties
parameters
readonlyparameters:MessageParameter[]
trackProperties
readonlytrackProperties:TrackProperty[]
Track Properties, which the trailing bytes of the payload carry with no count of their own. Populated only in TRACK_STATUS_OK; empty for every other request type — see RequestOk.validateTrackProperties.
Methods
getType()
getType():
ControlMessageType
Returns
serialize()
serialize():
FrozenByteBuffer
Returns
validateTrackProperties()
validateTrackProperties(
answersTrackStatus):void
Track Properties may only be non-empty when this REQUEST_OK answers a TRACK_STATUS request (§10.5). A receiver that sees them in any other REQUEST_OK — PUBLISH_OK, REQUEST_UPDATE_OK, SUBSCRIBE_NAMESPACE_OK or PUBLISH_NAMESPACE_OK — MUST close the session with a PROTOCOL_VIOLATION.
Parameters
answersTrackStatus
boolean
Returns
void
Throws
:ProtocolViolationError If Track Properties are present and this REQUEST_OK does not answer a TRACK_STATUS.
parsePayload()
staticparsePayload(buf):RequestOk
Parses a REQUEST_OK body. buf must hold exactly the payload: whatever follows the parameters is read as Track Properties, so trailing bytes from a longer buffer would be parsed as properties.
Parameters
buf
Returns
RequestOk