NodeOPCUA API Documentation
    Preparing search index...

    Interface IServerEngineForServer

    What the services of an OPC UA server (OPCUAServerCore) ask of their engine: ServerEngine in the thread of the server, or an engine that forwards to one elsewhere.

    interface IServerEngineForServer {
        _internalState:
            | "initialized"
            | "disposed"
            | "shutdown"
            | "creating"
            | "initializing";
        addressSpace: AddressSpace
        | null;
        buildInfo: BuildInfo;
        currentSessionCount: number;
        currentSubscriptionCount: number;
        isAuditing: boolean;
        nodeFinder: INodeFinder;
        publishingIntervalCount: number;
        rejectedRequestsCount: number;
        rejectedSessionCount: number;
        serverCapabilities: ServerCapabilities;
        sessionAbortCount: number;
        admitSession(): Promise<boolean>;
        browseWithAutomaticExpansion(
            nodesToBrowse: BrowseDescription[],
            context: ISessionContext,
        ): Promise<BrowseResult[]>;
        call(
            context: ISessionContext,
            methodsToCall: CallMethodRequest[],
        ): Promise<CallMethodResultOptions[]>;
        closeSession(
            authenticationToken: NodeId,
            deleteSubscriptions: boolean,
            reason?: ClosingReason,
            auditEntryId?: string,
        ): void;
        createSession(options?: CreateSessionOption): ServerSession;
        deleteOrphanSubscription(subscription: Subscription): StatusCode;
        dispose(): void;
        findOrphanSubscription(subscriptionId: number): Subscription | null;
        getInApplicationSetup(): boolean;
        getServerState(): ServerState;
        getSession(
            authenticationToken: NodeId,
            activeOnly?: boolean,
        ): ServerSession | null;
        historyRead(
            context: ISessionContext,
            historyReadRequest: HistoryReadRequest,
        ): Promise<HistoryReadResult[]>;
        incrementRejectedSessionCount(): void;
        incrementSecurityRejectedSessionCount(): void;
        initialize(
            options: OPCUAServerOptions,
            callback: (err?: Error | null) => void,
        ): void;
        isStarted(): boolean;
        monitoredItemsReady(): Promise<void> | undefined;
        prepareMonitoredItems(
            _context: ISessionContext,
            _itemsToCreate: MonitoredItemCreateRequest[],
        ): Promise<void> | undefined;
        prepareRead(
            context: ISessionContext,
            readRequest: ReadRequestOptions,
            callback: (err?: Error | null) => void,
        ): void;
        readSync(
            context: ISessionContext,
            readRequest: ReadRequestOptions,
        ): DataValue[];
        refreshValues(
            nodesToRefresh: HistoryReadValueId[] | ReadValueId[],
            maxAge: number,
            callback: (err: Error | null, dataValues?: DataValue[]) => void,
            context?: ISessionContext,
        ): void;
        registerCompactNamespace(namespaceUri: string): number;
        setInApplicationSetup(value: boolean): void;
        setServerState(serverState: ServerState): void;
        setShutdownTime(date: Date): void;
        shutdown(): Promise<void>;
        transferSubscription(
            session: ServerSession,
            subscriptionId: number,
            sendInitialValues: boolean,
        ): Promise<TransferResult>;
        translateBrowsePaths(
            browsePaths: BrowsePath[],
            context?: ISessionContext,
        ): Promise<BrowsePathResult[]>;
        write(
            context: ISessionContext,
            nodesToWrite: WriteValue[],
        ): Promise<StatusCode[]>;
    }

    Hierarchy

    • Pick<
          ServerEngine,
          | "initialize"
          | "shutdown"
          | "dispose"
          | "_internalState"
          | "isStarted"
          | "getServerState"
          | "setServerState"
          | "setShutdownTime"
          | "getInApplicationSetup"
          | "setInApplicationSetup"
          | "buildInfo"
          | "serverCapabilities"
          | "isAuditing"
          | "addressSpace"
          | "registerCompactNamespace"
          | "createSession"
          | "closeSession"
          | "getSession"
          | "admitSession"
          | "currentSessionCount"
          | "rejectedSessionCount"
          | "rejectedRequestsCount"
          | "sessionAbortCount"
          | "incrementRejectedSessionCount"
          | "incrementSecurityRejectedSessionCount"
          | "currentSubscriptionCount"
          | "publishingIntervalCount"
          | "findOrphanSubscription"
          | "deleteOrphanSubscription"
          | "transferSubscription"
          | "prepareMonitoredItems"
          | "monitoredItemsReady"
          | "nodeFinder"
          | "readSync"
          | "prepareRead"
          | "refreshValues"
          | "browseWithAutomaticExpansion"
          | "translateBrowsePaths"
          | "write"
          | "call"
          | "historyRead",
      >
      • IServerEngineForServer
    Index
    _internalState:
        | "initialized"
        | "disposed"
        | "shutdown"
        | "creating"
        | "initializing"
    addressSpace: AddressSpace | null
    buildInfo: BuildInfo
    currentSessionCount: number
    currentSubscriptionCount: number
    isAuditing: boolean
    nodeFinder: INodeFinder
    publishingIntervalCount: number
    rejectedRequestsCount: number
    rejectedSessionCount: number
    serverCapabilities: ServerCapabilities
    sessionAbortCount: number
    • whether one more Session fits (OPC 10000-4 5.6.2): when the server is full, the oldest Session not activated yet is closed to make room, and a Session is refused only if none is

      Returns Promise<boolean>

    • Parameters

      • authenticationToken: NodeId
      • deleteSubscriptions: boolean

        {Boolean} : true if session's subscription shall be deleted

      • Optionalreason: ClosingReason

        the reason for closing the session ( shall be "Timeout", "Terminated" or "CloseSession")

      • OptionalauditEntryId: string

        the RequestHeader.auditEntryId of the CloseSession request that caused this close, when there is one. See ServerSession#close.

        If a Client invokes the CloseSession Service then all Subscriptions associated with the Session are also deleted if the deleteSubscriptions flag is set to TRUE. If a Server terminates a Session for any other reason, Subscriptions associated with the Session, are not deleted. Each Subscription has its own lifetime to protect against data loss in the case of a Session termination. In these cases, the Subscription can be reassigned to another Client before its lifetime expires.

      Returns void

    • Returns void

    • Parameters

      • subscriptionId: number

      Returns Subscription | null

    • Read the current value of ServerConfiguration.InApplicationSetup.

      Returns false if the property does not exist in the address space.

      Returns boolean

    • Parameters

      • authenticationToken: NodeId
      • OptionalactiveOnly: boolean

      Returns ServerSession | null

    • increment rejected session count (also increment rejected requests count)

      Returns void

    • increment rejected session count (also increment rejected requests count)

      Returns void

    • Parameters

      Returns void

    • Returns boolean

    • once the items of a CreateMonitoredItems (or a SetMonitoringMode, a ModifyMonitoredItems) are made: what they must wait for before the client hears of them. Nothing here, where items sample this engine's nodes directly (a session worker waits for its engine to watch them).

      Returns Promise<void> | undefined

    • before the items of a CreateMonitoredItems are created: what must be fetched to find their nodes synchronously. Nothing here, where every node is (a session worker fetches them).

      Parameters

      Returns Promise<void> | undefined

    • what a Read needs before its values are read: the asynchronous Variables refreshed (a front thread's engine fetches there what it cannot read in place, see RemoteEngine)

      Parameters

      Returns void

    • Parameters

      • nodesToRefresh: HistoryReadValueId[] | ReadValueId[]
      • maxAge: number
      • callback: (err: Error | null, dataValues?: DataValue[]) => void
          • (err: Error | null, dataValues?: DataValue[]): void
          • Parameters

            • err: Error | null
            • OptionaldataValues: DataValue[]

              an array containing value read The array length matches the number of nodeIds that are candidate for an async refresh (i.e: nodes that are of type Variable with asyncRefresh func }

            Returns void

      • Optionalcontext: ISessionContext

        the session context of the read: given to the refresh function of each Variable

      Returns void

    • a namespace of the application served by the compact address space: registered on the node objects as well, so that the NamespaceArray and the indexes are one; nodes are then added through the compact space's own API (addVariable, addObject, bindings)

      Parameters

      • namespaceUri: string

      Returns number

    • Set the ServerConfiguration.InApplicationSetup property in the address space.

      This flag indicates whether the server is currently in its initial application setup phase (e.g. waiting for GDS provisioning).

      Parameters

      • value: boolean

      Returns void

    • Parameters

      • date: Date

      Returns void

    • Returns Promise<void>

    • Parameters

      • session: ServerSession

        {ServerSession} - the new session that will own the subscription

      • subscriptionId: number

        {IntegerId} - the subscription Id to transfer

      • sendInitialValues: boolean

        {Boolean} - true if initial values will be resent.

      Returns Promise<TransferResult>