Skip to main content
Version: v1

IContainerContext Interface

The ContainerContext is a proxy standing between the Container and the Container's IRuntime. This allows the Container to terminate the connection to the IRuntime.

Specifically, there is an event on Container, onContextChanged, which mean a new code proposal has been loaded, so the old IRuntime is no longer valid, as its ContainerContext has been revoked, and the Container has created a new ContainerContext.

Signature

export interface IContainerContext extends IDisposable

Extends: IDisposable

Properties

Property Modifiers Type Description
attachState AttachState Indicates the attachment state of the container to a host service.
audience IAudience | undefined
baseSnapshot ISnapshotTree | undefined
clientDetails IClientDetails
clientId string | undefined
closeFn (error?: ICriticalContainerError) => void
connected boolean
deltaManager IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>
existing boolean | undefined
id string WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers and scenarios which can change in the future.
loader ILoader
options ILoaderOptions
pendingLocalState optional unknown
quorum IQuorumClients
scope FluidObject Ambient services provided with the context
serviceConfiguration IClientConfiguration | undefined
storage IDocumentStorageService
submitFn (type: MessageType, contents: any, batch: boolean, appData?: any) => number
submitSignalFn (contents: any) => void
taggedLogger ITelemetryBaseLogger

Methods

Method Alerts Modifiers Return Type Description
getAbsoluteUrl(relativeUrl) optional Promise<string | undefined> Get an absolute url for a provided container-relative request.
getLoadedFromVersion() IVersion | undefined
getSpecifiedCodeDetails() Deprecated optional IFluidCodeDetails | undefined
updateDirtyContainerState(dirty) void

Property Details

attachState

Indicates the attachment state of the container to a host service.

Signature
readonly attachState: AttachState;

Type: AttachState

audience

Signature
readonly audience: IAudience | undefined;

Type: IAudience | undefined

baseSnapshot

Signature
readonly baseSnapshot: ISnapshotTree | undefined;

Type: ISnapshotTree | undefined

clientDetails

Signature
readonly clientDetails: IClientDetails;

Type: IClientDetails

clientId

Signature
readonly clientId: string | undefined;

Type: string | undefined

closeFn

Signature
readonly closeFn: (error?: ICriticalContainerError) => void;

Type: (error?: ICriticalContainerError) => void

connected

Signature
readonly connected: boolean;

Type: boolean

deltaManager

Signature
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;

Type: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>

existing

Signature
readonly existing: boolean | undefined;

Type: boolean | undefined

id

WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers and scenarios which can change in the future.

Signature
readonly id: string;

Type: string

loader

Signature
readonly loader: ILoader;

Type: ILoader

options

Signature
readonly options: ILoaderOptions;

Type: ILoaderOptions

pendingLocalState

Signature
pendingLocalState?: unknown;

Type: unknown

quorum

Signature
readonly quorum: IQuorumClients;

Type: IQuorumClients

scope

Ambient services provided with the context

Signature
readonly scope: FluidObject;

Type: FluidObject

serviceConfiguration

Signature
readonly serviceConfiguration: IClientConfiguration | undefined;

Type: IClientConfiguration | undefined

storage

Signature
readonly storage: IDocumentStorageService;

Type: IDocumentStorageService

submitFn

Signature
readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;

Type: (type: MessageType, contents: any, batch: boolean, appData?: any) => number

submitSignalFn

Signature
readonly submitSignalFn: (contents: any) => void;

Type: (contents: any) => void

taggedLogger

Signature
readonly taggedLogger: ITelemetryBaseLogger;

Type: ITelemetryBaseLogger

Method Details

getAbsoluteUrl

Get an absolute url for a provided container-relative request.

Signature
getAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;

Parameters

Parameter Type Description
relativeUrl string

A relative request within the container

TODO: Optional for backwards compatibility. Make non-optional in version 0.19

Returns

Return type: Promise<string | undefined>

getLoadedFromVersion

Signature
getLoadedFromVersion(): IVersion | undefined;

Returns

Return type: IVersion | undefined

getSpecifiedCodeDetails

This API is deprecated and will be removed in a future release.

This method is provided as a migration tool for customers currently reading the code details from within the Container by directly accessing the Quorum proposals. The code details should not be accessed from within the Container as this requires coupling between the container contents and the code loader. Direct access to Quorum proposals will be removed in an upcoming release, and in a further future release this migration tool will be removed.

Signature
getSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;

Returns

Return type: IFluidCodeDetails | undefined

updateDirtyContainerState

Signature
updateDirtyContainerState(dirty: boolean): void;

Parameters

Parameter Type Description
dirty boolean