Skip to main content

Class: GetResourceReply

Defined in: src/common/web/api/resource/ResourceCommands.ts:141

Reply to GetResourceCommand.

Param

The resource path.

Param

The file data (currently base64-encoded).

Extends

Constructors

Constructor

new GetResourceReply(name, origin, sender, target, hops, trace, apiKey): GetResourceReply

Defined in: src/common/web/core/messaging/Message.ts:63

Parameters

name

string

The name of the message.

origin

UnitID

The initial source component of the message.

sender

UnitID

The component from where the message came from.

target

Channel

Where the message should go to.

hops

UnitID[] = []

A list of components the message was sent through.

trace

string = ...

A unique trace identifying messages that logically belong together.

apiKey

string = ""

An optional API key to access protected resources.

Returns

GetResourceReply

Inherited from

CommandReply.constructor

Properties

api_key

readonly api_key: string = ""

Defined in: src/common/web/core/messaging/Message.ts:50

Inherited from

CommandReply.api_key


hops

readonly hops: UnitID[] = []

Defined in: src/common/web/core/messaging/Message.ts:46

Inherited from

CommandReply.hops


message

readonly message: string = ""

Defined in: src/common/web/core/messaging/CommandReply.ts:27

Inherited from

CommandReply.message


name

readonly name: string

Defined in: src/common/web/core/messaging/Message.ts:33

Inherited from

CommandReply.name


origin

readonly origin: UnitID

Defined in: src/common/web/core/messaging/Message.ts:36

Inherited from

CommandReply.origin


payload

readonly payload: MessagePayload

Defined in: src/common/web/core/messaging/Message.ts:52

Inherited from

CommandReply.payload


resource

readonly resource: Resource

Defined in: src/common/web/api/resource/ResourceCommands.ts:144


sender

readonly sender: UnitID

Defined in: src/common/web/core/messaging/Message.ts:39

Inherited from

CommandReply.sender


success

readonly success: boolean = true

Defined in: src/common/web/core/messaging/CommandReply.ts:26

Inherited from

CommandReply.success


target

readonly target: Channel

Defined in: src/common/web/core/messaging/Message.ts:42

Inherited from

CommandReply.target


trace

readonly trace: string = ""

Defined in: src/common/web/core/messaging/Message.ts:48

Inherited from

CommandReply.trace


unique

readonly unique: string

Defined in: src/common/web/core/messaging/CommandReply.ts:29

Inherited from

CommandReply.unique


Category

readonly static Category: string = "CommandReply"

Defined in: src/common/web/core/messaging/CommandReply.ts:24

Inherited from

CommandReply.Category

Accessors

data

Get Signature

get data(): undefined | ArrayBuffer

Defined in: src/common/web/api/resource/ResourceCommands.ts:149

The data of the resource.

Returns

undefined | ArrayBuffer

Set Signature

set data(data): void

Defined in: src/common/web/api/resource/ResourceCommands.ts:161

Sets the data of the resource.

Parameters
data

ArrayBuffer

The resource data.

Returns

void


messageCategory

Get Signature

get messageCategory(): string

Defined in: src/common/web/core/messaging/CommandReply.ts:34

Gets the global message category.

Returns

string

Inherited from

CommandReply.messageCategory

Methods

convertToJSON()

convertToJSON(): string

Defined in: src/common/web/core/messaging/Message.ts:76

Converts this message to JSON.

Returns

string

Inherited from

CommandReply.convertToJSON


toString()

toString(): string

Defined in: src/common/web/core/messaging/Message.ts:154

Gets the string representation of this message.

Returns

string

Inherited from

CommandReply.toString


build()

static build(messageBuilder, cmd, resource, data, success, message): CommandReplyComposer<GetResourceReply>

Defined in: src/common/web/api/resource/ResourceCommands.ts:168

Helper function to easily build this message.

Parameters

messageBuilder

MessageBuilder

cmd

GetResourceCommand

resource

Resource

data

ArrayBuffer

success

boolean = true

message

string = ""

Returns

CommandReplyComposer<GetResourceReply>


convertFromJSON()

static convertFromJSON(msgType, data): Message

Defined in: src/common/web/core/messaging/Message.ts:93

Creates a message from JSON data.

Parameters

msgType

ConstructableMessage

The message type to construct.

data

string

The JSON data string.

Returns

Message

  • The created message.

Inherited from

CommandReply.convertFromJSON


define()

static define(name): Function

Defined in: src/common/web/core/messaging/Message.ts:128

Defines a new message.

The decorator takes care of wrapping the new class as a dataclass, passing the correct message name to its constructor. It also registers the new message type in the global MessageTypesCatalog.

Examples:

    @Message.define("msg/command")
class MyCommand extends Command {
...
}

Parameters

name

string

The name of the message.

Returns

Function

Inherited from

CommandReply.define


isProtected()

static isProtected(): boolean

Defined in: src/common/web/core/messaging/Message.ts:108

The frontend never receives or issues protected messages.

Returns

boolean

Inherited from

CommandReply.isProtected


messageName()

static messageName(): string

Defined in: src/common/web/core/messaging/Message.ts:101

Retrieves the name of the message type on a message class basis.

Returns

string

Inherited from

CommandReply.messageName