#include <PlatformService.hpp>
Inherits pion::platform::PlatformPlugin, and pion::net::WebService.
Inherited by pion::plugins::ConfigService, pion::plugins::FeedService, pion::plugins::MonitorService, pion::plugins::QueryService, and pion::plugins::XMLLogService.
Definition at line 45 of file PlatformService.hpp.
Public Member Functions | |
| PlatformService (const std::string &logger) | |
| constructs a new PlatformService object | |
| virtual | ~PlatformService () |
| virtual destructor: this class is meant to be extended | |
| virtual void | operator() (pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn)=0 |
| virtual void | setConfig (const pion::platform::Vocabulary &v, const xmlNodePtr config_ptr) |
| virtual void | setPlatformConfig (PlatformConfig &platform_cfg) |
| void | setServerId (const std::string &server_id) |
| std::string | getServerId (void) |
| virtual void | updateCodecs (PlatformConfig &platform_cfg) |
| virtual void | updateDatabases (PlatformConfig &platform_cfg) |
| virtual void | updateReactors (PlatformConfig &platform_cfg) |
| virtual bool | accessAllowed (xmlNodePtr permission_config_ptr, const std::string &id) const |
| virtual std::string | getPermissionType (void) const |
| returns the type attribute used for an XML Permission node pertaining to the type of Service being managed | |
Protected Types | |
| typedef std::vector< std::string > | PathBranches |
| data type for a collection of resource path branches | |
Protected Member Functions | |
| void | splitPathBranches (PathBranches &branches, const std::string &resource) |
| const PlatformConfig & | getConfig (void) const |
| returns a const reference to the Platform configuration manager | |
| PlatformConfig & | getConfig (void) |
| returns a reference to the Platform configuration manager | |
| virtual void | handleBadRequest (pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn, const std::string &error_msg) |
| virtual void | handleForbiddenRequest (pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn, const std::string &error_msg) |
| virtual void | handleNotFoundRequest (pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) |
| virtual void | handleMethodNotAllowed (pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn, const std::string &allowed_methods) |
Protected Attributes | |
| PionLogger | m_logger |
| primary logging interface used by a concrete instantiation of this class | |
Classes | |
| class | EmptyServiceResourceException |
| exception thrown if the config file contains a Server with an empty or missing HTTP resource More... | |
| class | MissingConfigException |
| exception thrown if the Platform configuration is missing More... | |
| class | ServerIdOfServiceUnspecifiedException |
| exception thrown if the config file contains a Service without a Server identifier specified More... | |
| virtual bool pion::server::PlatformService::accessAllowed | ( | xmlNodePtr | permission_config_ptr, | |
| const std::string & | id | |||
| ) | const [inline, virtual] |
determines whether a User has permission to use a PlatformService
| permission_config_ptr | the Permission node of the appropriate type from the User's configuration | |
| id | unique identifier specifying a subset of the PlatformService; can be empty |
Definition at line 140 of file PlatformService.hpp.
Referenced by pion::server::UserManager::accessAllowed().
| virtual void pion::server::PlatformService::operator() | ( | pion::net::HTTPRequestPtr & | request, | |
| pion::net::TCPConnectionPtr & | tcp_conn | |||
| ) | [pure virtual] |
attempts to handle a new HTTP request
| request | the new HTTP request to handle | |
| tcp_conn | the TCP connection that has the new request |
Implements pion::net::WebService.
Implemented in pion::plugins::ConfigService, pion::plugins::FeedService, pion::plugins::MonitorService, pion::plugins::QueryService, and pion::plugins::XMLLogService.
| void pion::server::PlatformService::setConfig | ( | const pion::platform::Vocabulary & | v, | |
| const xmlNodePtr | config_ptr | |||
| ) | [virtual] |
sets configuration parameters for this plug-in
| platform_cfg | reference to the platform configuration manager | |
| config_ptr | pointer to a list of XML nodes containing plug-in configuration parameters |
Reimplemented from pion::platform::PlatformPlugin.
Reimplemented in pion::plugins::ConfigService.
Definition at line 38 of file PlatformService.cpp.
References pion::platform::PlatformPlugin::getId(), and pion::net::WebService::setResource().
Referenced by pion::server::ServiceManager::addPluginNoLock(), and pion::plugins::ConfigService::setConfig().
| void pion::server::PlatformService::splitPathBranches | ( | PathBranches & | branches, | |
| const std::string & | resource | |||
| ) | [protected] |
splits path branches out of an HTTP request resource
| branches | a collection of path branches extracted | |
| resource | the HTTP request resource to extra path branches from |
Definition at line 60 of file PlatformService.cpp.
References pion::net::WebService::getRelativeResource().
Referenced by pion::plugins::QueryService::operator()(), pion::plugins::MonitorService::operator()(), pion::plugins::FeedService::operator()(), and pion::plugins::ConfigService::operator()().
| virtual void pion::server::PlatformService::updateCodecs | ( | PlatformConfig & | platform_cfg | ) | [inline, virtual] |
this updates the Codecs that are used by this service; it should be called whenever any Codec's configuration is updated
| platform_cfg | reference to the platform configuration manager |
Definition at line 114 of file PlatformService.hpp.
Referenced by pion::server::ServiceManager::updateCodecs().
| virtual void pion::server::PlatformService::updateDatabases | ( | PlatformConfig & | platform_cfg | ) | [inline, virtual] |
this updates the Databases that are used by this service; it should be called whenever any Database's configuration is updated
| platform_cfg | reference to the platform configuration manager |
Definition at line 122 of file PlatformService.hpp.
Referenced by pion::server::ServiceManager::updateDatabases().
| virtual void pion::server::PlatformService::updateReactors | ( | PlatformConfig & | platform_cfg | ) | [inline, virtual] |
this updates the Databases that are used by this service; it should be called whenever any Database's configuration is updated
| platform_cfg | reference to the platform configuration manager |
Definition at line 130 of file PlatformService.hpp.
Referenced by pion::server::ServiceManager::updateReactors().
1.4.7