OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
BESXDResponseHandler.cc
Go to the documentation of this file.
1 // BESXDResponseHandler.cc
2 
3 // This file is part of bes, A C++ back-end server implementation framework
4 // for the OPeNDAP Data Access Protocol.
5 
6 // Copyright (c) 2004,2005 University Corporation for Atmospheric Research
7 // Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu>
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 //
23 // You can contact University Corporation for Atmospheric Research at
24 // 3080 Center Green Drive, Boulder, CO 80301
25 
26 // Authors:
27 // pwest Patrick West <pwest@ucar.edu>
28 // jgarcia Jose Garcia <jgarcia@ucar.edu>
29 
30 #include <BESRequestHandlerList.h>
31 #include <BESDapNames.h>
32 #include <BESDataDDSResponse.h>
33 
34 #include "BESXDNames.h"
35 #include "BESXDTransmit.h"
36 #include "BESXDResponseHandler.h"
37 
39  BESResponseHandler(name)
40 {
41 }
42 
44 {
45 }
46 
61 {
63  // Create the DDS.
64  // NOTE: It is the responsibility of the specific request handler to set
65  // the BaseTypeFactory. It is set to NULL here
66  DataDDS *dds = new DataDDS(NULL, "virtual");
67  BESDataDDSResponse *bdds = new BESDataDDSResponse(dds);
68  _response = bdds;
70  dhi.action = DATA_RESPONSE;
72 
73  dhi.action = XD_RESPONSE;
74  _response = bdds;
75 }
76 
90 {
91  if (_response) {
92  transmitter->send_response(XD_TRANSMITTER, _response, dhi);
93  }
94 }
95 
97 BESXDResponseHandler::XDResponseBuilder(const string &handler_name)
98 {
99  return new BESXDResponseHandler(handler_name);
100 }
101 
virtual ~BESXDResponseHandler(void)
#define XD_RESPONSE
macros representing the xml_data response objects handled
Definition: BESXDNames.h:42
virtual void execute(BESDataHandlerInterface &dhi)
executes the command 'get ascii for ' by executing the request for each container in the sp...
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
transmit the response object built by the execute command using the specified transmitter object ...
BESXDResponseHandler(const string &name)
BESResponseObject * _response
handler object that knows how to create a specific response object
#define DATA_RESPONSE
Definition: BESDapNames.h:70
virtual void send_response(const string &method, BESResponseObject *obj, BESDataHandlerInterface &dhi)
#define NULL
Definition: wcsUtil.h:65
virtual void execute_each(BESDataHandlerInterface &dhi)
for each container in the given data handler interface, execute the given request ...
Represents an OPeNDAP DataDDS DAP2 data object within the BES.
#define XD_TRANSMITTER
Definition: BESXDTransmit.h:36
static BESRequestHandlerList * TheList()
Structure storing information used by the BES to handle the request.
static BESResponseHandler * XDResponseBuilder(const string &name)
#define XD_RESPONSE_STR
Definition: BESXDNames.h:44
string action
the response object requested, e.g.