OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
|
The service registry allows modules to register services with the BES that they provide. More...
#include <BESServiceRegistry.h>
Public Member Functions | |
virtual void | add_format (const string &service, const string &cmd, const string &format) |
add a format response to a command of a service More... | |
virtual void | add_service (const string &name) |
Add a service to the BES. More... | |
virtual void | add_to_service (const string &service, const string &cmd, const string &cmd_descript, const string &format) |
This function allows callers to add to a service that already exists. More... | |
virtual bool | does_handle_service (const string &handler, const string &service) |
Asks if the specified handler can handle the specified service. More... | |
virtual void | dump (ostream &strm) const |
dumps information about this object More... | |
virtual void | handles_service (const string &handler, const string &service) |
The specified handler can handle the specified service. More... | |
virtual void | remove_service (const string &name) |
remove a service from the BES More... | |
virtual bool | service_available (const string &name, const string &cmd="", const string &format="") |
Determines if a service and, optionally, a command and a return format, is available. More... | |
virtual void | services_handled (const string &handler, list< string > &services) |
returns the list of servies provided by the handler in question More... | |
virtual void | show_services (BESInfo &info) |
fills in the response object for the <showService /> request More... | |
virtual | ~BESServiceRegistry (void) |
Static Public Member Functions | |
static BESServiceRegistry * | TheRegistry () |
Protected Member Functions | |
BESServiceRegistry (void) | |
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 60 of file BESServiceRegistry.h.
|
protected |
Definition at line 39 of file BESServiceRegistry.cc.
Referenced by TheRegistry().
|
virtual |
Definition at line 43 of file BESServiceRegistry.cc.
|
virtual |
add a format response to a command of a service
service | name of the service to add the format to |
cmd | the command in the service to add the format to |
format | the format to add |
BESInternalError | if the service or command do not exist or if the format has already been registered. |
Definition at line 124 of file BESServiceRegistry.cc.
|
virtual |
Add a service to the BES.
name | name of the service to be added |
BESInternalError | if the service already exists |
Definition at line 53 of file BESServiceRegistry.cc.
Referenced by BESDapModule::initialize().
|
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.
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 |
BESInternalError | if the service does not exist or the command is already reigstered with the service |
Definition at line 84 of file BESServiceRegistry.cc.
Referenced by BESDapService::add_to_dap_service(), and BESDapModule::initialize().
|
virtual |
Asks if the specified handler can handle the specified service.
Does the specified handler provide the specified service.
handler | name of the handler to check |
service | name of the service the handler might handle |
Definition at line 303 of file BESServiceRegistry.cc.
|
virtual |
dumps information about this object
Displays the pointer value of this instance along with information about the service registry
strm | C++ i/o stream to dump the information to |
Implements BESObj.
Definition at line 391 of file BESServiceRegistry.cc.
References BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().
|
virtual |
The specified handler can handle the specified service.
This function lets the BES know that the specifie dhandler can handle the services provided by service. For example, the netcdf_handler registeres that it can handle the dap services, meaning that it can fill in the DAP responses.
handler | name of the data handler being registered |
service | name of the service the handler now provides |
BESInternalError | if the service does not exist |
Definition at line 265 of file BESServiceRegistry.cc.
Referenced by BESDapService::handle_dap_service().
|
virtual |
remove a service from the BES
This function removes the specified service from the BES, meaning that the service is no longer provided by the BES. It also removes the service from any handlers that registered to handle the service
service | name of the service to remove |
Definition at line 176 of file BESServiceRegistry.cc.
Referenced by BESDapModule::terminate().
|
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.
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 |
Definition at line 216 of file BESServiceRegistry.cc.
|
virtual |
returns the list of servies provided by the handler in question
If the handler is not found, then the services list will be empty
handler | name of the handler to inquire about |
services | out parameter that will hold the services provided by the handler |
Definition at line 328 of file BESServiceRegistry.cc.
Referenced by DapRequestHandler::dap_build_help(), BESContainerStorageVolatile::isData(), BESContainerStorageCatalog::isData(), and BESContainerStorageFile::isData().
|
virtual |
fills in the response object for the <showService /> request
This function is called to fill in the response object for the <showServices /> request. It adds each of the services and the commands provided by that service.
info | The BES informational object that will hold the response |
Definition at line 352 of file BESServiceRegistry.cc.
References BESInfo::add_tag(), BESInfo::begin_tag(), and BESInfo::end_tag().
Referenced by BESServicesResponseHandler::execute().
|
static |
Definition at line 454 of file BESServiceRegistry.cc.
References BESServiceRegistry().
Referenced by BESDapService::add_to_dap_service(), DapRequestHandler::dap_build_help(), BESServicesResponseHandler::execute(), BESDapService::handle_dap_service(), BESDapModule::initialize(), BESContainerStorageVolatile::isData(), BESContainerStorageCatalog::isData(), BESContainerStorageFile::isData(), and BESDapModule::terminate().