class documentation

class BaseServer(Generic[_UaObjectType]):

Constructor: BaseServer(**kwargs)

View In Hierarchy

Base class for both client RemoteServer and server Server.

Method __init__ Cooperative constructor.
Method get_ua_object Return the UaObject which corresponds to the given ua_node.
Method get_ua_object_optional Return the UaObject which corresponds to the given ua_node or None.
Method register_ua_object Register the given UaObject to the server.
Method ua_get_namespace_index Return the namespace index for the given namespace uri.
Method ua_get_node_id Return the complete OPC UA node ID for the given identifier.
Method unregister_ua_object Unregister the given UaObject from the server.
Instance Variable _namespace_map Undocumented
Instance Variable _ua_objects Maps OPC UA nodes to UaObjects with weak references.
def __init__(self, **kwargs):

Cooperative constructor.

def get_ua_object(self, ua_node_id: ua.NodeId) -> _UaObjectType:

Return the UaObject which corresponds to the given ua_node.

Raises
KeyErrorIf no UaObject is found.
def get_ua_object_optional(self, ua_node_id: ua.NodeId) -> _UaObjectType | None:

Return the UaObject which corresponds to the given ua_node or None.

def register_ua_object(self, ua_object: _UaObjectType):

Register the given UaObject to the server.

def ua_get_namespace_index(self, uri: str | type[NamespaceProvider]) -> ua.Int16:

Return the namespace index for the given namespace uri.

Raises
KeyErrorIf the namespace URI is unknown.
def ua_get_node_id(self, identifier: NodeIdDefinition) -> ua.NodeId:

Return the complete OPC UA node ID for the given identifier.

Raises
KeyErrorIf the namespace URI of the identifier is unknown.
def unregister_ua_object(self, ua_object: _UaObjectType):

Unregister the given UaObject from the server.

_namespace_map: dict[str, int] =

Undocumented

_ua_objects: WeakValueDictionary[ua.NodeId, _UaObjectType] =

Maps OPC UA nodes to UaObjects with weak references.