Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OPCUAServer

Hierarchy

Implements

  • ICertificateKeyPairProvider

Index

Constructors

Events

Properties

Accessors

Methods

Constructors

constructor

Events

on

  • on(event: string | symbol, listener: function): this
  • on(event: "create_session", eventHandler: function): this
  • on(event: "session_closed", eventHandler: function): this
  • on(event: "post_initialize", eventHandler: function): void
  • on(event: "serverRegistrationPending", eventHandler: function): void
  • on(event: "serverRegistered", eventHandler: function): void
  • on(event: "serverRegistrationRenewed", eventHandler: function): void
  • on(event: "serverUnregistered", eventHandler: function): void
  • on(event: "event", eventHandler: function): void
  • on(event: "request", eventHandler: function): void
  • on(event: "response", eventHandler: function): void
  • on(event: "newChannel", eventHandler: function): void
  • on(event: "closeChannel", eventHandler: function): void
  • on(event: string, eventHandler: function): this

Properties

allowAnonymous

allowAnonymous: boolean = false

false if anonymouse connection are not allowed

capabilitiesForMDNS

capabilitiesForMDNS: string[]

certificateFile

certificateFile: string

discoveryServerEndpointUrl

discoveryServerEndpointUrl: string

endpoints

endpoints: OPCUAServerEndPoint[]

engine

engine: ServerEngine

maxAllowedSessionNumber

maxAllowedSessionNumber: number

the maximum number of concurrent sessions allowed on the server

maxConnectionsPerEndpoint

maxConnectionsPerEndpoint: number

the maximum number for concurrent connection per end point

Protected options

privateKeyFile

privateKeyFile: string

Optional registerServerManager

registerServerManager: IRegisterServerManager

registerServerMethod

registerServerMethod: RegisterServerMethod

serverCertificateManager

serverCertificateManager: OPCUACertificateManager

serverInfo

serverInfo: ApplicationDescription

userCertificateManager

userCertificateManager: OPCUACertificateManager

userManager

userManager: UserManagerOptions

the user manager

Static MAX_SUBSCRIPTION

MAX_SUBSCRIPTION: number = 50

the maximum number of subscription that can be created per server

Static defaultMaxListeners

defaultMaxListeners: number

Static fallbackSessionName

fallbackSessionName: string = "Client didn't provide a meaningful sessionName ..."

Static makeServiceFault

makeServiceFault: makeServiceFault = makeServiceFault

Static registry

registry: ObjectRegistry = new ObjectRegistry()

Accessors

buildInfo

  • get buildInfo(): BuildInfo

bytesRead

  • get bytesRead(): number

bytesWritten

  • get bytesWritten(): number

currentChannelCount

  • get currentChannelCount(): number

currentSessionCount

  • get currentSessionCount(): number

currentSubscriptionCount

  • get currentSubscriptionCount(): number

initialized

  • get initialized(): boolean

isAuditing

  • get isAuditing(): boolean

publishingIntervalCount

  • get publishingIntervalCount(): number

rejectedRequestsCount

  • get rejectedRequestsCount(): number

rejectedSessionCount

  • get rejectedSessionCount(): number

serverType

  • get serverType(): ApplicationType

sessionAbortCount

  • get sessionAbortCount(): number

transactionsCount

  • get transactionsCount(): number

Methods

Private _apply_on_SessionObject

  • _apply_on_SessionObject(ResponseClass: any, message: any, channel: ServerSecureChannelLayer, action_to_perform: any): void
  • ensure that action is performed on a valid session object,

    method

    _apply_on_SessionObject

    Parameters

    • ResponseClass: any

      the constructor of the response Class

    • message: any
    • channel: ServerSecureChannelLayer
    • action_to_perform: any

    Returns void

Private _apply_on_Subscription

  • _apply_on_Subscription(ResponseClass: any, message: any, channel: ServerSecureChannelLayer, action_to_perform: any): void

Private _apply_on_SubscriptionIds

  • _apply_on_SubscriptionIds(ResponseClass: any, message: any, channel: ServerSecureChannelLayer, action_to_perform: any): void

Private _apply_on_Subscriptions

  • _apply_on_Subscriptions(ResponseClass: any, message: any, channel: ServerSecureChannelLayer, action_to_perform: function): void

_get_endpoints

  • _get_endpoints(): EndpointDescription[]

Private _on_ActivateSessionRequest

  • _on_ActivateSessionRequest(message: any, channel: ServerSecureChannelLayer): void

Protected _on_AddNodes

  • _on_AddNodes(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_AddReferences

  • _on_AddReferences(message: Message, channel: ServerSecureChannelLayer): void

Private _on_BrowseNextRequest

  • _on_BrowseNextRequest(message: Message, channel: ServerSecureChannelLayer): void

Private _on_BrowseRequest

  • _on_BrowseRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_CallRequest

  • _on_CallRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_Cancel

  • _on_Cancel(message: Message, channel: ServerSecureChannelLayer): void

Private _on_CloseSessionRequest

  • _on_CloseSessionRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_CreateMonitoredItemsRequest

  • _on_CreateMonitoredItemsRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_CreateSessionRequest

  • _on_CreateSessionRequest(message: any, channel: ServerSecureChannelLayer): void

Protected _on_CreateSubscriptionRequest

  • _on_CreateSubscriptionRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_DeleteMonitoredItemsRequest

  • _on_DeleteMonitoredItemsRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_DeleteNodes

  • _on_DeleteNodes(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_DeleteReferences

  • _on_DeleteReferences(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_DeleteSubscriptionsRequest

  • _on_DeleteSubscriptionsRequest(message: Message, channel: ServerSecureChannelLayer): void

Private _on_FindServersRequest

  • _on_FindServersRequest(message: Message, channel: ServerSecureChannelLayer): void

Private _on_GetEndpointsRequest

  • _on_GetEndpointsRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_HistoryReadRequest

  • _on_HistoryReadRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_HistoryUpdate

  • _on_HistoryUpdate(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_ModifyMonitoredItemsRequest

  • _on_ModifyMonitoredItemsRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_ModifySubscriptionRequest

  • _on_ModifySubscriptionRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_PublishRequest

  • _on_PublishRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_QueryFirst

  • _on_QueryFirst(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_QueryNext

  • _on_QueryNext(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_ReadRequest

  • _on_ReadRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_RegisterNodesRequest

  • _on_RegisterNodesRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_RepublishRequest

  • _on_RepublishRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_SetMonitoringModeRequest

  • _on_SetMonitoringModeRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_SetPublishingModeRequest

  • _on_SetPublishingModeRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_TransferSubscriptionsRequest

  • _on_TransferSubscriptionsRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_TranslateBrowsePathsToNodeIdsRequest

  • _on_TranslateBrowsePathsToNodeIdsRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_UnregisterNodesRequest

  • _on_UnregisterNodesRequest(message: Message, channel: ServerSecureChannelLayer): void

Protected _on_WriteRequest

  • _on_WriteRequest(message: Message, channel: ServerSecureChannelLayer): void

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

Protected computeServerSignature

  • computeServerSignature(channel: ServerSecureChannelLayer, clientCertificate: Certificate, clientNonce: Nonce): SignatureData | undefined

Protected createSession

dispose

  • dispose(): void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getCertificate

  • Returns Certificate

getCertificateChain

  • Returns Certificate

Protected getChannels

  • getChannels(): ServerSecureChannelLayer[]

getDiscoveryUrls

  • getDiscoveryUrls(): string[]

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getPrivateKey

  • getPrivateKey(): PrivateKeyPEM
  • Returns PrivateKeyPEM

getServers

  • getServers(channel: ServerSecureChannelLayer): ApplicationDescription[]

Protected getSession

  • getSession(authenticationToken: NodeId, activeOnly?: boolean): ServerSession | null

initialize

  • initialize(): Promise<void>
  • initialize(done: function): void
  • Initialize the server by installing default node set.

    and instruct the server to listen to its endpoints.

    const server = new OPCUAServer();
    await server.initialize();
    
    // default server namespace is now initialized
    // it is a good time to create life instance objects
    const namespace = server.engine.addressSpace.getOwnNamespace();
    namespace.addObject({
        browseName: "SomeObject",
        organizedBy: server.engine.addressSpace.rootFolder.objects
    });
    
    // the addressSpace is now complete
    // let's now start listening to clients
    await server.start();

    Returns Promise<void>

  • Parameters

    • done: function
        • (): void
        • Returns void

    Returns void

Protected isUserAuthorized

  • isUserAuthorized(channel: ServerSecureChannelLayer, session: ServerSession, userIdentityToken: UserIdentityToken, callback: function): void
  • Parameters

    • channel: ServerSecureChannelLayer
    • session: ServerSession
    • userIdentityToken: UserIdentityToken
    • callback: function
        • (err: Error | null, isAuthorized?: boolean): void
        • Parameters

          • err: Error | null
          • Optional isAuthorized: boolean

          Returns void

    Returns void

Protected isValidUserIdentityToken

  • isValidUserIdentityToken(channel: ServerSecureChannelLayer, session: ServerSession, userIdentityToken: UserIdentityToken, userTokenSignature: any, callback: function): void
  • Parameters

    • channel: ServerSecureChannelLayer
    • session: ServerSession
    • userIdentityToken: UserIdentityToken
    • userTokenSignature: any
    • callback: function
        • (err: Error | null, statusCode?: StatusCode): void
        • Parameters

          • err: Error | null
          • Optional statusCode: StatusCode

          Returns void

    Returns void

Protected isValidUserNameIdentityToken

  • isValidUserNameIdentityToken(channel: ServerSecureChannelLayer, session: ServerSession, userTokenPolicy: any, userIdentityToken: UserNameIdentityToken, userTokenSignature: any, callback: function): void
  • Parameters

    • channel: ServerSecureChannelLayer
    • session: ServerSession
    • userTokenPolicy: any
    • userIdentityToken: UserNameIdentityToken
    • userTokenSignature: any
    • callback: function
        • (err: Error | null, statusCode?: StatusCode): void
        • Parameters

          • err: Error | null
          • Optional statusCode: StatusCode

          Returns void

    Returns void

Protected isValidX509IdentityToken

  • isValidX509IdentityToken(channel: ServerSecureChannelLayer, session: ServerSession, userTokenPolicy: any, userIdentityToken: X509IdentityToken, userTokenSignature: any, callback: function): void
  • Parameters

    • channel: ServerSecureChannelLayer
    • session: ServerSession
    • userTokenPolicy: any
    • userIdentityToken: X509IdentityToken
    • userTokenSignature: any
    • callback: function
        • (err: Error | null, statusCode?: StatusCode): void
        • Parameters

          • err: Error | null
          • Optional statusCode: StatusCode

          Returns void

    Returns void

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

Protected makeServerNonce

  • makeServerNonce(): Nonce

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on_request

  • on_request(message: Message, channel: ServerSecureChannelLayer): void

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

Protected prepare

  • prepare(message: Message, channel: ServerSecureChannelLayer): void

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

raiseEvent

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

resumeEndPoints

  • resumeEndPoints(): Promise<void>
  • resumeEndPoints(callback: function): void

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

shutdown

  • shutdown(timeout?: number): Promise<void>
  • shutdown(callback: function): void
  • shutdown(timeout: number, callback: function): void

shutdownChannels

  • shutdownChannels(): Promise<void>
  • shutdownChannels(callback: function): void

start

  • start(): Promise<void>
  • start(done: function): void

suspendEndPoints

  • suspendEndPoints(): Promise<void>
  • suspendEndPoints(callback: function): void

Protected userNameIdentityTokenAuthenticateUser

  • userNameIdentityTokenAuthenticateUser(channel: ServerSecureChannelLayer, session: ServerSession, userTokenPolicy: any, userIdentityToken: UserNameIdentityToken, callback: function): void
  • Parameters

    • channel: ServerSecureChannelLayer
    • session: ServerSession
    • userTokenPolicy: any
    • userIdentityToken: UserNameIdentityToken
    • callback: function
        • (err: Error | null, isAuthorized?: boolean): void
        • Parameters

          • err: Error | null
          • Optional isAuthorized: boolean

          Returns void

    Returns void

Protected verifyClientSignature

  • verifyClientSignature(session: ServerSession, channel: ServerSecureChannelLayer, clientSignature: SignatureData): boolean

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc