Interface NotificationChannelStorage

Stores all the information necessary to keep track of notification channels. Besides the standard channel info it also stores features specific to a certain channel type.

This storage assumes that a channel can only have a single identifier as its topic.

interface NotificationChannelStorage {
    add: ((channel: NotificationChannel) => Promise<void>);
    delete: ((id: string) => Promise<boolean>);
    get: ((id: string) => Promise<undefined | NotificationChannel>);
    getAll: ((topic: ResourceIdentifier) => Promise<string[]>);
    update: ((channel: NotificationChannel) => Promise<void>);
}

Implemented by

Properties

add: ((channel: NotificationChannel) => Promise<void>)

Adds the given channel to the storage.

Type declaration

    • (channel): Promise<void>
    • Parameters

      Returns Promise<void>

delete: ((id: string) => Promise<boolean>)

Deletes the given notification channel from the storage. Returns true if the channel existed.

Type declaration

    • (id): Promise<boolean>
    • Parameters

      • id: string

        The identifier of the notification channel

      Returns Promise<boolean>

get: ((id: string) => Promise<undefined | NotificationChannel>)

Returns the requested channel. undefined if no match was found or if the notification channel expired.

Type declaration

getAll: ((topic: ResourceIdentifier) => Promise<string[]>)

Returns the identifiers of all notification channel entries that have the given identifier as their topic. The identifiers can potentially correspond to expired channels.

Type declaration

    • (topic): Promise<string[]>
    • Parameters

      Returns Promise<string[]>

update: ((channel: NotificationChannel) => Promise<void>)

Updates the given notification channel. The id and the topic can not be updated.

Type declaration

    • (channel): Promise<void>
    • Parameters

      Returns Promise<void>