OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
BESWWWResponseHandler.cc
Go to the documentation of this file.
1 // BESWWWResponseHandler.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 // (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
27 // Please read the full copyright statement in the file COPYRIGHT_UCAR.
28 //
29 // Authors:
30 // pwest Patrick West <pwest@ucar.edu>
31 // jgarcia Jose Garcia <jgarcia@ucar.edu>
32 
33 #include "BESWWWResponseHandler.h"
34 #include "BESRequestHandlerList.h"
35 #include "BESDapNames.h"
36 #include "BESWWWNames.h"
37 #include "BESWWW.h"
38 #if 0
39 #include "BESDASResponse.h"
40 #endif
41 #include "BESDDSResponse.h"
42 #include "BESWWWTransmit.h"
43 
45 : BESResponseHandler(name)
46 {
47 }
48 
50 {
51 }
52 
69 void
71 {
73 
74  // Create the DDS.
75  // NOTE: It is the responsbility of the specific request handler to set
76  // the BaseTypeFactory. It is set to NULL here
77  DDS *dds = new DDS(NULL, "virtual");
78  BESDDSResponse *bdds = new BESDDSResponse(dds);
79  _response = bdds;
81  dhi.action = DDS_RESPONSE;
83 #if 0
84  // Fill the DAS
85  DAS *das = new DAS;
86  BESDASResponse *bdas = new BESDASResponse(das);
87  _response = bdas;
89  dhi.action = DAS_RESPONSE;
91 #endif
92  BESWWW *www = new BESWWW(/*bdas,*/ bdds);
93  _response = www;
94  dhi.action = WWW_RESPONSE;
95 }
96 
111 {
112  if (_response) {
113  transmitter->send_response(WWW_TRANSMITTER, _response, dhi);
114  }
115 }
116 
118 WWWResponseBuilder( const string &handler_name )
119 {
120  return new BESWWWResponseHandler( handler_name ) ;
121 }
#define WWW_RESPONSE_STR
Definition: BESWWWNames.h:47
virtual ~BESWWWResponseHandler(void)
Represents an OPeNDAP DDS DAP2 data object within the BES.
BESResponseObject * _response
handler object that knows how to create a specific response object
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 ...
container for a DAS and DDS needed to write out the usage information for a dataset.
Definition: BESWWW.h:51
static BESRequestHandlerList * TheList()
Structure storing information used by the BES to handle the request.
static BESResponseHandler * WWWResponseBuilder(const string &name)
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
transmit the response object built by the execute command using the specified transmitter object ...
#define WWW_RESPONSE
macros representing the WWW response objects handled
Definition: BESWWWNames.h:45
virtual void execute(BESDataHandlerInterface &dhi)
executes the command 'get html_form for ;' by executing the request for each container in t...
Represents an OPeNDAP DAS DAP2 data object within the BES.
BESWWWResponseHandler(const string &name)
string action
the response object requested, e.g.
#define WWW_TRANSMITTER
#define DDS_RESPONSE
Definition: BESDapNames.h:60
#define DAS_RESPONSE
Definition: BESDapNames.h:55