bes  Updated for version 3.17.4
BESSetContainerResponseHandler Class Reference

response handler that creates a container given the symbolic name, real name, and data type. More...

#include <BESSetContainerResponseHandler.h>

Inheritance diagram for BESSetContainerResponseHandler:
Inheritance graph

Public Member Functions

 BESSetContainerResponseHandler (const string &name)
 
virtual void dump (ostream &strm) const
 dumps information about this object More...
 
virtual void execute (BESDataHandlerInterface &dhi)
 executes the command to create a new container or replaces an already existing container based on the provided symbolic name. More...
 
virtual string get_name () const
 return the name of this response object More...
 
virtual BESResponseObjectget_response_object ()
 return the current response object More...
 
virtual BESResponseObjectset_response_object (BESResponseObject *o)
 replaces the current response object with the specified one, returning the current response object More...
 
virtual void transmit (BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
 transmit the response object built by the execute command using the specified transmitter object More...
 

Static Public Member Functions

static BESResponseHandlerSetContainerResponseBuilder (const string &name)
 

Protected Attributes

BESResponseObject_response
 
string _response_name
 

Detailed Description

This request handler creates a new container, or replaces an already existing container in the specified container storage given the symbolic name, real name (in most cases a file name), and the type of data represented by the real name (e.g. netcdf, cedar, cdf, hdf, etc...) The request has the syntax:

set container in <store_name> values <sym_name>,<real_name>,<data_type>;

It returns whether the container was created or replaces successfully in an informational response object and transmits that response object.

See also
BESResponseObject
BESContainer
BESTransmitter

Definition at line 56 of file BESSetContainerResponseHandler.h.

Member Function Documentation

◆ dump()

void BESSetContainerResponseHandler::dump ( ostream &  strm) const
virtual

Displays the pointer value of this instance

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

Reimplemented from BESResponseHandler.

Definition at line 146 of file BESSetContainerResponseHandler.cc.

References BESResponseHandler::dump().

◆ execute()

void BESSetContainerResponseHandler::execute ( BESDataHandlerInterface dhi)
virtual

The symbolic name is first looked up in the specified container storage object, volatile if no container storage name is specified. If the symbolic name already exists (the container already exists) then the already existing container is removed and the new one added using the given real name (usually a file name) and the type of data represented by this container (e.g. cedar, cdf, netcdf, hdf, etc...)

An informational response object BESInfo is created to hold whether or not the container was successfully added/replaced. Possible responses are:

Successfully added container "&lt;sym_name&gt;" in container storage "&lt;store_name&gt;"

Successfully replaced container "&lt;sym_name&gt;" in container storage "&lt;store_name&gt;"

Unable to add container "&lt;sym_name&gt;" to container storage "&lt;store_name&gt;"

Unable to add container "&lt;sym_name&gt;" to container storage "&lt;store_name&gt;"

Container storage "&lt;store_name&gt;" does not exist

Parameters
dhistructure that holds request and response information
Exceptions
BESSyntaxUserErrorif the specified store name does not exist
See also
BESDataHandlerInterface
BESInfo
BESContainerStorageList
BESContainerStorage
BESContainer

Implements BESResponseHandler.

Definition at line 85 of file BESSetContainerResponseHandler.cc.

References BESContainerStorage::add_container(), BESDataHandlerInterface::data, BESContainerStorage::del_container(), and BESContainerStorageList::find_persistence().

◆ get_name()

virtual string BESResponseHandler::get_name ( ) const
inlinevirtualinherited

This name is used to determine which response handler can handle a requested response, such as das, dds, ddx, tab, info, version, help, etc...

Returns
response name

Definition at line 156 of file BESResponseHandler.h.

References BESResponseHandler::dump().

◆ get_response_object()

BESResponseObject * BESResponseHandler::get_response_object ( )
virtualinherited

Returns the current response object, null if one has not yet been created. The response handler maintains ownership of the response object.

Returns
current response object
See also
BESResponseObject

Definition at line 53 of file BESResponseHandler.cc.

◆ set_response_object()

BESResponseObject * BESResponseHandler::set_response_object ( BESResponseObject o)
virtualinherited

This method is used to replace the response object with a new one, for example if during aggregation a new response object is built from the current response object.

The caller of set_response_object now owns the returned response object. The new response object is now owned by the response object.

Parameters
onew response object used to replace the current one
Returns
the response object being replaced
See also
BESResponseObject

Definition at line 59 of file BESResponseHandler.cc.

◆ transmit()

void BESSetContainerResponseHandler::transmit ( BESTransmitter transmitter,
BESDataHandlerInterface dhi 
)
virtual

If a response object was built then transmit it as text using the specified transmitter object.

Parameters
transmitterobject that knows how to transmit specific basic types
dhistructure that holds the request and response information
See also
BESInfo
BESTransmitter
BESDataHandlerInterface

Implements BESResponseHandler.

Definition at line 130 of file BESSetContainerResponseHandler.cc.

References BESInfo::transmit().


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