@Immutable public abstract class ImmutableCastMessage extends Object
CastChannel.CastMessage,
which allows incoming messages be passed around to multiple threads without
risking mutation.| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableCastMessage.ImmutableBinaryCastMessage
An
ImmutableCastMessage implementation for binary payloads. |
static class |
ImmutableCastMessage.ImmutableStringCastMessage
An
ImmutableCastMessage implementation for string payloads. |
| Modifier and Type | Field and Description |
|---|---|
protected String |
destinationId
The destination ID.
|
protected String |
namespace
The namespace, the core multiplexing key.
|
protected CastChannel.CastMessage.ProtocolVersion |
protocolVersion
The protocol version
|
protected String |
sourceId
The source ID.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ImmutableCastMessage(String destinationId,
String namespace,
CastChannel.CastMessage.ProtocolVersion protocolVersion,
String sourceId)
Abstract constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static ImmutableCastMessage |
create(CastChannel.CastMessage message)
Creates either an
ImmutableCastMessage.ImmutableStringCastMessage or an
ImmutableCastMessage.ImmutableBinaryCastMessage depending on the payload type, which
holds the data from the specified CastChannel.CastMessage. |
String |
getDestinationId()
The source and destination IDs identify the origin and destination of a
message.
|
String |
getNamespace() |
CastChannel.CastMessage.ProtocolVersion |
getProtocolVersion() |
String |
getSourceId()
The source and destination IDs identify the origin and destination of a
message.
|
@Nonnull protected final String destinationId
The source and destination IDs identify the origin and destination of a message. They are used to route messages between endpoints that share a device-to-device channel.
For messages between applications:
sender-0' and 'receiver-0' can be used.
For messages intended for all endpoints using a given channel, the
wildcard destination_id '*' can be used.
@Nonnull protected final String namespace
@Nonnull protected final CastChannel.CastMessage.ProtocolVersion protocolVersion
@Nonnull protected final String sourceId
The source and destination IDs identify the origin and destination of a message. They are used to route messages between endpoints that share a device-to-device channel.
For messages between applications:
sender-0' and 'receiver-0' can be used.
For messages intended for all endpoints using a given channel, the
wildcard destination_id '*' can be used.
protected ImmutableCastMessage(@Nonnull String destinationId, @Nonnull String namespace, @Nonnull CastChannel.CastMessage.ProtocolVersion protocolVersion, @Nonnull String sourceId)
destinationId - the destination ID.namespace - the namespace.protocolVersion - the protocol version.sourceId - the source ID.IllegalArgumentException - If any of the parameters are null.@Nonnull public String getDestinationId()
For messages between applications:
sender-0' and 'receiver-0' can be used.
For messages intended for all endpoints using a given channel, the
wildcard destination_id '*' can be used.
@Nonnull public String getNamespace()
@Nonnull public CastChannel.CastMessage.ProtocolVersion getProtocolVersion()
@Nonnull public String getSourceId()
For messages between applications:
sender-0' and 'receiver-0' can be used.
For messages intended for all endpoints using a given channel, the
wildcard destination_id '*' can be used.
@Nonnull public static ImmutableCastMessage create(@Nonnull CastChannel.CastMessage message)
ImmutableCastMessage.ImmutableStringCastMessage or an
ImmutableCastMessage.ImmutableBinaryCastMessage depending on the payload type, which
holds the data from the specified CastChannel.CastMessage.message - the CastChannel.CastMessage to get the data from.ImmutableCastMessage instance.IllegalArgumentException - If any of the required fields of
message is null.Copyright © 2022. All rights reserved.