OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
W10nJsonTransmitter Class Reference

BESTransmitter class named "json" that transmits an OPeNDAP data object as a JSON file. More...

#include <W10nJsonTransmitter.h>

Inheritance diagram for W10nJsonTransmitter:
Inheritance graph
Collaboration diagram for W10nJsonTransmitter:
Collaboration graph

Public Member Functions

virtual bool add_method (string method_name, p_transmitter trans_method)
 
virtual void dump (ostream &strm) const
 dumps information about this object More...
 
virtual p_transmitter find_method (string method_name)
 
virtual bool remove_method (string method_name)
 
virtual void send_html (BESInfo &info, BESDataHandlerInterface &dhi)
 
virtual void send_response (const string &method, BESResponseObject *obj, BESDataHandlerInterface &dhi)
 
virtual void send_text (BESInfo &info, BESDataHandlerInterface &dhi)
 
 W10nJsonTransmitter ()
 Construct the W10nJsonTransmitter. More...
 
virtual ~W10nJsonTransmitter ()
 

Static Public Member Functions

static void send_data (BESResponseObject *obj, BESDataHandlerInterface &dhi)
 The static method registered to transmit OPeNDAP data objects as a JSON file. More...
 
static void send_metadata (BESResponseObject *obj, BESDataHandlerInterface &dhi)
 The static method registered to transmit OPeNDAP data objects as a JSON file. More...
 

Detailed Description

BESTransmitter class named "json" that transmits an OPeNDAP data object as a JSON file.

The FoW10JsonTransmitter transforms an OPeNDAP DataDDS object into a JSON file and streams the new (temporary) JSON file back to the client.

See also
BESBasicTransmitter

Definition at line 52 of file W10nJsonTransmitter.h.

Constructor & Destructor Documentation

W10nJsonTransmitter::W10nJsonTransmitter ( )

Construct the W10nJsonTransmitter.

The transmitter is created to add the ability to return OPeNDAP data objects (DataDDS) as abstract object representation JSON documents.

The OPeNDAP data object is written to a JSON file locally in a temporary directory specified by the BES configuration parameter FoJson.Tempdir. If this variable is not found or is not set then it defaults to the macro definition FO_JSON_TEMP_DIR.

Definition at line 84 of file W10nJsonTransmitter.cc.

References BESTransmitter::add_method(), DATA_SERVICE, DDX_SERVICE, BESKeys::get_value(), send_data(), send_metadata(), TheBESKeys::TheKeys(), and W10N_JSON_TEMP_DIR.

Here is the call graph for this function:

virtual W10nJsonTransmitter::~W10nJsonTransmitter ( )
inlinevirtual

Definition at line 63 of file W10nJsonTransmitter.h.

Member Function Documentation

void BESBasicTransmitter::dump ( ostream &  strm) const
virtualinherited

dumps information about this object

Displays the pointer value of this instance

Parameters
strmC++ i/o stream to dump the information to

Reimplemented from BESTransmitter.

Reimplemented in BESBasicHttpTransmitter.

Definition at line 72 of file BESBasicTransmitter.cc.

References BESTransmitter::dump(), BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().

Referenced by BESBasicHttpTransmitter::dump().

Here is the call graph for this function:

p_transmitter BESTransmitter::find_method ( string  method_name)
virtualinherited

Definition at line 58 of file BESTransmitter.cc.

Referenced by BESTransmitter::send_response().

bool BESTransmitter::remove_method ( string  method_name)
virtualinherited
void W10nJsonTransmitter::send_data ( BESResponseObject obj,
BESDataHandlerInterface dhi 
)
static

The static method registered to transmit OPeNDAP data objects as a JSON file.

This function takes the OPeNDAP DataDDS object, reads in the data (can be used with any data handler), transforms the data into a JSON file, and streams back that JSON file back to the requester using the stream specified in the BESDataHandlerInterface.

Parameters
objThe BESResponseObject containing the OPeNDAP DataDDS object
dhiBESDataHandlerInterface containing information about the request and response
Exceptions
BESInternalErrorif the response is not an OPeNDAP DataDDS or if there are any problems reading the data, writing to a JSON file, or streaming the JSON file

Definition at line 179 of file W10nJsonTransmitter.cc.

References BESDEBUG, w10n::checkConstrainedDDSForW10nDataCompatibility(), BESDataHandlerInterface::data, BESDataDDSResponse::get_ce(), BESDataDDSResponse::get_dds(), BESError::get_message(), BESDataHandlerInterface::get_output_stream(), POST_CONSTRAINT, BESDataDDSResponse::set_dds(), and W10N_DEBUG_KEY.

Referenced by W10nJsonTransmitter().

Here is the call graph for this function:

void BESBasicTransmitter::send_html ( BESInfo info,
BESDataHandlerInterface dhi 
)
virtualinherited
void W10nJsonTransmitter::send_metadata ( BESResponseObject obj,
BESDataHandlerInterface dhi 
)
static

The static method registered to transmit OPeNDAP data objects as a JSON file.

This function takes the OPeNDAP DataDDS object, reads in the data (can be used with any data handler), transforms the data into a JSON file, and streams back that JSON file back to the requester using the stream specified in the BESDataHandlerInterface.

Parameters
objThe BESResponseObject containing the OPeNDAP DataDDS object
dhiBESDataHandlerInterface containing information about the request and response
Exceptions
BESInternalErrorif the response is not an OPeNDAP DataDDS or if there are any problems reading the data, writing to a JSON file, or streaming the JSON file

Definition at line 309 of file W10nJsonTransmitter.cc.

References BESDEBUG, BESDataHandlerInterface::data, BESDDSResponse::get_ce(), BESDDSResponse::get_dds(), BESDataHandlerInterface::get_output_stream(), POST_CONSTRAINT, and W10N_DEBUG_KEY.

Referenced by W10nJsonTransmitter().

Here is the call graph for this function:

void BESBasicTransmitter::send_text ( BESInfo info,
BESDataHandlerInterface dhi 
)
virtualinherited

The documentation for this class was generated from the following files: