ConfigurationAdmin¶
-
class
cppmicroservices::service::cm::
ConfigurationAdmin
¶ - #include <cppmicroservices/cm/ConfigurationAdmin.hpp>
The ConfigurationAdmin interface is the means by which applications and services can interract with the Configuration objects at runtime.
It can be used to create or obtain Configuration objects, which can in turn be queried for their properties or be used to update the properties of a given service or service factory.
Public Functions
-
virtual
~ConfigurationAdmin
()¶
-
virtual std::shared_ptr<Configuration>
GetConfiguration
(std::string const &pid) = 0¶ Get an existing or new Configuration object.
If the Configuration object for this PID does not exist, create a new Configuration object for that PID with empty properties.
- Return
- the Configuration object for this PID
- Parameters
pid
: The PID to get the Configuration for
-
virtual std::shared_ptr<Configuration>
CreateFactoryConfiguration
(std::string const &factoryPid) = 0¶ Create a new Configuration object for a ManagedServiceFactory.
The factoryPid is the PID of the ManagedServiceFactory (which must be different from the PIDs of any services it manages) and the instanceName will be a randomly-generated, unique name. The Configuration object’s properties are empty. The returned Configuration will have a PID of the form $factoryPid~$instanceName.
- Return
- a new Configuration object for this Factory PID with a randomly-generated unique name
- Parameters
factoryPid
: The Factory PID to create a new Configuration for
-
virtual std::shared_ptr<Configuration>
GetFactoryConfiguration
(std::string const &factoryPid, std::string const &instanceName) = 0¶ Get an existing or new Configuration object for a ManagedServiceFactory.
The factoryPid is the PID of the ManagedServiceFactory (which must be different from the PIDs of any services it manages) and the instanceName is the unique name of one of those managed services. If the Configuration object for this combination of factoryPid and instanceName does not exist, create a new Configuration object for that combination, where properties are empty. The returned Configuration will have a PID of the form $factoryPid~$instanceName.
- Return
- the Configuration object for this combination of Factory PID and instance name
- Parameters
factoryPid
: The Factory PID to use to get an existing Configuration or create a new Configuration forinstanceName
: The unique name of an instance of a serivce managed by the ManagedServiceFactory
-
virtual std::vector<std::shared_ptr<Configuration>>
ListConfigurations
(std::string const &filter = {}) = 0¶ Used to list all of the available configurations.
An LDAP filter expression can be used to filter based on any property of the configuration, including service.pid and service.factoryPid
- Return
- a vector of Configurations matching the filter.
- Parameters
filter
: An optional filter expression to limit the Configurations which are returned, or empty for all.
-
virtual