bes
Updated for version 3.20.6
|
33 #include "BESCatalogResponseHandler.h"
34 #include "BESInfoList.h"
36 #include "BESRequestHandlerList.h"
37 #include "BESRequestHandler.h"
39 #include "BESDataNames.h"
40 #include "BESCatalogList.h"
41 #include "BESCatalog.h"
42 #include "BESCatalogEntry.h"
43 #include "BESCatalogUtils.h"
44 #include "BESSyntaxUserError.h"
45 #include "BESNotFoundError.h"
47 #include "BESStopWatch.h"
53 BESCatalogResponseHandler::BESCatalogResponseHandler(
const string &name) :
58 BESCatalogResponseHandler::~BESCatalogResponseHandler()
74 if (BESISDEBUG(TIMING_LOG)) sw.
start(
"BESCatalogResponseHandler::execute", dhi.
data[REQUEST_ID]);
76 BESInfo *info = BESInfoList::TheList()->build_info();
77 d_response_object = info;
80 string container = dhi.
data[CONTAINER];
81 string::size_type notslash = container.find_first_not_of(
"/", 0);
82 if (notslash != string::npos) {
83 container = container.substr(notslash);
85 if (container.empty()) container =
"/";
88 string catalog = dhi.
data[CATALOG];
98 string err = (string)
"Not able to find the catalog '" + catalog +
"'";
108 string err = (string)
"Failed to find node " + container;
115 dhi.action_name = CATALOG_RESPONSE_STR;
118 BESCatalogUtils::display_entry(entry, info);
120 BESCatalogEntry::catalog_citer ei = entry->get_beginning_entry();
121 BESCatalogEntry::catalog_citer ee = entry->get_ending_entry();
122 for (; ei != ee; ei++) {
123 BESCatalogUtils::display_entry((*ei).second, info);
124 info->end_tag(
"dataset");
127 info->end_tag(
"dataset");
130 info->end_response();
148 if (d_response_object) {
163 strm << BESIndent::LMarg <<
"BESCatalogResponseHandler::dump - (" << (
void *)
this <<
")" << endl;
166 BESIndent::UnIndent();
170 BESCatalogResponseHandler::CatalogResponseBuilder(
const string &name)
virtual bool start(std::string name)
virtual void execute(BESDataHandlerInterface &dhi)
Execute the showCatalog command.
virtual BESCatalogEntry * show_catalog(const std::string &container, BESCatalogEntry *entry)=0
error thrown if the resource requested cannot be found
virtual void dump(std::ostream &strm) const
dumps information about this object
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)=0
transmit the informational object
informational response object
virtual std::string get_catalog_name() const
Get the name for this catalog.
virtual BESCatalog * default_catalog() const
The the default catalog.
response handler that returns nodes or leaves within the catalog either at the root or at a specified...
static BESCatalogList * TheCatalogList()
Get the singleton BESCatalogList instance.
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
transmit the response object built by the execute command using the specified transmitter object
std::map< std::string, std::string > data
the map of string data that will be required for the current request.
exception thrown if internal error encountered
handler object that knows how to create a specific response object
virtual void dump(std::ostream &strm) const
dumps information about this object
Catalogs provide a hierarchical organization for data.
virtual void begin_response(const std::string &response_name, BESDataHandlerInterface &dhi)
begin the informational response
Structure storing information used by the BES to handle the request.