The service registry allows modules to register services with the BES that they provide.
More...
|
virtual void | add_format (const std::string &service, const std::string &cmd, const std::string &format) |
| add a format response to a command of a service
|
|
virtual void | add_service (const std::string &name) |
| Add a service to the BES.
|
|
virtual void | add_to_service (const std::string &service, const std::string &cmd, const std::string &cmd_descript, const std::string &format) |
| This function allows callers to add to a service that already exists.
|
|
virtual bool | does_handle_service (const std::string &handler, const std::string &service) |
| Asks if the specified handler can handle the specified service.
|
|
virtual void | dump (std::ostream &strm) const |
| dumps information about this object
|
|
virtual void | handles_service (const std::string &handler, const std::string &service) |
| The specified handler can handle the specified service.
|
|
virtual void | remove_service (const std::string &name) |
| remove a service from the BES
|
|
virtual bool | service_available (const std::string &name, const std::string &cmd="", const std::string &format="") |
| Determines if a service and, optionally, a command and a return format, is available.
|
|
virtual void | services_handled (const std::string &handler, std::list< std::string > &services) |
| returns the list of servies provided by the handler in question
|
|
virtual void | show_services (BESInfo &info) |
| fills in the response object for the <showService /> request
|
|
The service registry allows modules to register services with the BES that they provide.
For example, the dap service provides the das, dds, ddx, and dods commands as part of its service. Data handlers, such as that provided in the nc_module for netcdf data, can register that it can provide the dap services by calling the handle_services call.
Also provided by this class is the response body for the <showServices >/ command, returning the list of services, the commands provided by that services, and the description of those commands
Definition at line 57 of file BESServiceRegistry.h.
void BESServiceRegistry::add_to_service |
( |
const std::string & | service, |
|
|
const std::string & | cmd, |
|
|
const std::string & | cmd_descript, |
|
|
const std::string & | format ) |
|
virtual |
This function allows callers to add to a service that already exists.
For example, the dap-server modules add to the dap service the three commands ascii, html_form, and info_page. These three responses use the three basic commands of the dap service, das, dds, and datadds.
- Parameters
-
service | name of the service to add the commands to |
cmd | the command being added to the service |
cmd_descript | the description of the command being added to the service |
format | the format of the command being added to the service |
- Exceptions
-
BESInternalError | if the service does not exist or the command is already reigstered with the service |
Definition at line 91 of file BESServiceRegistry.cc.
bool BESServiceRegistry::service_available |
( |
const std::string & | name, |
|
|
const std::string & | cmd = "", |
|
|
const std::string & | format = "" ) |
|
virtual |
Determines if a service and, optionally, a command and a return format, is available.
Given a service name and possibly a command name and return format, determine if that service is available and, if not empty, if the service provides the specified command.
- Parameters
-
service | the name of the service in question |
cmd | the service command in question, defaults to empty string |
format | the service return format in question, defaults to empty string |
- Returns
- true if the service is available and, if provided, the command is provided by the service and, if format is provided, the return format of the service and command
Definition at line 229 of file BESServiceRegistry.cc.