class documentation

class RegistrationManager:

View In Hierarchy

RegistrationManager to handle registrations and de-registrations resources.

Method checkResourceCreation Check the creation of a resource, for example handle registrations for AE, CSR and CSEBase resources.
Method checkResourceDeletion Check the deletion of a resource, for example handle de-registrations for AE, CSR and REQ resources.
Method checkResourceUpdated Check the update of a resource, for example handle updates for CSR resources.
Method configUpdate Handle configuration updates.
Method deregisterSOriginator Deregister the S-Originator for an <AE> resource.
Method expirationDBMonitor Check the database for expired resources and delete them. This is called periodically by the expiration monitor.
Method handleAEDeRegistration Handle the de-registration of an AE resource. This includes the deletion of the originator and sending events.
Method handleAERegistration This method creates a new originator for the AE registration, depending on the method choosen.
Method handleCreator Check for set creator attribute as well as assign it to allowed resources.
Method handleCSEBaseAnncRegistration Handle the registration of a <CSEBaseAnnc> resource.
Method handleCSEBaseRegistration Handle the registration of a <CSEBase> resource.
Method handleCSRRegistration Handle the registration of a <CSR> resource.
Method handleCSRUpdate Handle the update of a <CSR> resource.
Method handleRegistreeCSRDeRegistration Handle the de-registration of a registree <CSR> resource.
Method handleREQDeRegistration Handle the de-registration of a <REQ> resource.
Method handleREQRegistration Handle the registration of a <REQ> resource.
Method hasRegisteredAE Check wether an AE with originator is registered at the CSE.
Method initialize Initialize the RegistrationManager.
Method postResourceCreation Handle some post-create aspects, for example send events for some resources.
Method postResourceDeletion Handle some post-delete aspects, for example send events for some resources.
Method registerSOriginator Register the S-Originator for an AE resource.
Method restart Restart the registration services.
Method restartExpirationMonitor Restart the expiration monitor, for example after a CSE restart.
Method shutdown Shutdown the RegistrationManager.
Method startExpirationMonitor Start the expiration monitor, which periodically checks for expired resources and deletes them.
Method stopExpirationMonitor Stop the expiration monitor.
Class Variable __slots__ Slots for the RegistrationManager.
Class Variable dispatcher Injected Dispatcher instance.
Class Variable importer Injected Importer instance.
Class Variable remoteCSEManager Injected RemoteCSEManager plugin, if available.
Class Variable securityManager Injected SecurityManager instance.
Class Variable storage Injected Storage instance.
Class Variable validator Validator instance.
Instance Variable expWorker Background worker for checking expired resources.
def checkResourceCreation(self, resource: Resource, originator: str, parentResource: Resource | None = None) -> str:

Check the creation of a resource, for example handle registrations for AE, CSR and CSEBase resources.

Parameters
resource:ResourceThe resource to be created.
originator:strThe originator of the request that triggered the creation of the resource.
parentResource:Resource | NoneThe parent resource of the resource to be created, if available.
Returns
str
The (possibly new) originator to be used for the resource creation.
This is relevant for AE registrations, where a new originator is created for the registered AE.
Raises
OPERATION_NOT_ALLOWEDIf the operation is not allowed.
BAD_REQUESTIf the request is malformed or invalid.
def checkResourceDeletion(self, resource: Resource):

Check the deletion of a resource, for example handle de-registrations for AE, CSR and REQ resources.

Parameters
resource:ResourceThe resource to be deleted.
Raises
BAD_REQUESTIf the deletion is not allowed for the resource type.
def checkResourceUpdated(self, resource: Resource, updateDict: JSON):

Check the update of a resource, for example handle updates for CSR resources.

Parameters
resource:ResourceThe resource to be updated.
updateDict:JSONThe update dict with the new values for the resource attributes.
Raises
BAD_REQUESTIf the update is not allowed for the resource type.
@onEvent(eventManager.configUpdate)
def configUpdate(self, eventData: EventData):

Handle configuration updates.

Parameters
eventData:EventDataThe event data, containing the name of the updated configuration setting and its new value.
def deregisterSOriginator(self, ae: Resource):

Deregister the S-Originator for an <AE> resource.

Parameters
ae:ResourceThe <AE> resource.
def expirationDBMonitor(self) -> bool:

Check the database for expired resources and delete them. This is called periodically by the expiration monitor.

Returns
boolAlways True.
def handleAEDeRegistration(self, ae: Resource) -> bool:

Handle the de-registration of an AE resource. This includes the deletion of the originator and sending events.

Parameters
ae:ResourceThe <AE> resource to be de-registered.
Returns
boolAlways True.
def handleAERegistration(self, ae: Resource, originator: str, parentResource: Resource) -> str:

This method creates a new originator for the AE registration, depending on the method choosen.

Parameters
ae:ResourceThe AE resource to be registered.
originator:strThe originator of the request that triggered the registration of the AE. This can be empty, in which case a new originator is created for the AE.
parentResource:ResourceThe parent resource of the AE to be registered. This should be the CSEBase resource.
Returns
strThe originator to be used for the AE registration.
Raises
APP_RULE_VALIDATION_FAILEDIf the originator is not allowed.
INVALID_CHILD_RESOURCE_TYPEIf the parent resource is not the CSEBase.
def handleCreator(self, resource: Resource, originator: str):

Check for set creator attribute as well as assign it to allowed resources.

Parameters
resource:ResourceThe resource for which to check and set the creator attribute.
originator:strThe originator to set as creator, if allowed.
Raises
BAD_REQUESTIf the creator attribute is not allowed for the resource type, or if the originator is not allowed to be set as creator.
def handleCSEBaseAnncRegistration(self, cbA: Resource, originator: str):

Handle the registration of a <CSEBaseAnnc> resource.

Parameters
cbA:ResourceThe <CSEBaseAnnc> resource to be registered.
originator:strThe originator of the request that triggered the registration of the <CSEBaseAnnc>.
Raises
CONFLICTIf a <CSEBaseAnnc> with the same lnk already exists.
def handleCSEBaseRegistration(self, cb: Resource, originator: str):

Handle the registration of a <CSEBase> resource.

Parameters
cb:ResourceThe <CSEBase> resource to be registered.
originator:strThe originator for the CSEBase registration. This should be the Admin originator.
Raises
CONFLICTIf a <CSEBase> with the same csi already exists, which means that a CSEBase can only be registered once.
def handleCSRRegistration(self, csr: Resource, originator: str):

Handle the registration of a <CSR> resource.

Parameters
csr:ResourceThe <CSR> resource to be registered.
originator:strThe originator of the request that triggered the registration of the <CSR>.
Raises
OPERATION_NOT_ALLOWEDIf the registration is not allowed.
NOT_IMPLEMENTEDIf the RemoteCSEManager is disabled.
def handleCSRUpdate(self, csr: Resource, updateDict: JSON) -> bool:

Handle the update of a <CSR> resource.

Parameters
csr:ResourceThe <CSR> resource to be updated.
updateDict:JSONThe update dict with the new values for the resource attributes.
Returns
boolAlways True.
def handleRegistreeCSRDeRegistration(self, registreeCSR: Resource) -> bool:

Handle the de-registration of a registree <CSR> resource.

Parameters
registreeCSR:ResourceThe <CSR> resource to de-register.
Returns
boolAlways True.
def handleREQDeRegistration(self, resource: Resource) -> bool:

Handle the de-registration of a <REQ> resource.

Parameters
resource:ResourceThe <REQ> resource to be de-registered.
Returns
boolAlways True.
def handleREQRegistration(self, req: Resource, originator: str) -> bool:

Handle the registration of a <REQ> resource.

Parameters
req:ResourceThe <REQ> resource to be registered.
originator:strThe originator of the request that triggered the registration of the <REQ>.
Returns
boolAlways True.
def hasRegisteredAE(self, originator: str) -> bool:

Check wether an AE with originator is registered at the CSE.

Return
True if the originator is registered with the CSE.

Todo

Currently this is done by searching the storage. This should be optimized by using an index for the originator.

Parameters
originator:strID of the originator / AE.
Returns
boolUndocumented
def initialize(self):

Initialize the RegistrationManager.

def postResourceCreation(self, resource: Resource):

Handle some post-create aspects, for example send events for some resources.

Parameters
resource:ResourceResource that was created.
def postResourceDeletion(self, resource: Resource):

Handle some post-delete aspects, for example send events for some resources.

Parameters
resource:ResourceResource that was created.
def registerSOriginator(self, ae: Resource, originator: str) -> str:

Register the S-Originator for an AE resource.

Parameters
ae:ResourceThe <AE> resource.
originator:strThe original originator.
Returns
strThe assigned S-Originator.
@onEvent(eventManager.cseReset)
def restart(self, eventData: EventData):

Restart the registration services.

def restartExpirationMonitor(self):

Restart the expiration monitor, for example after a CSE restart.

def shutdown(self) -> bool:

Shutdown the RegistrationManager.

Returns
boolAlways True.
def startExpirationMonitor(self):

Start the expiration monitor, which periodically checks for expired resources and deletes them.

def stopExpirationMonitor(self):

Stop the expiration monitor.

__slots__: tuple[str, ...] =

Slots for the RegistrationManager.

dispatcher: Dispatcher =

Injected Dispatcher instance.

importer: Importer =

Injected Importer instance.

remoteCSEManager: RemoteCSEManager | None =

Injected RemoteCSEManager plugin, if available.

securityManager: SecurityManager =

Injected SecurityManager instance.

storage: Storage =

Injected Storage instance.

validator: Validator =

Validator instance.

expWorker: BackgroundWorker =

Background worker for checking expired resources.