Home Reference Source Test
public class | source

Message

Extends:

RethinkObject → Message

Constructor Summary

Public Constructor
public

constructor(id: number, from: URL.URL, toList: URL.URLList, type: MessageType, body: MessageBody)

Generates a message data object

Member Summary

Public Members
public

body: *

public

from: *

public

id: *

public

to: *

public

type: *

Method Summary

Public Methods
public

addAccessToken(token: Identity.JWT): Message.Message

Add an access token to the given message

public

addIdToken(token: Identity.JWT): Message.Message

Adds an Id token to the given message

public

assertIdentity(token: Identity.JWT, identity: Identity.Identity): Message.Message

Adds the asserted identity to the message body and removes the given token from the message

Inherited Summary

From class RethinkObject
public

validate(schema: *): boolean

Validates this RethinkObject against the provided schema.

Public Constructors

public constructor(id: number, from: URL.URL, toList: URL.URLList, type: MessageType, body: MessageBody) source

Generates a message data object

Params:

NameTypeAttributeDescription
id number

To be used to associate Response messages to the initial request message.

from URL.URL

URL of Hyperty instance or User associated with it

toList URL.URLList

One or more URLs of Message recipients. According to the URL scheme it may be handled in different ways

type MessageType

The URL of the reTHINK Data Object Resource associated with the message that can be used for routing purposes

body MessageBody

Optionally, all message bodies exchanged between different Runtime Messge BUS can contain JWT tokens for Access Control for Identity Assertion purposes that are inserted by the Identity Module before the message is routed to proto stubs

Public Members

public body: * source

public from: * source

public id: * source

public to: * source

public type: * source

Public Methods

public addAccessToken(token: Identity.JWT): Message.Message source

Add an access token to the given message

Params:

NameTypeAttributeDescription
token Identity.JWT

token to be added to the given message

Return:

Message.Message

the updated Message

public addIdToken(token: Identity.JWT): Message.Message source

Adds an Id token to the given message

Params:

NameTypeAttributeDescription
token Identity.JWT

identity token to include in the message

Return:

Message.Message

the updated message

public assertIdentity(token: Identity.JWT, identity: Identity.Identity): Message.Message source

Adds the asserted identity to the message body and removes the given token from the message

Params:

NameTypeAttributeDescription
token Identity.JWT

idToken to remove from message

identity Identity.Identity

asserted identity to include

Return:

Message.Message

message - updated message