class documentation

This class implements the virtual <latest> resource for <flexContainer> resources.

Method handleCreateRequest Handle a CREATE request.
Method handleDeleteRequest Handle a DELETE request.
Method handleRetrieveRequest Handle a RETRIEVE request.
Method handleUpdateRequest Handle an UPDATE request.
Method hasAttributeDefined Test whether a resource supports the specified attribute. This method may be overwritten in sub-classes, for example for virtual resources.
Class Variable dispatcher Injected Dispatcher instance.

Inherited from VirtualResource:

Method initialize This method is called when a new resource is created and before written to the database.
Method retrieveLatestOldest Retrieve the latest or oldest instance of a container resource.
Class Variable notificationManager Injected NotificationManager instance.

Inherited from Resource (via VirtualResource):

Method __contains__ Implementation of the membership test operator.
Method __delitem__ Implementation of the self[key| operation for deleting attributes.
Method __eq__ Test for equality of the resource to another resource.
Method __getattr__ Map the normal object attribute access to the internal resource attribute dictionary.
Method __getitem__ Implementation of the self[key| operation for retrieving attributes.
Method __init__ Initialization of a Resource instance.
Method __repr__ Object representation as string.
Method __setitem__ Implementation of the self[key] operation for assigning to attributes.
Method __str__ String representation of the resource's attributes.
Method activate This method is called to activate a resource, usually in a CREATE request.
Method asDict Get the JSON resource representation.
Method attribute Return the value of an attribute.
Method canHaveChild Check whether resource is a valild child resource for this resource.
Method childAdded Called after a child resource was added to the resource.
Method childRemoved Called when a child resource of the resource was removed.
Method childUpdated Called when a child resource was updated.
Method childWillBeAdded Called before a child will be added to a resource.
Method createChildResourceFromDict Create a child resource from a JSON dictionary.
Method dbCreate Add the resource to the database.
Method dbDelete Delete the resource from the database.
Method dbReload Load a new copy of the same resource from the database.
Method dbReloadDict Reload the resource instance from the database.
Method dbUpdate Update the resource in the database.
Method deactivate Deactivate an active resource.
Method decrementSubscriptionCounter Decrement the subscription counter for the resource.
Method delAttribute Delete the attribute 'key' from the resource.
Method getAttributes Get all attributes of the resource.
Method getCurrentOriginator Retrieve the current originator. This could be different from the originator / creator of the resource in case of the custodian attribute is set.
Method getFinalResourceAttribute Determine and return the final value of an attribute during an update.
Method getLocationCoordinates Retrieve a resource's location coordinates (internal attribute).
Method getOriginator Retrieve a resource's originator.
Method getRVI Retrieve a resource's release version indicator.
Method getSrn Retrieve a resource's full structured resource name.
Method getSubscriptionCounter Retrieve the subscription counter for the resource.
Method handleNotification Process a notification request that is directed to a resource.
Method hasAttribute Check whether an attribute exists for the resource.
Method incrementSubscriptionCounter Increment the subscription counter for the resource.
Method isAnnounced Test whether a the resource's type is an announced type.
Method isCreatedInternally Test whether a resource has been created for another resource.
Method isModifiedAfter Test whether this resource has been modified after another resource.
Method isVirtual Test whether the resource is a virtual resource.
Method retrieveParentResource Retrieve the parent resource of this resouce.
Method retrieveParentResourceRaw Retrieve the raw (!) parent resource of this resouce.
Method selectAttributes Determine the selected attributes for a partial retrieve of a resource.
Method setAttribute Assign a value to a resource attribute.
Method setCreatedInternally Save the resource ID for which this resource was created for.
Method setLocationCoordinates Set a resource's location coordinates (internal attribute).
Method setOriginator Set a resource's originator.
Method setResourceID Set the resource ID for the resource if not already set.
Method setResourceName Set the resource name.
Method setRVI Assign the release version for a resource.
Method setSrn Set a resource's full structured resource name.
Method structuredPath Determine the structured path of a resource.
Method typeAsString Return the resource type as a string. If the resource is a flex container, the specialization is added.
Method update Update, add or remove resource attributes.
Method updated Signal to a resource that is was successfully updated.
Method validate Validate a resource.
Method willBeDeactivated This method is called before a resource will be deactivated.
Method willBeRetrieved This method is called before a resource will be send back in a RETRIEVE response.
Method willBeUpdated This method is called before a resource will be updated and before calling the update() method.
Class Variable __slots__ Slots for the class.
Class Variable factory Injected Factory instance.
Class Variable importer Injected Importer instance.
Class Variable requestManager Injected RequestManager instance.
Class Variable storage Injected Storage instance.
Class Variable validator Injected Validator instance.
Instance Variable dict Dictionary for public and internal resource attributes.
Method _checkAndFixACPIreferences Check whether a referenced ACP resoure exists, and if yes, change the ID in the list to CSE relative unstructured format.
Method _normalizeURIAttribute Normalize the URLs in the given attribute.
Class Variable _excludeFromUpdate Resource attributes that are excluded when updating the resource
Instance Variable _originalDict Original dictionary as it was created. This is used for validation in activate() later.
def handleCreateRequest(self, request: CSERequest, id: str, originator: str) -> Result:

Handle a CREATE request.

Parameters
request:CSERequestThe request to process.
id:strThe structured or unstructured resource ID of the target resource.
originator:strThe request's originator.
Returns
ResultUndocumented
Raises
OPERATION_NOT_ALLOWEDFails with error code for this resource type.
def handleDeleteRequest(self, request: CSERequest, id: str, originator: str) -> Result:

Handle a DELETE request.

Delete the latest resource.

Parameters
request:CSERequestThe request to process.
id:strThe structured or unstructured resource ID of the target resource.
originator:strThe request's originator.
Returns
ResultResult object indicating success or failure.
def handleRetrieveRequest(self, request: CSERequest | None = None, id: str | None = None, originator: str | None = None) -> Result:

Handle a RETRIEVE request.

Parameters
request:CSERequest | NoneThe original request.
id:str | NoneResource ID of the original request.
originator:str | NoneThe request's originator.
Returns
ResultThe latest <flexContainerInstance> for the parent <flexContainer>, or an error Result.
def handleUpdateRequest(self, request: CSERequest, id: str, originator: str) -> Result:

Handle an UPDATE request.

Parameters
request:CSERequestThe request to process.
id:strThe structured or unstructured resource ID of the target resource.
originator:strThe request's originator.
Returns
ResultUndocumented
Raises
OPERATION_NOT_ALLOWEDFails with error code for this resource type.
def hasAttributeDefined(self, name: str) -> bool:

Test whether a resource supports the specified attribute. This method may be overwritten in sub-classes, for example for virtual resources.

Parameters
name:strAttribute to test.
Returns
boolBoolean with the result of the test.
dispatcher: Dispatcher =

Injected Dispatcher instance.