class documentation
class VirtualResource(Resource):
Known subclasses: acme.resources.CNT_LA.CNT_LA, acme.resources.CNT_OL.CNT_OL, acme.resources.FCNT_LA.FCNT_LA, acme.resources.FCNT_OL.FCNT_OL, acme.resources.GRP_FOPT.GRP_FOPT, acme.resources.NTSR.NTSR, acme.resources.PCH_PCU.PCH_PCU, acme.resources.TS_LA.TS_LA, acme.resources.TS_OL.TS_OL
Constructor: VirtualResource(dct, create)
Base class for all oneM2M virtual resource types. It adds methods for virtual resources.
| Method | initialize |
This method is called when a new resource is created and before written to the database. |
| Method | retrieve |
Retrieve the latest or oldest instance of a container resource. |
| Class Variable | dispatcher |
Injected Dispatcher instance. |
| Class Variable | notification |
Injected NotificationManager instance. |
Inherited from Resource:
| 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 | as |
Get the JSON resource representation. |
| Method | attribute |
Return the value of an attribute. |
| Method | can |
Check whether resource is a valild child resource for this resource. |
| Method | child |
Called after a child resource was added to the resource. |
| Method | child |
Called when a child resource of the resource was removed. |
| Method | child |
Called when a child resource was updated. |
| Method | child |
Called before a child will be added to a resource. |
| Method | create |
Create a child resource from a JSON dictionary. |
| Method | db |
Add the resource to the database. |
| Method | db |
Delete the resource from the database. |
| Method | db |
Load a new copy of the same resource from the database. |
| Method | db |
Reload the resource instance from the database. |
| Method | db |
Update the resource in the database. |
| Method | deactivate |
Deactivate an active resource. |
| Method | decrement |
Decrement the subscription counter for the resource. |
| Method | del |
Delete the attribute 'key' from the resource. |
| Method | get |
Get all attributes of the resource. |
| Method | get |
Retrieve the current originator. This could be different from the originator / creator of the resource in case of the custodian attribute is set. |
| Method | get |
Determine and return the final value of an attribute during an update. |
| Method | get |
Retrieve a resource's location coordinates (internal attribute). |
| Method | get |
Retrieve a resource's originator. |
| Method | get |
Retrieve a resource's release version indicator. |
| Method | get |
Retrieve a resource's full structured resource name. |
| Method | get |
Retrieve the subscription counter for the resource. |
| Method | handle |
Process a CREATE request that is directed to a virtual resource. |
| Method | handle |
Process a DELETE request that is directed to a virtual resource. |
| Method | handle |
Process a notification request that is directed to a resource. |
| Method | handle |
Process a RETRIEVE request that is directed to a virtual resource. |
| Method | handle |
Process a UPDATE request that is directed to a virtual resource. |
| Method | has |
Check whether an attribute exists for the resource. |
| Method | has |
Test whether a resource supports the specified attribute. This method may be overwritten in sub-classes, for example for virtual resources. |
| Method | increment |
Increment the subscription counter for the resource. |
| Method | is |
Test whether a the resource's type is an announced type. |
| Method | is |
Test whether a resource has been created for another resource. |
| Method | is |
Test whether this resource has been modified after another resource. |
| Method | is |
Test whether the resource is a virtual resource. |
| Method | retrieve |
Retrieve the parent resource of this resouce. |
| Method | retrieve |
Retrieve the raw (!) parent resource of this resouce. |
| Method | select |
Determine the selected attributes for a partial retrieve of a resource. |
| Method | set |
Assign a value to a resource attribute. |
| Method | set |
Save the resource ID for which this resource was created for. |
| Method | set |
Set a resource's location coordinates (internal attribute). |
| Method | set |
Set a resource's originator. |
| Method | set |
Set the resource ID for the resource if not already set. |
| Method | set |
Set the resource name. |
| Method | set |
Assign the release version for a resource. |
| Method | set |
Set a resource's full structured resource name. |
| Method | structured |
Determine the structured path of a resource. |
| Method | type |
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 | will |
This method is called before a resource will be deactivated. |
| Method | will |
This method is called before a resource will be send back in a RETRIEVE response. |
| Method | will |
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 | request |
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 | _check |
Check whether a referenced ACP resoure exists, and if yes, change the ID in the list to CSE relative unstructured format. |
| Method | _normalize |
Normalize the URLs in the given attribute. |
| Class Variable | _exclude |
Resource attributes that are excluded when updating the resource |
| Instance Variable | _original |
Original dictionary as it was created. This is used for validation in activate() later. |
overridden in
acme.resources.PCH_PCU.PCH_PCUThis method is called when a new resource is created and before written to the database.
| Parameters | |
pi:str | The parent resource's ID. |
def retrieveLatestOldest(self, request:
CSERequest, originator: str, typ: ResourceTypes, oldest: bool) -> Result:
¶
Retrieve the latest or oldest instance of a container resource.
| Parameters | |
request:CSERequest | The request |
originator:str | The originator |
typ:ResourceTypes | The resource type of the instances |
oldest:bool | Whether to retrieve the oldest instance |
| Returns | |
Result | The result of the operation. |
overridden in
acme.resources.CNT_LA.CNT_LA, acme.resources.CNT_OL.CNT_OL, acme.resources.FCNT_LA.FCNT_LA, acme.resources.FCNT_OL.FCNT_OL, acme.resources.TS_LA.TS_LA, acme.resources.TS_OL.TS_OLInjected Dispatcher instance.