Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AddressSpace

AddressSpace is a collection of UA nodes.

const addressSpace = AddressSpace.create();

Hierarchy

  • AddressSpace

Implements

Constructors

constructor

  • Returns AddressSpace

Properties

_condition_refresh_in_progress

_condition_refresh_in_progress: boolean = false

Optional historizingNodes

historizingNodes: object

Type declaration

  • [key: string]: UAVariable

isFrugal

isFrugal: boolean = false

when this flag is set, properties and components are not added as javascript member of the UAObject/UAVariable node

Readonly isNodeIdString

isNodeIdString: isNodeIdString = isNodeIdString

Static Optional historizerFactory

historizerFactory: any

Static isNonEmptyQualifiedName

isNonEmptyQualifiedName: isNonEmptyQualifiedName = isNonEmptyQualifiedName

Accessors

rootFolder

  • Returns RootFolder

Methods

_coerceNode

_coerceType

  • _coerceType<T>(baseType: string | NodeId | BaseNode, topMostBaseType: string, nodeClass: NodeClass): T

_coerceTypeDefinition

  • _coerceTypeDefinition(typeDefinition: string | NodeId): NodeId

_coerce_DataType

  • _coerce_DataType(dataType: NodeId | string | BaseNode): NodeId
  • Parameters

    Returns NodeId

_coerce_VariableTypeIds

  • _coerce_VariableTypeIds(dataType: NodeId | string | BaseNode): NodeId

_register

addAlias

  • addAlias(alias: string, nodeId: NodeId): void
  • method

    addAlias

    internal

    Parameters

    • alias: string

      the alias name

    • nodeId: NodeId

    Returns void

browsePath

  • browsePath(browsePath: BrowsePath): BrowsePathResult
  • browsePath(browsePath: BrowsePath): BrowsePathResult
  • browse some path.

    method

    browsePath

    Parameters

    • browsePath: BrowsePath

    Returns BrowsePathResult

    This service can be used translates one or more browse paths into NodeIds. A browse path is constructed of a starting Node and a RelativePath. The specified starting Node identifies the Node from which the RelativePath is based. The RelativePath contains a sequence of ReferenceTypes and BrowseNames.

    StatusCode
    BadNodeIdUnknown
    BadNodeIdInvalid
    BadNothingToDo - the relative path contains an empty list )
    BadBrowseNameInvalid - target name is missing in relative path
    UncertainReferenceOutOfServer - The path element has targets which are in another server.
    BadTooManyMatches
    BadQueryTooComplex
    BadNoMatch
  • Parameters

    • browsePath: BrowsePath

    Returns BrowsePathResult

browseSingleNode

constructEventData

constructExtensionObject

  • constructExtensionObject(dataType: UADataType | NodeId, options: any): ExtensionObject
  • constructExtensionObject(dataType: UADataType | NodeId, options?: any): ExtensionObject
  • example
            // example 1
            var extObj = addressSpace.constructExtensionObject("BuildInfo",{ productName: "PRODUCTNAME"});
    
            // example 2
            serverStatusDataType.nodeClass.should.eql(NodeClass.DataType);
            serverStatusDataType.browseName.toString().should.eql("ServerStatusDataType");
            var serverStatus  = addressSpace.constructExtensionObject(serverStatusDataType);
            serverStatus.constructor.name.should.eql("ServerStatusDataType");

    Parameters

    Returns ExtensionObject

    the constructed extension object

  • construct an extension object constructor from a DataType nodeID or UADataType object

    Parameters

    • dataType: UADataType | NodeId
    • Optional options: any

    Returns ExtensionObject

deleteNode

  • deleteNode(nodeOrNodeId: NodeId | BaseNode): void
  • deleteNode(node: NodeId | BaseNode): void
  • Parameters

    Returns void

  • Parameters

    • node: NodeId | BaseNode

    Returns void

dispose

  • dispose(): void
  • dispose(): void
  • cleanup all resources maintained by this addressSpace.

    method

    dispose

    Returns void

  • Returns void

findCorrespondingBasicDataType

  • method

    findCorrespondingBasicDataType

    example
    const dataType = addressSpace.findDataType("ns=0;i=12");
    addressSpace.findCorrespondingBasicDataType(dataType).should.eql(DataType.String);
    
    const dataType = addressSpace.findDataType("ServerStatusDataType"); // ServerStatus
    addressSpace.findCorrespondingBasicDataType(dataType).should.eql(DataType.ExtensionObject);

    Parameters

    Returns DataType

  • Parameters

    Returns DataType

findDataType

  • findDataType(dataType: number | string | NodeId | DataType, namespaceIndex?: number): UADataType | null
  • findDataType(dataType: string | NodeId | UADataType | DataType, namespaceIndex?: number): UADataType | null
  • Find the DataType node from a NodeId or a browseName

    method

    findDataType

    example
     const dataDouble = addressSpace.findDataType("Double");
    
     const dataDouble = addressSpace.findDataType(resolveNodeId("ns=0;i=3"));

    Parameters

    • dataType: number | string | NodeId | DataType
    • Optional namespaceIndex: number

    Returns UADataType | null

  • Parameters

    • dataType: string | NodeId | UADataType | DataType
    • Optional namespaceIndex: number

    Returns UADataType | null

findEventType

  • find an EventType node in the address space

    method

    findEventType

    example
    var evtType = addressSpace.findEventType("AuditEventType");

    Parameters

    • eventTypeId: NodeIdLike | UAEventType

      the eventType to find

    • Optional namespaceIndex: number

      the namespace index of the event to find

    Returns UAEventType | null

    the EventType found or null.

    note:

    • the method with throw an exception if a node is found that is not a BaseEventType or a subtype of it.
  • find an EventType node in the address space

    example
     const evtType = addressSpace.findEventType("AuditEventType");

    Parameters

    • eventTypeId: NodeIdLike | UAObjectType

      the eventType to find

    • Optional namespaceIndex: number

      an optional index to restrict the search in a given namespace

    Returns UAObjectType | null

    the EventType found or null.

    note:

    • the method with throw an exception if a node is found that is not a BaseEventType or a subtype of it.
    • if eventTypeId is of type NodeId, the namespaceIndex shall not be specified

findMethod

  • findMethod(nodeId: NodeId | string): UAMethod | null
  • findMethod(nodeId: NodeIdLike): UAMethod | null
  • Parameters

    • nodeId: NodeId | string

    Returns UAMethod | null

  • Parameters

    Returns UAMethod | null

findNode

  • find an node by node Id

    method

    findNode

    Parameters

    • nodeId: NodeIdLike

      a nodeId or a string coerce-able to nodeID, representing the object to find.

    Returns BaseNode | null

  • Parameters

    Returns BaseNode | null

findObjectType

  • findObjectType(objectType: NodeIdLike, namespaceIndex?: number): UAObjectTypePublic | null
  • findObjectType(objectTypeId: NodeIdLike, namespaceIndex?: number): UAObjectType | null
  • method

    findObjectType

    example
    const objectType = addressSpace.findObjectType("ns=0;i=58");
    objectType.browseName.toString().should.eql("BaseObjectType");
    
    const objectType = addressSpace.findObjectType("BaseObjectType");
    objectType.browseName.toString().should.eql("BaseObjectType");
    
    const objectType = addressSpace.findObjectType(resolveNodeId("ns=0;i=58"));
    objectType.browseName.toString().should.eql("BaseObjectType");
    
    const objectType = addressSpace.findObjectType("CustomObjectType",36);
    objectType.nodeId.namespace.should.eql(36);
    objectType.browseName.toString().should.eql("BaseObjectType");
    
    const objectType = addressSpace.findObjectType("36:CustomObjectType");
    objectType.nodeId.namespace.should.eql(36);
    objectType.browseName.toString().should.eql("BaseObjectType");

    Parameters

    • objectType: NodeIdLike
    • Optional namespaceIndex: number

    Returns UAObjectTypePublic | null

  • find an EventType node in the address space

    example
        const objectType = addressSpace.findObjectType("ns=0;i=58");
        objectType.browseName.toString().should.eql("BaseObjectType");
    
        const objectType = addressSpace.findObjectType("BaseObjectType");
        objectType.browseName.toString().should.eql("BaseObjectType");
    
        const objectType = addressSpace.findObjectType(resolveNodeId("ns=0;i=58"));
        objectType.browseName.toString().should.eql("BaseObjectType");
    
        const objectType = addressSpace.findObjectType("CustomObjectType",36);
        objectType.nodeId.namespace.should.eql(36);
        objectType.browseName.toString().should.eql("BaseObjectType");
    
        const objectType = addressSpace.findObjectType("36:CustomObjectType");
        objectType.nodeId.namespace.should.eql(36);
        objectType.browseName.toString().should.eql("BaseObjectType");

    Parameters

    • objectTypeId: NodeIdLike

      the eventType to find

    • Optional namespaceIndex: number

      an optional index to restrict the search in a given namespace

    Returns UAObjectType | null

    the EventType found or null.

    notes:

    • if objectTypeId is of type NodeId, the namespaceIndex shall not be specified

findReferenceType

  • findReferenceType(refType: NodeIdLike, namespaceIndex?: number): UAReferenceType | null
  • findReferenceType(referenceTypeId: NodeIdLike | UAReferenceType, namespaceIndex?: number): UAReferenceType | null
  • method

    findReferenceType

    Parameters

    • refType: NodeIdLike
    • Optional namespaceIndex: number

    Returns UAReferenceType | null

    refType could be a string representing a nodeid : e.g. 'i=9004' or ns=1;i=6030 a string representing a browse name : e.g 'HasTypeDefinition' in this case it should be in the alias list

  • Parameters

    • referenceTypeId: NodeIdLike | UAReferenceType
    • Optional namespaceIndex: number

    Returns UAReferenceType | null

findReferenceTypeFromInverseName

  • findReferenceTypeFromInverseName(inverseName: string): UAReferenceType | null
  • findReferenceTypeFromInverseName(inverseName: string): UAReferenceType | null
  • find a ReferenceType by its inverse name.

    method

    findReferenceTypeFromInverseName

    deprecated

    Parameters

    • inverseName: string

      the inverse name of the ReferenceType to find

    Returns UAReferenceType | null

  • find a ReferenceType by its inverse name.

    Parameters

    • inverseName: string

      the inverse name of the ReferenceType to find

    Returns UAReferenceType | null

findVariableType

  • findVariableType(variableType: string | NodeId, namespaceIndex?: number): UAVariableTypePublic | null
  • findVariableType(variableTypeId: NodeIdLike, namespaceIndex?: number): UAVariableType | null
  • method

    findVariableType

    example
    const objectType = addressSpace.findVariableType("ns=0;i=62");
    objectType.browseName.toString().should.eql("BaseVariableType");
    
    const objectType = addressSpace.findVariableType("BaseVariableType");
    objectType.browseName.toString().should.eql("BaseVariableType");
    
    const objectType = addressSpace.findVariableType(resolveNodeId("ns=0;i=62"));
    objectType.browseName.toString().should.eql("BaseVariableType");

    Parameters

    • variableType: string | NodeId
    • Optional namespaceIndex: number

    Returns UAVariableTypePublic | null

  • example
        const variableType = addressSpace.findVariableType("ns=0;i=62");
        variableType.browseName.toString().should.eql("BaseVariableType");
    
        const variableType = addressSpace.findVariableType("BaseVariableType");
        variableType.browseName.toString().should.eql("BaseVariableType");
    
        const variableType = addressSpace.findVariableType(resolveNodeId("ns=0;i=62"));
        variableType.browseName.toString().should.eql("BaseVariableType");

    Parameters

    • variableTypeId: NodeIdLike
    • Optional namespaceIndex: number

    Returns UAVariableType | null

generateEventId

  • generateEventId(): VariantT<Buffer, ByteString>
  • generateEventId(): VariantByteString
  • EventId is generated by the Server to uniquely identify a particular Event Notification.

    method

    generateEventId

    Returns VariantT<Buffer, ByteString>

    dataType: "ByteString"

  • EventId is generated by the Server to uniquely identify a particular Event Notification.

    Returns VariantByteString

getDataTypeManager

  • getDataTypeManager(): ExtraDataTypeManager

getDefaultNamespace

getExtensionObjectConstructor

getNamespace

  • getNamespace(namespaceIndexOrName: string | number): NamespacePrivate
  • getNamespace(indexOrName: number | string): Namespace

getNamespaceArray

getNamespaceIndex

  • getNamespaceIndex(namespaceUri: string): number
  • getNamespaceIndex(namespaceUri: string): number
  • method

    getNamespaceIndex

    Parameters

    • namespaceUri: string

    Returns number

    the namespace index of a namespace given by its namespace uri

  • Parameters

    • namespaceUri: string

    Returns number

getNamespaceUri

  • getNamespaceUri(namespaceIndex: number): string
  • getNamespaceUri(namespaceIndex: number): string
  • Parameters

    • namespaceIndex: number

    Returns string

  • Parameters

    • namespaceIndex: number

    Returns string

getOwnNamespace

installAlarmsAndConditionsService

  • installAlarmsAndConditionsService(): void
  • installAlarmsAndConditionsService(): void

installHistoricalDataNode

inverseReferenceType

  • inverseReferenceType(referenceType: string): string
  • inverseReferenceType(referenceType: string): string
  • returns the inverse name of the referenceType.

    method

    inverseReferenceType

    example
    addressSpace.inverseReferenceType("OrganizedBy").should.eql("Organizes");
    addressSpace.inverseReferenceType("Organizes").should.eql("OrganizedBy");

    Parameters

    • referenceType: string

      : the reference type name

    Returns string

    the name of the inverse reference type.

  • Parameters

    • referenceType: string

    Returns string

isEnumeration

  • isEnumeration(dataType: NodeId): boolean
  • Parameters

    • dataType: NodeId

    Returns boolean

normalizeReferenceType

normalizeReferenceTypes

registerNamespace

registerShutdownTask

  • registerShutdownTask(task: function): void
  • register a function that will be called when the server will perform its shut down.

    method

    registerShutdownTask

    Parameters

    Returns void

resolveNodeId

shutdown

  • shutdown(): void
  • shutdown(): void

Static create

  • create(): AddressSpacePublic
  • Returns AddressSpacePublic

Generated using TypeDoc