OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
BESXDModule.cc
Go to the documentation of this file.
1 // BESXDModule.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>
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 
29 #include <iostream>
30 
31 using std::endl;
32 
33 #include <BESXDModule.h>
34 #include <BESDebug.h>
35 
36 #include <BESDapNames.h>
37 #include <BESResponseNames.h>
38 #include <BESResponseHandlerList.h>
39 #include <BESRequestHandlerList.h>
40 
41 #include <BESDapService.h>
42 
43 #include <BESTransmitter.h>
44 #include <BESReturnManager.h>
45 #include <BESTransmitterNames.h>
46 
47 #include "BESXDNames.h"
48 #include "BESXDResponseHandler.h"
49 #include "BESXDRequestHandler.h"
50 #include "BESXDTransmit.h"
51 
52 void BESXDModule::initialize(const string &modname)
53 {
54  BESDEBUG("xd", "Initializing OPeNDAP XD module " << modname << endl);
55 
56  BESRequestHandler *handler = new BESXDRequestHandler(modname);
57  BESRequestHandlerList::TheList()->add_handler(modname, handler);
58 
60 
61  BESDapService::add_to_dap_service(XD_SERVICE, "OPeNDAP xml data representation");
62 
64  if (t)
66 
67  BESDebug::Register("xd");
68 
69  BESDEBUG("xd", "Done Initializing OPeNDAP XD module " << modname << endl);
70 }
71 
72 void BESXDModule::terminate(const string &modname)
73 {
74  BESDEBUG("xd", "Cleaning OPeNDAP XD module " << modname << endl);
75 
77  if (rh)
78  delete rh;
79 
81 
83  if (t)
85 
87  if (t)
89 
90  BESDEBUG("xd", "Done Cleaning OPeNDAP XD module " << modname << endl);
91 }
92 
99 void BESXDModule::dump(ostream &strm) const
100 {
101  strm << BESIndent::LMarg << "BESXDModule::dump - (" << (void *) this << ")" << endl;
102 }
103 
104 extern "C" {
106 {
107  return new BESXDModule;
108 }
109 }
110 
virtual BESTransmitter * find_transmitter(const string &name)
static void add_to_dap_service(const string &cmd, const string &desc)
static function to add commands to the dap service
virtual bool add_handler(const string &handler_name, BESRequestHandler *handler)
add a request handler to the list of registered handlers for this server
virtual void initialize(const string &modname)
Definition: BESXDModule.cc:52
#define XD_RESPONSE
macros representing the xml_data response objects handled
Definition: BESXDNames.h:42
virtual bool add_method(string method_name, p_transmitter trans_method)
#define XD_SERVICE
Definition: BESXDNames.h:43
static BESReturnManager * TheManager()
static void send_basic_ascii(BESResponseObject *obj, BESDataHandlerInterface &dhi)
static ostream & LMarg(ostream &strm)
Definition: BESIndent.cc:73
virtual void terminate(const string &modname)
Definition: BESXDModule.cc:72
virtual bool add_handler(const string &handler, p_response_handler handler_method)
add a response handler to the list
#define DAP2_FORMAT
Definition: BESDapNames.h:53
#define XD_TRANSMITTER
Definition: BESXDTransmit.h:36
Represents a specific data type request handler.
static BESRequestHandlerList * TheList()
virtual void dump(ostream &strm) const
dumps information about this object
Definition: BESXDModule.cc:99
BESAbstractModule * maker()
Definition: BESXDModule.cc:105
virtual bool remove_handler(const string &handler)
removes a response handler from the list
static BESResponseHandler * XDResponseBuilder(const string &name)
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
Definition: BESDebug.h:64
static void Register(const string &flagName)
register the specified debug flag
Definition: BESDebug.h:138
virtual bool remove_method(string method_name)
static BESResponseHandlerList * TheList()
virtual BESRequestHandler * remove_handler(const string &handler_name)
remove and return the specified request handler