OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
|
informational response object More...
#include <BESInfo.h>
Public Member Functions | |
virtual void | add_break (unsigned long num_breaks)=0 |
virtual void | add_data (const string &s) |
add data to this informational object. | |
virtual void | add_data_from_file (const string &key, const string &name) |
add data from a file to the informational object. | |
virtual void | add_exception (BESError &e, const string &admin) |
add exception information to this informational object | |
virtual void | add_space (unsigned long num_spaces)=0 |
virtual void | add_tag (const string &tag_name, const string &tag_data, map< string, string > *attrs=0)=0 |
virtual void | begin_response (const string &response_name, BESDataHandlerInterface &dhi) |
begin the informational response | |
virtual void | begin_tag (const string &tag_name, map< string, string > *attrs=0) |
BESInfo () | |
constructs a BESInfo object | |
BESInfo (const string &buffered_key, ostream *strm, bool strm_owned) | |
constructs a BESInfo object | |
virtual void | dump (ostream &strm) const |
Displays debug information about this object. | |
virtual void | end_response () |
virtual void | end_tag (const string &tag_name) |
virtual bool | is_buffered () |
return whether the information is to be buffered or not. | |
virtual void | print (ostream &strm) |
print the information from this informational object to the specified stream | |
virtual void | transmit (BESTransmitter *transmitter, BESDataHandlerInterface &dhi)=0 |
transmit the informational object | |
virtual | ~BESInfo () |
Protected Attributes | |
bool | _buffered |
string | _response_name |
bool | _response_started |
ostream * | _strm |
bool | _strm_owned |
stack< string > | _tags |
informational response object
This class provides a means to store informational responses, such as help information and version information. The retrieval of this information can be buffered until all information is retrieved, or can be directly output thereby not using memory resources.
Information is added to this response object through the add_data method and then output using the print method. If the information is not buffered then the information is output during the add_data processing, otherwise the print method performs the output.
This class is cannot be directly created but simply provides a base class implementation of BESResponseObject for simple informational responses.
BESInfo::BESInfo | ( | ) |
constructs a BESInfo object
By default, informational responses are buffered, so the output stream is created
Definition at line 53 of file BESInfo.cc.
References _strm, and _strm_owned.
BESInfo::BESInfo | ( | const string & | key, |
ostream * | strm, | ||
bool | strm_owned | ||
) |
constructs a BESInfo object
If the passed key is set to true, True, TRUE, yes, Yes, or YES then the information will be buffered, otherwise it will not be buffered.
If the information is not to be buffered then the output stream is set to standard output.
key | parameter from BES configuration file |
strm | if not buffered then use the passed stream to output information |
strm_owned | if stream was created (not cout or cerr for example) then either take ownership or not |
Definition at line 75 of file BESInfo.cc.
References _buffered, _strm, _strm_owned, BESKeys::get_value(), and TheBESKeys::TheKeys().
|
virtual |
Definition at line 106 of file BESInfo.cc.
References _strm, and _strm_owned.
|
pure virtual |
Implemented in BESVersionInfo, BESXMLInfo, BESDapErrorInfo, BESTextInfo, BESHTMLInfo, and BESSilentInfo.
Referenced by BESVersionInfo::add_break(), BESHelpResponseHandler::execute(), and BESDefinitionStorageList::show_definitions().
|
virtual |
add data to this informational object.
If buffering is not set then the information is output directly to the output stream.
s | information to be added to this informational response object |
Reimplemented in BESVersionInfo, BESXMLInfo, BESDapErrorInfo, BESTextInfo, BESHTMLInfo, and BESSilentInfo.
Definition at line 169 of file BESInfo.cc.
Referenced by BESVersionInfo::add_data(), and add_data_from_file().
|
virtual |
add data from a file to the informational object.
Adds data from a file to the informational object using the file specified by the passed key string. The key is found from the bes configuration file.
If the key does not exist in the initialization file then this information is added to the informational object, no excetion is thrown.
If the file does not exist then this information is added to the informational object, no exception is thrown.
key | Key from the initialization file specifying the file to be |
name | A description of what is the information being loaded |
Reimplemented in BESVersionInfo, BESXMLInfo, BESDapErrorInfo, BESTextInfo, BESHTMLInfo, and BESSilentInfo.
Definition at line 192 of file BESInfo.cc.
References add_data(), BES_INFO_FILE_BUFFER_SIZE, BESKeys::get_value(), and TheBESKeys::TheKeys().
Referenced by BESVersionInfo::add_data_from_file(), BESDapRequestHandler::dap_build_help(), and BESHelpResponseHandler::execute().
|
virtual |
add exception information to this informational object
Exception information is added differently to different informational objects, such as html, xml, plain text. But, using the other methods of this class we can take care of exceptions here.
e | The exception to add to the informational response object |
admin | The contact information for the person responsible for this error |
Reimplemented in BESVersionInfo, BESDapErrorInfo, and BESSilentInfo.
Definition at line 255 of file BESInfo.cc.
References add_tag(), begin_tag(), end_tag(), BESError::get_error_type(), BESError::get_file(), BESError::get_line(), and BESError::get_message().
Referenced by BESVersionInfo::add_exception(), and BESExceptionManager::handle_exception().
|
pure virtual |
Implemented in BESVersionInfo, BESXMLInfo, BESDapErrorInfo, BESTextInfo, BESHTMLInfo, and BESSilentInfo.
Referenced by BESVersionInfo::add_space().
|
pure virtual |
Implemented in BESVersionInfo, BESXMLInfo, BESDapErrorInfo, BESTextInfo, BESHTMLInfo, and BESSilentInfo.
Referenced by add_exception(), BESVersionInfo::add_tag(), BESProcIdResponseHandler::execute(), BESStatusResponseHandler::execute(), BESConfigResponseHandler::execute(), BESContextManager::list_context(), BESCatalogDirectory::show_catalog(), BESContainerStorage::show_container(), BESContainerStorageVolatile::show_containers(), BESDefinitionStorageVolatile::show_definitions(), and BESServiceRegistry::show_services().
|
virtual |
begin the informational response
basic setup of the response from abstract class
response_name | name of the response this information represents |
dhi | information about the request and response |
Reimplemented in BESXMLInfo, BESVersionInfo, BESDapErrorInfo, BESTextInfo, BESHTMLInfo, and BESSilentInfo.
Definition at line 123 of file BESInfo.cc.
References _response_name, and _response_started.
Referenced by BESVersionInfo::begin_response(), BESProcIdResponseHandler::execute(), BESServicesResponseHandler::execute(), BESStatusResponseHandler::execute(), BESShowDefsResponseHandler::execute(), BESConfigResponseHandler::execute(), BESShowContextResponseHandler::execute(), BESHelpResponseHandler::execute(), BESShowContainersResponseHandler::execute(), BESCatalogResponseHandler::execute(), and BESExceptionManager::handle_exception().
|
virtual |
Reimplemented in BESVersionInfo, BESXMLInfo, BESDapErrorInfo, BESTextInfo, BESHTMLInfo, and BESSilentInfo.
Definition at line 142 of file BESInfo.cc.
References _tags.
Referenced by add_exception(), BESVersionInfo::begin_tag(), DapRequestHandler::dap_build_help(), BESDapRequestHandler::dap_build_help(), BESConfigResponseHandler::execute(), BESHelpResponseHandler::execute(), BESCatalogDirectory::show_catalog(), BESCatalogList::show_catalog(), BESContainerStorageList::show_containers(), BESDefinitionStorageVolatile::show_definitions(), BESDefinitionStorageList::show_definitions(), and BESServiceRegistry::show_services().
|
virtual |
Displays debug information about this object.
dumps information about this object
strm | output stream to use to dump the contents of this object |
Displays the pointer value of this instance along with values of data members.
strm | C++ i/o stream to dump the information to |
Implements BESResponseObject.
Reimplemented in BESVersionInfo, BESXMLInfo, BESDapErrorInfo, BESTextInfo, BESHTMLInfo, and BESSilentInfo.
Definition at line 299 of file BESInfo.cc.
References _buffered, _response_name, _response_started, _tags, BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().
Referenced by BESInfoList::dump(), BESVersionInfo::dump(), and BESDataHandlerInterface::dump().
|
virtual |
Reimplemented in BESVersionInfo, BESXMLInfo, and BESHTMLInfo.
Definition at line 131 of file BESInfo.cc.
References _response_started, and _tags.
Referenced by BESVersionInfo::end_response(), BESProcIdResponseHandler::execute(), BESServicesResponseHandler::execute(), BESStatusResponseHandler::execute(), BESShowDefsResponseHandler::execute(), BESConfigResponseHandler::execute(), BESShowContextResponseHandler::execute(), BESShowContainersResponseHandler::execute(), BESHelpResponseHandler::execute(), BESCatalogResponseHandler::execute(), and BESExceptionManager::handle_exception().
|
virtual |
Reimplemented in BESVersionInfo, BESXMLInfo, BESDapErrorInfo, BESTextInfo, BESHTMLInfo, and BESSilentInfo.
Definition at line 149 of file BESInfo.cc.
References _tags.
Referenced by add_exception(), DapRequestHandler::dap_build_help(), BESDapRequestHandler::dap_build_help(), BESVersionInfo::end_tag(), BESConfigResponseHandler::execute(), BESHelpResponseHandler::execute(), BESCatalogDirectory::show_catalog(), BESCatalogList::show_catalog(), BESContainerStorageList::show_containers(), BESDefinitionStorageVolatile::show_definitions(), BESDefinitionStorageList::show_definitions(), and BESServiceRegistry::show_services().
|
inlinevirtual |
return whether the information is to be buffered or not.
Definition at line 123 of file BESInfo.h.
References _buffered.
Referenced by BESBasicHttpTransmitter::send_html(), BESBasicTransmitter::send_html(), BESBasicTransmitter::send_text(), and BESBasicHttpTransmitter::send_text().
|
virtual |
print the information from this informational object to the specified stream
If the information was not buffered then this method does nothing, otherwise the information is output to the specified ostream.
strm | output to this file descriptor if information buffered. |
Reimplemented in BESVersionInfo, BESXMLInfo, BESDapErrorInfo, and BESSilentInfo.
Definition at line 283 of file BESInfo.cc.
References _buffered, and _strm.
Referenced by BESInterface::finish(), BESVersionInfo::print(), BESBasicTransmitter::send_html(), BESBasicTransmitter::send_text(), and BESInterface::transmit_data().
|
pure virtual |
transmit the informational object
The derived informational object knows how it needs to be transmitted. Does it need to be sent as html? As text? As something else?
transmitter | The type of transmitter to use to transmit the info |
dhi | information to help with the transmission |
Implemented in BESVersionInfo, BESXMLInfo, BESDapErrorInfo, BESTextInfo, BESHTMLInfo, and BESSilentInfo.
Referenced by BESProcIdResponseHandler::transmit(), BESServicesResponseHandler::transmit(), BESShowDefsResponseHandler::transmit(), BESStatusResponseHandler::transmit(), BESConfigResponseHandler::transmit(), BESDelContainerResponseHandler::transmit(), BESShowContextResponseHandler::transmit(), BESCatalogResponseHandler::transmit(), BESHelpResponseHandler::transmit(), BESDelContainersResponseHandler::transmit(), BESShowContainersResponseHandler::transmit(), BESDelDefsResponseHandler::transmit(), BESDelDefResponseHandler::transmit(), BESSetContextResponseHandler::transmit(), BESSetContainerResponseHandler::transmit(), BESDefineResponseHandler::transmit(), BESVersionInfo::transmit(), and BESInterface::transmit_data().
|
protected |
Definition at line 73 of file BESInfo.h.
Referenced by BESHTMLInfo::add_data(), BESTextInfo::add_data(), BESInfo(), dump(), is_buffered(), and print().
|
protected |
Definition at line 77 of file BESInfo.h.
Referenced by BESXMLInfo::add_tag(), BESXMLInfo::begin_response(), begin_response(), BESXMLInfo::begin_tag(), dump(), BESXMLInfo::end_response(), and BESXMLInfo::end_tag().
|
protected |
Definition at line 74 of file BESInfo.h.
Referenced by begin_response(), dump(), and end_response().
|
protected |
Definition at line 71 of file BESInfo.h.
Referenced by BESHTMLInfo::add_data(), BESTextInfo::add_data(), BESInfo(), BESXMLInfo::end_tag(), print(), and ~BESInfo().
|
protected |
Definition at line 72 of file BESInfo.h.
Referenced by BESInfo(), and ~BESInfo().
|
protected |
Definition at line 76 of file BESInfo.h.
Referenced by begin_tag(), dump(), end_response(), and end_tag().