OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
BESDefaultModule.cc
Go to the documentation of this file.
1 // BESDefaultModule.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-2009 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 <iostream>
34 
35 using std::endl ;
36 
37 #include "BESDefaultModule.h"
38 
39 #include "BESResponseNames.h"
40 #include "BESResponseHandlerList.h"
41 
42 #include "BESHelpResponseHandler.h"
44 
45 #ifdef BES_DEVELOPER
48 #endif
49 
53 
60 
67 
70 
72 
73 #include "BESTransmitterNames.h"
74 #include "BESReturnManager.h"
75 #include "BESBasicTransmitter.h"
76 
77 #include "BESDebug.h"
78 
79 #include "BESTextInfo.h"
80 #include "BESHTMLInfo.h"
81 #include "BESXMLInfo.h"
82 #include "BESInfoList.h"
83 #include "BESInfoNames.h"
84 
85 int
87 {
88  BESDEBUG( "bes", "Initializing default modules:" << endl ) ;
89 
90  BESDEBUG( "bes", " adding " << HELP_RESPONSE << " response handler" << endl ) ;
92 
93 #ifdef BES_DEVELOPER
94  BESDEBUG( "bes", " adding " << PROCESS_RESPONSE << " response handler" << endl ) ;
96 
97  BESDEBUG( "bes", " adding " << CONFIG_RESPONSE << " response handler" << endl ) ;
99 #endif
100 
101  BESDEBUG( "bes", " adding " << VERS_RESPONSE << " response handler" << endl ) ;
103 
104  BESDEBUG( "bes", " adding " << STATUS_RESPONSE << " response handler" << endl ) ;
106 
107  BESDEBUG( "bes", " adding " << SERVICE_RESPONSE << " response handler" << endl ) ;
109 
110  BESDEBUG( "bes", " adding " << STREAM_RESPONSE << " response handler" << endl ) ;
112 
113  BESDEBUG( "bes", " adding " << SETCONTAINER << " response handler" << endl ) ;
115 
116  BESDEBUG( "bes", " adding " << SHOWCONTAINERS_RESPONSE << " response handler" << endl ) ;
118 
119  BESDEBUG( "bes", " adding " << DELETE_CONTAINER << " response handler" << endl ) ;
121 
122  BESDEBUG( "bes", " adding " << DELETE_CONTAINERS << " response handler" << endl) ;
124 
125  BESDEBUG( "bes", " adding " << PERSISTENCE_VOLATILE << " container persistence" << endl ) ;
127 
128  BESDEBUG( "bes", " adding " << DEFINE_RESPONSE << " response handler" << endl ) ;
130 
131  BESDEBUG( "bes", " adding " << SHOWDEFS_RESPONSE << " response handler" << endl) ;
133 
134  BESDEBUG( "bes", " adding " << DELETE_DEFINITION << " response handler" << endl) ;
136 
137  BESDEBUG( "bes", " adding " << DELETE_DEFINITIONS << " response handler" << endl ) ;
139 
140  BESDEBUG( "bes", " adding " << PERSISTENCE_VOLATILE << " definition persistence" << endl ) ;
142 
143  BESDEBUG( "bes", " adding " << SET_CONTEXT << " response handler" << endl) ;
145 
146  BESDEBUG( "bes", " adding " << SHOW_CONTEXT << " response handler" << endl) ;
148 
149  BESDEBUG( "bes", " adding " << SHOW_ERROR << " response handler" << endl) ;
151 
152  BESDEBUG( "bes", " adding " << BASIC_TRANSMITTER << " transmitter" << endl ) ;
154 
155  BESDEBUG( "bes", " adding " << BES_TEXT_INFO << " info builder" << endl ) ;
158 
159  BESDEBUG( "bes", " adding " << BES_HTML_INFO << " info builder" << endl ) ;
162 
163  BESDEBUG( "bes", " adding " << BES_XML_INFO << " info builder" << endl ) ;
166 
167  BESDEBUG( "bes", " adding bes debug context" << endl ) ;
168  BESDebug::Register( "bes" ) ;
169 
170  BESDEBUG( "bes", "Done Initializing default modules:" << endl ) ;
171 
172  return 0 ;
173 }
174 
175 int
177 {
178  BESDEBUG( "bes", "Removing default modules" << endl ) ;
179 
180 #ifdef BES_DEVELOPER
183 #endif
184 
193 
195 
200 
202 
206 
208 
209 
213 
214 #if 0
215  // Original code
222 
228 
233 
235 
238 
240 #endif
241 
242  BESDEBUG( "bes", "Done Removing default modules" << endl ) ;
243 
244  return 0 ;
245 }
246 
static BESResponseHandler * DelDefResponseBuilder(const string &name)
static BESResponseHandler * ProcIdResponseBuilder(const string &name)
provides volatile storage for a specific definition/view of different containers including contraints...
#define DELETE_CONTAINER
virtual bool del_transmitter(const string &name)
static BESResponseHandler * ConfigResponseBuilder(const string &handler_name)
#define STREAM_RESPONSE
#define SET_CONTEXT
static BESResponseHandler * StatusResponseBuilder(const string &name)
static BESResponseHandler * BESStreamResponseBuilder(const string &name)
static int initialize(int argc, char **argv)
static BESResponseHandler * DelContainersResponseBuilder(const string &name)
static BESInfoList * TheList()
Definition: BESInfoList.cc:142
static BESResponseHandler * DelDefsResponseBuilder(const string &name)
static BESResponseHandler * SetContextResponseBuilder(const string &name)
static BESResponseHandler * SetContainerResponseBuilder(const string &name)
#define PROCESS_RESPONSE
static BESInfo * BuildHTMLInfo(const string &info_type)
Definition: BESHTMLInfo.cc:288
static BESResponseHandler * ShowContainersResponseBuilder(const string &name)
implementation of BESContainerStorage that stores containers in memory for the duration of this proce...
static BESInfo * BuildTextInfo(const string &info_type)
Definition: BESTextInfo.cc:262
#define SHOW_ERROR
virtual bool add_persistence(BESContainerStorage *p)
Add a persistent store to the list.
virtual bool rem_info_builder(const string &info_type)
Definition: BESInfoList.cc:64
#define DELETE_CONTAINERS
#define BES_TEXT_INFO
macros representing the default informational response objects
Definition: BESInfoNames.h:46
virtual bool add_transmitter(const string &name, BESTransmitter *transmitter)
static BESResponseHandler * VersionResponseBuilder(const string &name)
#define BASIC_TRANSMITTER
macros representing the default transmitter objects
static BESResponseHandler * ResponseBuilder(const string &name)
#define HELP_RESPONSE
#define SHOWDEFS_RESPONSE
#define PERSISTENCE_VOLATILE
static BESReturnManager * TheManager()
virtual bool add_persistence(BESDefinitionStorage *p)
Add a persistent store to the list.
static int terminate(void)
#define CONFIG_RESPONSE
static BESResponseHandler * ShowDefsResponseBuilder(const string &handler_name)
#define DEFINE_RESPONSE
#define BES_HTML_INFO
Definition: BESInfoNames.h:47
#define SERVICE_RESPONSE
virtual bool deref_persistence(const string &persist_name)
dereference a persistent store in the list.
#define SETCONTAINER
static BESDefinitionStorageList * TheList()
virtual bool add_handler(const string &handler, p_response_handler handler_method)
add a response handler to the list
#define DELETE_DEFINITION
virtual bool deref_persistence(const string &persist_name)
de-reference a persistent store in the list
static BESInfo * BuildXMLInfo(const string &info_type)
Definition: BESXMLInfo.cc:565
virtual bool add_info_builder(const string &info_type, p_info_builder info_builder)
Definition: BESInfoList.cc:50
static BESResponseHandler * DelContainerResponseBuilder(const string &name)
static BESResponseHandler * ShowContextResponseBuilder(const string &name)
#define SHOW_CONTEXT
#define DELETE_DEFINITIONS
static BESContainerStorageList * TheList()
#define STATUS_RESPONSE
virtual bool remove_handler(const string &handler)
removes a response handler from the list
#define VERS_RESPONSE
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
Definition: BESDebug.h:64
static BESResponseHandler * HelpResponseBuilder(const string &name)
static BESResponseHandler * DefineResponseBuilder(const string &name)
static void Register(const string &flagName)
register the specified debug flag
Definition: BESDebug.h:138
static BESResponseHandler * ResponseBuilder(const string &handler_name)
#define BES_XML_INFO
Definition: BESInfoNames.h:48
static BESResponseHandlerList * TheList()
#define SHOWCONTAINERS_RESPONSE