A class that implements data source that is able to load content from Kanzi Connect server. More...
#include <kanzi_connect_datasource.hpp>
Public Member Functions | |
KZ_METACLASS_END () | |
virtual | ~KanziConnectDataSource () override |
![]() | |
KZ_METACLASS_END () | |
void | onDataObjectChanged (RuntimeDataObjectWeakPtr runtimeObject, const DataObjectSharedPtr dataObject) |
Handler for changes coming from the DataObjects under the data source data tree. | |
virtual void | onPropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) override |
void | start () |
Starts operation. | |
void | stop () |
Stops operation. | |
virtual | ~AbstractConnectDataSource () override |
Destructor. | |
virtual DataObjectSharedPtr | getData () override |
virtual void | loadFromKZB (Domain *domain, KzbFile &kzbFile, ReadOnlyMemoryFile &file, KzbMemoryParser &parser) override |
virtual void | unloadOverride () |
![]() | |
void | addAdapter (ContentAdapterSharedPtr adapter) |
Adds new adapter to list of adapters, but does not set up or start it. | |
ContentAdapterManager (ContextSharedPtr context, DataSource *dataSource) | |
Constructor. | |
ContentAdapterManager (DataSource *dataSource) | |
Constructor. | |
virtual ContentAdapterSharedPtr | createAdapter (const string &serverName, const ContentAdapterConfigurationSharedPtr config, Domain *domain) |
Creates a standard adapter. | |
void | destroyAllAdapters () |
Stops and cleans up all adapters. | |
ContentAdapterSharedPtr | findDynamicSource (const string &name) |
Locates a dynamic source with given name. | |
ContentAdapterSharedPtr | findSource (const string &name) |
Locates a source with given name. | |
ContentAdapterManager::AdapterContainer | getAdapters () |
Retrieves all currently known adapters. | |
ContextSharedPtr | getContext () const |
Returns gateway to Kanzi Connect server. | |
void | initializeAllAdapters (DataObjectSharedPtr root) |
Initializes all adapters. | |
void | removeAdapter (ContentAdapterSharedPtr adapter) |
Removes adapter from list of adapters. | |
void | setContext (ContextSharedPtr context) |
Set gateway to Kanzi Connect server. | |
virtual ContentAdapterSharedPtr | startAdapter (const string &serverName, DataObjectSharedPtr root, const ContentAdapterConfigurationSharedPtr config) |
Instantiates and starts new adapter according to given parameters. | |
void | startAllAdapters () |
Starts all adapters. | |
virtual void | stopAdapter (ContentAdapterSharedPtr adapter) |
Stops an existing adapter. | |
void | stopAllAdapters () |
Stops all existing adapters. | |
virtual | ~ContentAdapterManager ()=default |
dtor | |
Static Public Member Functions | |
static KanziConnectDataSourceSharedPtr | create (Domain *domain, string_view name) |
Creates new instance of Kanzi Connect DataSource. | |
static void | takeDataSnapshot (Domain *domain, const string &uri, string &schema, string &data) |
Takes data snapshot as XML document. | |
Static Public Attributes | |
static PropertyType< string > | XmlDeclarationProperty |
static PropertyType< string > | XmlFilenameProperty |
Property that defines the file path for the configuration file. | |
![]() | |
static PropertyType< string > | ServerNameProperty |
static PropertyType< bool > | ServiceEnabledProperty |
static PropertyType< string > | ServiceIdentifierProperty |
Protected Member Functions | |
KanziConnectDataSource (Domain *domain, string_view name) | |
virtual void | onCreateAdapters () override |
See AbstractConnectDataSource::onCreateAdapters. | |
void | onFileModified (string_view filename) |
Callback for change in configuration file. | |
virtual void | onReleaseAdapters () override |
See AbstractConnectDataSource::onReleaseAdapters. | |
![]() | |
AbstractConnectDataSource (kanzi::Domain *domain, kanzi::string_view name) | |
void | onConnectionStateChanged (Connection::State state) |
Callback for connection state changes. | |
bool | isConnected () const |
Check if this data source is connected to server. | |
Additional Inherited Members | |
![]() | |
typedef vector< ContentAdapterSharedPtr > | AdapterContainer |
![]() | |
DataSource * | m_dataSource |
The instance which owns the data objects managed by content adapters. | |
A class that implements data source that is able to load content from Kanzi Connect server.
The class can be configured with XML file, that describes the data tree and source tables and columns in the database.
See example of data.xml file below.
|
overridevirtual |
|
explicitprotected |
domain | UI domain. |
name | Name of the new data source. |
|
static |
Creates new instance of Kanzi Connect DataSource.
domain | UI domain. |
name | Name of the new data source. |
kanzi::connect::KanziConnectDataSource::KZ_METACLASS_END | ( | ) |
|
overrideprotectedvirtual |
|
protected |
Callback for change in configuration file.
filename | File name of the configuration file. |
|
overrideprotectedvirtual |
See AbstractConnectDataSource::onReleaseAdapters.
Reimplemented from kanzi::connect::AbstractConnectDataSource.
|
static |
Takes data snapshot as XML document.
domain | UI domain where to operate |
uri | the URI for the datasource object to snapshot. E.g. kzb://ivi/Data Sources/ConnectServices |
schema | on return holds the data configuration file |
data | on return holds a snapshot of current data. |
|
static |
|
static |
Property that defines the file path for the configuration file.