Package com.cygnusreach.messages

Types

Link copied to clipboard
class Command(    val data: IMessageBufferReader,     val tag: String,     val category: Int,     val acknowledgeOn: Byte = CommandAcknowledgementType.received) : Message

A Command is a request from one side of the peer connection that some action be performed by the other side of the peer connection. The peer can either respond by acknowledging the command when it is received or when it is finished executing. The peer may also respond with an error

Link copied to clipboard
open class CommandAcknowledgement(val acknowledging: String)

A CommandAcknowledgement is a message that is sent in response to a Command from the connected peer. It indicates that either:

Link copied to clipboard
class CommandError(    val acknowledging: String,     val code: Long,     val error: String) : CommandAcknowledgement

CommandError is a CommandAcknowledgement that provides error information that occurred in response to a Command.

Link copied to clipboard
enum DefaultCategory : Enum<DefaultCategory> , IUserMessageCategory

Default category values used by IRemoteSupportClient.sendChat, IRemoteSupportClient.sendBytes, IRemoteSupportClient.sendLogMessage, and IRemoteSupportClient.sendObject

Link copied to clipboard
enum DefaultTag : Enum<DefaultTag> , IUserMessageTag

Default tag values used by IRemoteSupportClient.sendChat, IRemoteSupportClient.sendBytes, IRemoteSupportClient.sendLogMessage, and IRemoteSupportClient.sendObject

Link copied to clipboard
interface IAsyncReceipt<T>

Allows a sender to wait for responses and acknowledgements from a remote peer

Link copied to clipboard
interface ICommandContext

Contains actions that can be taken in response to a command

Link copied to clipboard
interface ICommandReceipt : IAsyncReceipt<Unit>

Notifies a sender that a command has been acknowledged by the peer

Link copied to clipboard
interface IMessageError

User defined status code and message. Can be used to organize error messages using enum classes

Link copied to clipboard
interface IQueryContext

IQueryContext is created when a Query is received from a peer. It declares the actions that that can be taken in response to a remote support query.

Link copied to clipboard
interface IQueryReceipt : IAsyncReceipt<QueryResponse>

Notifies a sender of QueryResponses from the peer.

Link copied to clipboard
interface IUserMessageCategory

Provides an integer value to be used as a category. Can be helpful when defining categories using an enum class for use as categories with the MessageBuilder.

Link copied to clipboard
interface IUserMessageCodec<T> : IUserMessageTagEncoder<T> , IUserMessageTagDecoder<T>

Encoder and decoder for type T

Link copied to clipboard
interface IUserMessageTag

Provides a string tag containing type information for a TaggedValue

Link copied to clipboard
interface IUserMessageTagDecoder<T>

Decoder that decodes an IMessageBufferReader based on an embedded tag

Link copied to clipboard
interface IUserMessageTagEncoder<T>

Encoder that transforms value T into a TaggedValue

Link copied to clipboard
abstract class Message(    val data: IMessageBufferReader,     val tag: String,     val category: Int)

Message is an abstract class that represents a unit of communication between two connected peers. It wraps the user-defined payload for delivery between connected peers.

Link copied to clipboard
class MessageBuilder

Builds a POCO object that can be sent to a remote peer via IRemoteSupportClient.sendCommand, IRemoteSupportClient.sendNotification, and IRemoteSupportClient.sendQuery

Link copied to clipboard
enum MessageType : Enum<MessageType>

Protocol message type.

Link copied to clipboard
class Notification(    val data: IMessageBufferReader,     val tag: String,     val category: Int) : Message

A Notification is a message that does not require a response from the peer.

Link copied to clipboard
class Query(    val data: IMessageBufferReader,     val tag: String,     val category: Int) : Message

Query is a request from one side of the peer connection for some piece of data known by the other side of the peer connection.

Link copied to clipboard
class QueryError(    val respondingTo: String,     val errorCode: Long,     val error: String)

QueryError is a query response that contains information about an error that is either:

Link copied to clipboard
class QueryResponse(    val respondingTo: String,     val data: IMessageBufferReader,     val tag: String,     val final: Boolean)

QueryResponse is a message containing the response to an Query sent by the other side of the connection.

Link copied to clipboard
data class TaggedValue(val tag: IUserMessageTag, val value: ByteBuffer)

Data representing an object along with information required to decode it

Link copied to clipboard
object WellKnownTagEncoder

Encoder/decoder for data in well known formats

Link copied to clipboard
enum WellKnownTags : Enum<WellKnownTags> , IUserMessageTag

Functions

Link copied to clipboard
suspend fun IMessageSender.sendBytes(    message: ByteBuffer,     tag: IUserMessageTag = DefaultCategory.Bytes.defaultTag,     category: IUserMessageCategory = DefaultCategory.Bytes)

Send a ByteBuffer with the DefaultCategory.Bytes category and tag

Link copied to clipboard
suspend fun IMessageSender.sendChat(    message: String,     tag: IUserMessageTag = DefaultCategory.Chat.defaultTag,     category: IUserMessageCategory = DefaultCategory.Chat)

Send a text notification with the DefaultCategory.Chat category and tag

Link copied to clipboard
suspend fun IMessageSender.sendLogEntry(    message: String,     tag: IUserMessageTag = DefaultCategory.Log.defaultTag,     category: IUserMessageCategory = DefaultCategory.Log)

Send a text notification with the DefaultCategory.Log category and tag

Link copied to clipboard
suspend fun IMessageSender.sendObject(    message: ByteBuffer,     tag: IUserMessageTag = DefaultCategory.Object.defaultTag,     category: IUserMessageCategory = DefaultCategory.Object)

Send a serialized object with the DefaultCategory.Object category and tag

Link copied to clipboard
fun IUserMessageTag.withValue(value: ByteBuffer): TaggedValue

Create a TaggedValue from an IUserMessageTag and a ByteBuffer

fun IUserMessageTag.withValue(value: ByteArray): TaggedValue

Create a TaggedValue from an IUserMessageTag and a ByteArray