Kanzi Connect Server configuration file handling. More...
#include <serverconfig.hpp>
Classes | |
| class | AttributeList |
| List of configuration specific attributes. More... | |
| class | AttributeProviderBase |
| Base class for other domain-classes that provide attributes. More... | |
| class | ConnectionAdapter |
| Connection adapter encapsulation. More... | |
| class | CustomConfiguration |
| Class to contain information about all custom configurations in server config. More... | |
| class | Diagnostics |
| Diagnostics configuration. More... | |
| class | FlowControl |
| Flow control configuration encapsulation. More... | |
| class | HTTPProtocol |
| HTTP Setting encapsulation. More... | |
| class | Identity |
| Server identity related attributes. More... | |
| class | Log |
| Log configuration. More... | |
| class | Persistence |
| Class comment. More... | |
| class | Policy |
| Policy configuration. More... | |
| class | PublishedConfigurations |
| Configurations published through the Configuration service. More... | |
| class | Security |
| Security configuration. More... | |
| class | Service |
| Service configuration. More... | |
Public Types | |
| typedef vector< ConnectionAdapterSharedPtr > | ConnectionAdapterContainer |
| typedef shared_ptr< ConnectionAdapter > | ConnectionAdapterSharedPtr |
| typedef vector< HTTPProtocolSharedPtr > | HTTPProtocolContainer |
| typedef shared_ptr< HTTPProtocol > | HTTPProtocolSharedPtr |
| typedef vector< ServiceSharedPtr > | ServiceContainer |
| typedef shared_ptr< Service > | ServiceSharedPtr |
Public Member Functions | |
| string | buildReferredFileName (const string &filename) |
| Builds a complete filename with path of a referred file. More... | |
| const unordered_map< string, string > & | getCivetOptions () const |
| Retrieves the civet options specified inside the <httpserver> element. More... | |
| ConnectionAdapterSharedPtr | getConnectionAdapter (const string &type) |
| Retrieves a connection adapter based on its type. More... | |
| const ConnectionAdapterContainer & | getConnectionAdapters () const |
| Retrieve list of connection adapters to configure. More... | |
| CustomConfiguration * | getCustomConfiguration (string path) |
| Get the custom configuration specified by path. More... | |
| vector< string > | getDependentServicesRecursive (const string &name) const |
| Retrieve list of services that depend from this service. More... | |
| Diagnostics & | getDiagnostics () |
| Retrieve diagnostics information. More... | |
| FlowControl & | getFlowControl () |
| Retrieve server-wide flow control information for remote service operation. More... | |
| HTTPProtocolSharedPtr | getHTTPProtocol (const string &type) |
| Retrieves a HTTP Protocol object based on requested type. More... | |
| const HTTPProtocolContainer & | getHTTPProtocols () const |
| Retrieve list of HTTP Protocol configurations. More... | |
| Identity & | getIdentity () |
| Retrieve server-wide identity information. More... | |
| Log & | getLog () |
| Retrieve server-wide log information. More... | |
| Persistence & | getPersistence () |
| Retrieve server-wide persistence information. More... | |
| Policy & | getPolicyConfig () |
| Retrieve server-wide policy information. More... | |
| PublishedConfigurations & | getPublishedConfigurations () |
| Retrieve the published configurations information. More... | |
| Security & | getSecurityConfig () |
| Retrieve server-wide security information. More... | |
| ServiceSharedPtr | getService (const string &name) const |
| Retrieve service by name or by library name. More... | |
| ServiceSharedPtr | getServiceByLibraryName (const string &libraryname) const |
| Retrieve service by library name. More... | |
| vector< string > | getServiceDependenciesRecursive (const string &name) const |
| Retrieve service dependencies in recursive manner. More... | |
| const ServiceContainer & | getServices () const |
| Retrieve list of service configurations. More... | |
| const AttributeList & | getServicesAttributes () const |
| Retrieve list of services attributes. More... | |
| bool | isValid () |
| IS configuration read from a valid file. More... | |
| bool | loadFromBuffer (const string &buffer) |
| Loads the structure from provided buffer. More... | |
| bool | loadFromFile (const string &filename) |
| Loads the structure from file provided. More... | |
| bool | loadFromFileset (FileSet &fileset) |
| Loades the structure from passed fileset. More... | |
| string | readReferredFile (const string &filename) |
| Reads a file that is referred from the server configuration file. More... | |
| ServerConfig () | |
| C++ Constructor. More... | |
| ~ServerConfig () | |
| Destructor. More... | |
Protected Member Functions | |
| bool | checkConnectionAdapters () const |
| Checks that provided connectionadapter definitions are valid. More... | |
| bool | checkFilePresent (const string &filename) const |
| checks whether file is available More... | |
| bool | checkFiles () |
| Checks that all attributes whom type is "file" can be read. More... | |
| bool | checkFilesFromAttributeList (AttributeList &attributes, bool &ok) const |
| Goes through the list and checks that all file type attributes are accessible. More... | |
| bool | checkHTTPServer () const |
| Checks that provided httpserver definitions are valid. More... | |
| bool | checkIdentity () const |
| Checks that provided identity definitions are valid. More... | |
| bool | checkPersistence () const |
| Checks that provided persistence definitions are valid. More... | |
| bool | checkServices () const |
| Checks that provided service definitions are valid. More... | |
| void | findDependenciesRecursive (const string &dependency, vector< string > &dependencyChain, bool &recursionDetected) const |
| Determines dependencies in recursive manner. More... | |
| void | getServiceDependenciesRecursive (ServiceSharedPtr service, vector< string > &serviceDependencies) const |
| Resolves recursive dependencies to a specific service. More... | |
| bool | hasService (const string &name) const |
| Checks whether <service> node with provided name exists. More... | |
| bool | loadFromBufferInternal (const string &buffer, bool cleanFileset) |
| Load from buffer internal implementation. More... | |
| void | processAdapters (const tinyxml2::XMLElement *element) |
| Processes <connectionadapters> node. More... | |
| void | processCustomConfiguration (const tinyxml2::XMLElement *element) |
| Process any nodes that are not one of the known hard coded elements. More... | |
| void | processDiagnostics (const tinyxml2::XMLElement *element, Diagnostics &diagnostics) |
| Process <diagnostics> node. More... | |
| void | processDocument (const tinyxml2::XMLElement *element) |
| Processes the XML document. More... | |
| void | processFlowControl (const tinyxml2::XMLElement *element, FlowControl &flowcontrol) |
| Processes <flowcontrol> node. More... | |
| void | processHttpServer (const tinyxml2::XMLElement *element) |
| Process <httpserver> node. More... | |
| void | processIdentity (const tinyxml2::XMLElement *element, Identity &identity) |
| Processes <identity> node. More... | |
| void | processLog (const tinyxml2::XMLElement *element, Log &policy) |
| Processes <log> node. More... | |
| void | processPersistence (const tinyxml2::XMLElement *element, Persistence &persistence) |
| Processes <persistence> node. More... | |
| void | processPolicy (const tinyxml2::XMLElement *element, Policy &policy) |
| Processes <policy> node. More... | |
| void | processPublishedConfigurations (const tinyxml2::XMLElement *element, PublishedConfigurations &publishedConfigurations) |
| Process <published_configurations> node. More... | |
| void | processSecurity (const tinyxml2::XMLElement *element, Security &security) |
| Processes all child elements inside <security> element. More... | |
| void | processSecurityChilds (const tinyxml2::XMLElement *element, Service &security) |
| Processes all <security> child objects from the provided object. More... | |
| void | processServices (const tinyxml2::XMLElement *element) |
| Processes <services> node. More... | |
Static Protected Member Functions | |
| static string | platformSpecificBasePath (AttributeList &attributes) |
| Tries to find a attribute used to specify platform specific base path for security files. More... | |
| static void | processAttributes (const tinyxml2::XMLElement *element, AttributeList &attributes) |
| Processes all <attribute> nodes and fills the attribute list with those. More... | |
Kanzi Connect Server configuration file handling.
| typedef shared_ptr<ConnectionAdapter> kanzi::connect::ServerConfig::ConnectionAdapterSharedPtr |
| typedef shared_ptr<HTTPProtocol> kanzi::connect::ServerConfig::HTTPProtocolSharedPtr |
| typedef vector<ServiceSharedPtr> kanzi::connect::ServerConfig::ServiceContainer |
| typedef shared_ptr<Service> kanzi::connect::ServerConfig::ServiceSharedPtr |
| kanzi::connect::ServerConfig::ServerConfig | ( | ) |
C++ Constructor.
| kanzi::connect::ServerConfig::~ServerConfig | ( | ) |
Destructor.
| string kanzi::connect::ServerConfig::buildReferredFileName | ( | const string & | filename | ) |
Builds a complete filename with path of a referred file.
| filename | as defined on configuration |
|
protected |
Checks that provided connectionadapter definitions are valid.
|
protected |
checks whether file is available
| filename | the file to check |
|
protected |
Checks that all attributes whom type is "file" can be read.
|
protected |
Goes through the list and checks that all file type attributes are accessible.
| attributes | list of attributes to check |
| ok | will be set to false if problems detected. |
|
protected |
Checks that provided httpserver definitions are valid.
|
protected |
Checks that provided identity definitions are valid.
|
protected |
Checks that provided persistence definitions are valid.
|
protected |
Checks that provided service definitions are valid.
|
protected |
Determines dependencies in recursive manner.
| dependency | name of the dependency |
| dependencyChain | list of dependencies discovered so far |
| recursionDetected | will be set to true if depedency recursion is met. |
| const unordered_map<string, string>& kanzi::connect::ServerConfig::getCivetOptions | ( | ) | const |
Retrieves the civet options specified inside the <httpserver> element.
| ConnectionAdapterSharedPtr kanzi::connect::ServerConfig::getConnectionAdapter | ( | const string & | type | ) |
Retrieves a connection adapter based on its type.
| type | type of the connection adapter. E.g. "connect.bearer.tcp", "connect.bearer.ssl" or similar. |
| const ConnectionAdapterContainer& kanzi::connect::ServerConfig::getConnectionAdapters | ( | ) | const |
Retrieve list of connection adapters to configure.
| CustomConfiguration* kanzi::connect::ServerConfig::getCustomConfiguration | ( | string | path | ) |
Get the custom configuration specified by path.
| path | Identifies which configuration to return (hierarchies separated by '.') |
| vector<string> kanzi::connect::ServerConfig::getDependentServicesRecursive | ( | const string & | name | ) | const |
Retrieve list of services that depend from this service.
The returned dependencies are not in any specific order
| name | service to inspect |
| Diagnostics& kanzi::connect::ServerConfig::getDiagnostics | ( | ) |
Retrieve diagnostics information.
| FlowControl& kanzi::connect::ServerConfig::getFlowControl | ( | ) |
Retrieve server-wide flow control information for remote service operation.
| HTTPProtocolSharedPtr kanzi::connect::ServerConfig::getHTTPProtocol | ( | const string & | type | ) |
Retrieves a HTTP Protocol object based on requested type.
| type | of the protocol to retrieve. E.g. "http", "https" |
| const HTTPProtocolContainer& kanzi::connect::ServerConfig::getHTTPProtocols | ( | ) | const |
Retrieve list of HTTP Protocol configurations.
| Identity& kanzi::connect::ServerConfig::getIdentity | ( | ) |
Retrieve server-wide identity information.
| Log& kanzi::connect::ServerConfig::getLog | ( | ) |
Retrieve server-wide log information.
| Persistence& kanzi::connect::ServerConfig::getPersistence | ( | ) |
Retrieve server-wide persistence information.
| Policy& kanzi::connect::ServerConfig::getPolicyConfig | ( | ) |
Retrieve server-wide policy information.
| PublishedConfigurations& kanzi::connect::ServerConfig::getPublishedConfigurations | ( | ) |
Retrieve the published configurations information.
| Security& kanzi::connect::ServerConfig::getSecurityConfig | ( | ) |
Retrieve server-wide security information.
| ServiceSharedPtr kanzi::connect::ServerConfig::getService | ( | const string & | name | ) | const |
Retrieve service by name or by library name.
| name | the name for the service |
| ServiceSharedPtr kanzi::connect::ServerConfig::getServiceByLibraryName | ( | const string & | libraryname | ) | const |
Retrieve service by library name.
| libraryname | name of the library that identifies the service. Shall there be multiple service instances made from one library this returns the first. |
| vector<string> kanzi::connect::ServerConfig::getServiceDependenciesRecursive | ( | const string & | name | ) | const |
Retrieve service dependencies in recursive manner.
The returned dependencies are not in any specific order.
| name | the name of the service whom dependencies are to be retrieved |
|
protected |
Resolves recursive dependencies to a specific service.
| service | the service whom dependencies are to determined. |
| serviceDepdencies | list of collected dependencies. |
| const ServiceContainer& kanzi::connect::ServerConfig::getServices | ( | ) | const |
Retrieve list of service configurations.
| const AttributeList& kanzi::connect::ServerConfig::getServicesAttributes | ( | ) | const |
Retrieve list of services attributes.
|
protected |
Checks whether <service> node with provided name exists.
| name | the name to check |
| bool kanzi::connect::ServerConfig::isValid | ( | ) |
IS configuration read from a valid file.
| bool kanzi::connect::ServerConfig::loadFromBuffer | ( | const string & | buffer | ) |
Loads the structure from provided buffer.
| buffer | xml buffer |
|
protected |
Load from buffer internal implementation.
| buffer | buffer that contains the configuration |
| cleanFileset | if defined, then resets the member variable holding fileset |
| bool kanzi::connect::ServerConfig::loadFromFile | ( | const string & | filename | ) |
Loads the structure from file provided.
| filename | full path to file to load |
| bool kanzi::connect::ServerConfig::loadFromFileset | ( | FileSet & | fileset | ) |
Loades the structure from passed fileset.
| fileset | fileset containing the configuration information |
|
staticprotected |
Tries to find a attribute used to specify platform specific base path for security files.
Attribute is named "basepath-linux", "basepath-win32", "basepath-qnx", "basepath-android" or "basepath-default" for generic base path.
| attributes | list of attributes to search from. |
|
protected |
Processes <connectionadapters> node.
| element | the <connectionadapters> node |
|
staticprotected |
Processes all <attribute> nodes and fills the attribute list with those.
| element | parent whom <attribute> childs are to be found. |
| attributes | list to fill with attribute information. |
|
protected |
Process any nodes that are not one of the known hard coded elements.
| element | The element to process |
|
protected |
Process <diagnostics> node.
| element | the <diagnostics> element |
| diagnostics | the diagnostics object |
|
protected |
Processes the XML document.
| element | the root element of the document. |
|
protected |
Processes <flowcontrol> node.
| element | the <flowcontrol> element |
| flowcontrol | the FlowControl object |
|
protected |
Process <httpserver> node.
| element | the <httpserver> node. |
|
protected |
Processes <identity> node.
| element | the <identity> element |
| identity | the identity object |
|
protected |
Processes <log> node.
| element | the <log> element |
| policy | the policy object |
|
protected |
Processes <persistence> node.
| element | the <persistence> element |
| persistence | the persistence object |
|
protected |
Processes <policy> node.
| element | the <policy> element |
| policy | the policy object |
|
protected |
Process <published_configurations> node.
| element | the <published_configurations> element |
| publishedConfigurations | the PublishedConfigurations object |
|
protected |
Processes all child elements inside <security> element.
| element | pointer to <security> element |
| security | object to be filled with security attributes. |
|
protected |
Processes all <security> child objects from the provided object.
| element | the parent element below which the <security> objects are searched. |
| security | security object to be filled with security information found. |
|
protected |
Processes <services> node.
| element | the <services> node |
| string kanzi::connect::ServerConfig::readReferredFile | ( | const string & | filename | ) |
Reads a file that is referred from the server configuration file.
This method will adjust the path to be relative to the server configuration files location.
| filename | the filename to be read. |