RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
comms.repository.RepositoryControl Class Reference

Interface for accessing a repository deriving from RepositoryIf asynchronously and mapping to Qt signals. More...

Inheritance diagram for comms.repository.RepositoryControl:
comms.repository.PersistentRepoControl comms.repository.RuntimeRepoControl

Classes

class  _CreateDeleteSubscribeRequest
 
class  _CreateRequest
 
class  _CreateSymlinkRequest
 
class  _DeleteRequest
 
class  _ExistsRequest
 
class  _GetChildrenRequest
 
class  _PartialReadRequest
 
class  _PartialWriteRequest
 
class  _ReadMetaDataRequest
 
class  _ReadRequest
 
class  _ResponseContext
 
class  _UnsubscribeRequest
 
class  _UpdateSymlinkRequest
 
class  _ValueSubscribeRequest
 
class  _WriteMetaDataRequest
 
class  _WriteRequest
 
class  BatchRequest
 A class representing a batch of individual datapoint requests to be sent to the repository adapter for handling. More...
 
class  RequestSkipped
 Exception created when an individual repository request was marked as skipped. More...
 

Public Member Functions

 __init__ (self, RepositoryIf repository, *args, logger=None, **kwargs)
 
 get_repository (self)
 Return the repository adapter this control object was constructed with.
 
None send_requests (self, BatchRequest batch)
 Sends a BatchRequest object to the repository adapter for processing.
 

Static Public Attributes

 get_children_complete = Signal(object, list, list, object)
 Signal indicating that a get_children request has completed successfully.
 
 get_children_failed = Signal(object, object, object)
 Signal indicating that a get_children request has failed.
 
 data_point_exists_complete = Signal(object, bool, object)
 Signal indicating that a data_point_exists request has completed successfully.
 
 data_point_exists_failed = Signal(object, object, object)
 Signal indicating that a data_point_exists request has failed.
 
 create_data_point_complete = Signal(object, object)
 Signal indicating that a create_data_point request has completed successfully.
 
 create_data_point_failed = Signal(object, object, object)
 Signal indicating that a create_data_point request has failed.
 
 delete_data_point_complete = Signal(object, object)
 Signal indicating that a delete_data_point request has completed successfully.
 
 delete_data_point_failed = Signal(object, object, object)
 Signal indicating that a delete_data_point request has failed.
 
 read_meta_data_complete = Signal(object, object, object)
 Signal indicating that a read_meta_data request has completed successfully.
 
 read_meta_data_failed = Signal(object, object, object)
 Signal indicating that a read_meta_data request has failed.
 
 write_meta_data_complete = Signal(object, object)
 Signal indicating that a write_meta_data request has completed successfully.
 
 write_meta_data_failed = Signal(object, object, object)
 Signal indicating that a write_meta_data request has failed.
 
 read_data_point_complete = Signal(object, object)
 Signal indicating that a read_data_point request has completed successfully.
 
 read_data_point_failed = Signal(object, object, object)
 Signal indicating that a read_data_point request has failed.
 
 write_data_point_complete = Signal(object, object)
 Signal indicating that a write_data_point request has completed successfully.
 
 write_data_point_failed = Signal(object, object, object)
 Signal indicating that a write_data_point request has failed.
 
 partial_read_data_point_complete = Signal(object, object)
 Signal indicating that a partial_read_data_point request has completed successfully.
 
 partial_read_data_point_failed = Signal(object, object, object)
 Signal indicating that a partial_read_data_point request has failed.
 
 partial_write_data_point_complete = Signal(object, object)
 Signal indicating that a partial_write_data_point request has completed successfully.
 
 partial_write_data_point_failed = Signal(object, object, object)
 Signal indicating that a partial_write_data_point request has failed.
 
 data_point_updated = Signal(object, object, object)
 Signal sent whenever a datapoint has been updated.
 
 metadata_updated = Signal(object, dict, object)
 Signal sent whenever a datapoint's metadata has been updated.
 
 create_symlink_complete = Signal(object, object)
 Signal indicating that a create_symlink request has completed successfully.
 
 create_symlink_failed = Signal(object, object, object)
 Signal indicating that a create_symlink request has failed.
 
 update_symlink_complete = Signal(object, object)
 Signal indicating that an update_symlink request has completed successfully.
 
 update_symlink_failed = Signal(object, object, object)
 Signal indicating that an update_symlink request has failed.
 

Protected Member Functions

 _create_handler_thread (self)
 
 _create_adapter_request (self)
 This method must create a correct BatchRequest object from the adapter in derived child classes.
 
 _prepare_get_children_request (self, adapter_request, request)
 
 _prepare_exists_request (self, adapter_request, request)
 
 _prepare_create_request (self, adapter_request, request)
 
 _prepare_delete_request (self, adapter_request, request)
 
 _prepare_read_meta_data_request (self, adapter_request, request)
 
 _prepare_write_meta_data_request (self, adapter_request, request)
 
 _prepare_read_request (self, adapter_request, request)
 
 _prepare_write_request (self, adapter_request, request)
 
 _prepare_partial_read_request (self, adapter_request, request)
 
 _prepare_partial_write_request (self, adapter_request, request)
 
 _prepare_create_symlink_request (self, adapter_request, request)
 
 _prepare_update_symlink_request (self, adapter_request, request)
 
 _prepare_create_delete_subscribe_request (self, adapter_request, request)
 
 _prepare_value_subscribe_request (self, adapter_request, request)
 
 _prepare_unsubscribe_request (self, adapter_request, request)
 
 _handle_responses (self)
 Processes response objects created in send_requests when batch requests are sent to the repository adapter.
 

Protected Attributes

 _logger = CiiLogManager.get_logger(__name__)
 
dict _prepare_request_map
 
 _repository = repository
 
list _pending_responses = []
 
 _subscriptions = set()
 
 _timer = QTimer()
 
 _handle_responses
 
 _timer_finalizer = finalize(self._timer, _cleanup_timer, self._timer)
 

Detailed Description

Interface for accessing a repository deriving from RepositoryIf asynchronously and mapping to Qt signals.

Constructor & Destructor Documentation

◆ __init__()

comms.repository.RepositoryControl.__init__ ( self,
RepositoryIf repository,
* args,
logger = None,
** kwargs )

Member Function Documentation

◆ _create_adapter_request()

comms.repository.RepositoryControl._create_adapter_request ( self)
protected

This method must create a correct BatchRequest object from the adapter in derived child classes.

Note that RepositoryIf::BatchRequest and RepositorySubscriberIf::BatchRequest are not the same.

Reimplemented in comms.repository.PersistentRepoControl, and comms.repository.RuntimeRepoControl.

◆ _create_handler_thread()

comms.repository.RepositoryControl._create_handler_thread ( self)
protected

◆ _handle_responses()

comms.repository.RepositoryControl._handle_responses ( self)
protected

Processes response objects created in send_requests when batch requests are sent to the repository adapter.

This method is called by regular timer signals from "_timer".

◆ _prepare_create_delete_subscribe_request()

comms.repository.RepositoryControl._prepare_create_delete_subscribe_request ( self,
adapter_request,
request )
protected

◆ _prepare_create_request()

comms.repository.RepositoryControl._prepare_create_request ( self,
adapter_request,
request )
protected

◆ _prepare_create_symlink_request()

comms.repository.RepositoryControl._prepare_create_symlink_request ( self,
adapter_request,
request )
protected

◆ _prepare_delete_request()

comms.repository.RepositoryControl._prepare_delete_request ( self,
adapter_request,
request )
protected

◆ _prepare_exists_request()

comms.repository.RepositoryControl._prepare_exists_request ( self,
adapter_request,
request )
protected

◆ _prepare_get_children_request()

comms.repository.RepositoryControl._prepare_get_children_request ( self,
adapter_request,
request )
protected

◆ _prepare_partial_read_request()

comms.repository.RepositoryControl._prepare_partial_read_request ( self,
adapter_request,
request )
protected

◆ _prepare_partial_write_request()

comms.repository.RepositoryControl._prepare_partial_write_request ( self,
adapter_request,
request )
protected

◆ _prepare_read_meta_data_request()

comms.repository.RepositoryControl._prepare_read_meta_data_request ( self,
adapter_request,
request )
protected

◆ _prepare_read_request()

comms.repository.RepositoryControl._prepare_read_request ( self,
adapter_request,
request )
protected

◆ _prepare_unsubscribe_request()

comms.repository.RepositoryControl._prepare_unsubscribe_request ( self,
adapter_request,
request )
protected

◆ _prepare_update_symlink_request()

comms.repository.RepositoryControl._prepare_update_symlink_request ( self,
adapter_request,
request )
protected

◆ _prepare_value_subscribe_request()

comms.repository.RepositoryControl._prepare_value_subscribe_request ( self,
adapter_request,
request )
protected

◆ _prepare_write_meta_data_request()

comms.repository.RepositoryControl._prepare_write_meta_data_request ( self,
adapter_request,
request )
protected

◆ _prepare_write_request()

comms.repository.RepositoryControl._prepare_write_request ( self,
adapter_request,
request )
protected

◆ get_repository()

comms.repository.RepositoryControl.get_repository ( self)

Return the repository adapter this control object was constructed with.

◆ send_requests()

None comms.repository.RepositoryControl.send_requests ( self,
BatchRequest batch )

Sends a BatchRequest object to the repository adapter for processing.

All responses are mapped back to Qt signals.

Member Data Documentation

◆ _handle_responses

comms.repository.RepositoryControl._handle_responses
protected

◆ _logger

comms.repository.RepositoryControl._logger = CiiLogManager.get_logger(__name__)
protected

◆ _pending_responses

list comms.repository.RepositoryControl._pending_responses = []
protected

◆ _prepare_request_map

dict comms.repository.RepositoryControl._prepare_request_map
protected
Initial value:
= {
self._GetChildrenRequest: self._prepare_get_children_request,
self._ExistsRequest: self._prepare_exists_request,
self._CreateRequest: self._prepare_create_request,
self._DeleteRequest: self._prepare_delete_request,
self._ReadMetaDataRequest: self._prepare_read_meta_data_request,
self._WriteMetaDataRequest: self._prepare_write_meta_data_request,
self._ReadRequest: self._prepare_read_request,
self._WriteRequest: self._prepare_write_request,
self._PartialReadRequest: self._prepare_partial_read_request,
self._PartialWriteRequest: self._prepare_partial_write_request,
self._CreateSymlinkRequest: self._prepare_create_symlink_request,
self._UpdateSymlinkRequest: self._prepare_update_symlink_request,
self._CreateDeleteSubscribeRequest: self._prepare_create_delete_subscribe_request,
self._ValueSubscribeRequest: self._prepare_value_subscribe_request,
self._UnsubscribeRequest: self._prepare_unsubscribe_request,
}

◆ _repository

comms.repository.RepositoryControl._repository = repository
protected

◆ _subscriptions

comms.repository.RepositoryControl._subscriptions = set()
protected

◆ _timer

comms.repository.RepositoryControl._timer = QTimer()
protected

◆ _timer_finalizer

comms.repository.RepositoryControl._timer_finalizer = finalize(self._timer, _cleanup_timer, self._timer)
protected

◆ create_data_point_complete

comms.repository.RepositoryControl.create_data_point_complete = Signal(object, object)
static

Signal indicating that a create_data_point request has completed successfully.

The signal will receive the following arguments: the path of the created datapoint, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ create_data_point_failed

comms.repository.RepositoryControl.create_data_point_failed = Signal(object, object, object)
static

Signal indicating that a create_data_point request has failed.

The signal will receive the following arguments: the path being created, the exception object, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ create_symlink_complete

comms.repository.RepositoryControl.create_symlink_complete = Signal(object, object)
static

Signal indicating that a create_symlink request has completed successfully.

The signal will receive the following arguments: the path of the created symlink, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ create_symlink_failed

comms.repository.RepositoryControl.create_symlink_failed = Signal(object, object, object)
static

Signal indicating that a create_symlink request has failed.

The signal will receive the following arguments: the symlink path being created, the exception object, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ data_point_exists_complete

comms.repository.RepositoryControl.data_point_exists_complete = Signal(object, bool, object)
static

Signal indicating that a data_point_exists request has completed successfully.

The signal will receive the following arguments: the path queried, the boolean result, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ data_point_exists_failed

comms.repository.RepositoryControl.data_point_exists_failed = Signal(object, object, object)
static

Signal indicating that a data_point_exists request has failed.

The signal will receive the following arguments: the path queried, the exception object, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ data_point_updated

comms.repository.RepositoryControl.data_point_updated = Signal(object, object, object)
static

Signal sent whenever a datapoint has been updated.

The signal will receive the following arguments: the path to the datapoint, the buffer object containing the new value, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ delete_data_point_complete

comms.repository.RepositoryControl.delete_data_point_complete = Signal(object, object)
static

Signal indicating that a delete_data_point request has completed successfully.

The signal will receive the following arguments: path of the deleted datapoint, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ delete_data_point_failed

comms.repository.RepositoryControl.delete_data_point_failed = Signal(object, object, object)
static

Signal indicating that a delete_data_point request has failed.

The signal will receive the following arguments: the path being deleted, the exception object, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ get_children_complete

comms.repository.RepositoryControl.get_children_complete = Signal(object, list, list, object)
static

Signal indicating that a get_children request has completed successfully.

The signal will receive the following arguments: the path queried, the child datapoint paths, the sub paths, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ get_children_failed

comms.repository.RepositoryControl.get_children_failed = Signal(object, object, object)
static

Signal indicating that a get_children request has failed.

The signal will receive the following arguments: the path queried, the exception object, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ metadata_updated

comms.repository.RepositoryControl.metadata_updated = Signal(object, dict, object)
static

Signal sent whenever a datapoint's metadata has been updated.

The signal will receive the following arguments: the path to the datapoint, the metadata dictionary, the tag. The tag object is the one provided by the user in the original request, which can be None if no tag was provided.

◆ partial_read_data_point_complete

comms.repository.RepositoryControl.partial_read_data_point_complete = Signal(object, object)
static

Signal indicating that a partial_read_data_point request has completed successfully.

The signal will receive the following arguments: the path queried, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ partial_read_data_point_failed

comms.repository.RepositoryControl.partial_read_data_point_failed = Signal(object, object, object)
static

Signal indicating that a partial_read_data_point request has failed.

The signal will receive the following arguments: the path queried, the exception object, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ partial_write_data_point_complete

comms.repository.RepositoryControl.partial_write_data_point_complete = Signal(object, object)
static

Signal indicating that a partial_write_data_point request has completed successfully.

The signal will receive the following arguments: the path being updated, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ partial_write_data_point_failed

comms.repository.RepositoryControl.partial_write_data_point_failed = Signal(object, object, object)
static

Signal indicating that a partial_write_data_point request has failed.

The signal will receive the following arguments: the path queried, the exception object, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ read_data_point_complete

comms.repository.RepositoryControl.read_data_point_complete = Signal(object, object)
static

Signal indicating that a read_data_point request has completed successfully.

The signal will receive the following arguments: the path queried, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ read_data_point_failed

comms.repository.RepositoryControl.read_data_point_failed = Signal(object, object, object)
static

Signal indicating that a read_data_point request has failed.

The signal will receive the following arguments: the path queried, the exception object, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ read_meta_data_complete

comms.repository.RepositoryControl.read_meta_data_complete = Signal(object, object, object)
static

Signal indicating that a read_meta_data request has completed successfully.

The signal will receive the following arguments: the path queried, a dictionary containing the metadata, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ read_meta_data_failed

comms.repository.RepositoryControl.read_meta_data_failed = Signal(object, object, object)
static

Signal indicating that a read_meta_data request has failed.

The signal will receive the following arguments: the path queried, the exception object, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ update_symlink_complete

comms.repository.RepositoryControl.update_symlink_complete = Signal(object, object)
static

Signal indicating that an update_symlink request has completed successfully.

The signal will receive the following arguments: the path of the updated symlink, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ update_symlink_failed

comms.repository.RepositoryControl.update_symlink_failed = Signal(object, object, object)
static

Signal indicating that an update_symlink request has failed.

The signal will receive the following arguments: the symlink path being updated, the exception object, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ write_data_point_complete

comms.repository.RepositoryControl.write_data_point_complete = Signal(object, object)
static

Signal indicating that a write_data_point request has completed successfully.

The signal will receive the following arguments: the path being updated, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ write_data_point_failed

comms.repository.RepositoryControl.write_data_point_failed = Signal(object, object, object)
static

Signal indicating that a write_data_point request has failed.

The signal will receive the following arguments: the path being updated, the exception object, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ write_meta_data_complete

comms.repository.RepositoryControl.write_meta_data_complete = Signal(object, object)
static

Signal indicating that a write_meta_data request has completed successfully.

The signal will receive the following arguments: the path being updated, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.

◆ write_meta_data_failed

comms.repository.RepositoryControl.write_meta_data_failed = Signal(object, object, object)
static

Signal indicating that a write_meta_data request has failed.

The signal will receive the following arguments: the path being updated, the exception object, the tag. The tag object is the one provided by the user in the request, which can be None if no tag was provided.


The documentation for this class was generated from the following file: