OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
BESXMLDefaultCommands.cc
Go to the documentation of this file.
1 // BESXMLDefaultCommands.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 "BESXMLDefaultCommands.h"
38 
39 #include "BESResponseNames.h"
40 
41 #include "BESDebug.h"
42 
43 #include "BESXMLShowCommand.h"
44 #include "BESXMLShowErrorCommand.h"
47 #include "BESXMLDefineCommand.h"
48 #include "BESXMLGetCommand.h"
53 
56 int
58 {
59  BESDEBUG( "besxml", "Initializing default commands:" << endl ) ;
60 
61  BESXMLCommand *cmd = NULL ;
62 
63  BESDEBUG( "besxml", " adding " << SHOW_CONTEXT_STR
64  << " command" << endl ) ;
67 
68  BESDEBUG( "besxml", " adding " << SHOWDEFS_RESPONSE_STR
69  << " command" << endl ) ;
72 
73  BESDEBUG( "besxml", " adding " << SHOWCONTAINERS_RESPONSE_STR
74  << " command" << endl) ;
77 
78  BESDEBUG( "besxml", " adding " << SHOW_ERROR_STR
79  << " command" << endl) ;
82 
83  BESDEBUG( "besxml", " adding " << HELP_RESPONSE_STR
84  << " command" << endl) ;
87 
88 #ifdef BES_DEVELOPER
89  BESDEBUG( "besxml", " adding " << PROCESS_RESPONSE_STR
90  << " command" << endl) ;
93 
94  BESDEBUG( "besxml", " adding " << CONFIG_RESPONSE_STR
95  << " command" << endl) ;
98 #endif
99 
100  BESDEBUG( "besxml", " adding " << VERS_RESPONSE_STR
101  << " command" << endl) ;
104 
105  BESDEBUG( "besxml", " adding " << STATUS_RESPONSE_STR
106  << " command" << endl) ;
109 
110  BESDEBUG( "besxml", " adding " << SERVICE_RESPONSE_STR
111  << " command" << endl) ;
114 
115  BESDEBUG( "besxml", " adding " << SET_CONTEXT_STR
116  << " command" << endl ) ;
119 
120  BESDEBUG( "besxml", " adding " << SETCONTAINER_STR
121  << " command" << endl ) ;
124 
125  BESDEBUG( "besxml", " adding " << DEFINE_RESPONSE_STR
126  << " command" << endl ) ;
129 
130  BESDEBUG( "besxml", " adding " << GET_RESPONSE
131  << " command" << endl ) ;
134 
135  BESDEBUG( "besxml", " adding " << DELETE_CONTAINER_STR
136  << " command" << endl ) ;
139 
140  BESDEBUG( "besxml", " adding " << DELETE_CONTAINERS_STR
141  << " command" << endl ) ;
144 
145  BESDEBUG( "besxml", " adding " << DELETE_DEFINITION_STR
146  << " command" << endl ) ;
149 
150  BESDEBUG( "besxml", " adding " << DELETE_DEFINITIONS_STR
151  << " command" << endl ) ;
154 
155  BESDEBUG( "besxml", "Done Initializing default commands:" << endl ) ;
156 
157  return 0;
158 }
159 
163 int
165 {
166  BESDEBUG( "besxml", "Removing default commands:" << endl ) ;
167 
173 #ifdef BES_DEVELOPER
176 #endif
185 
186  BESDEBUG( "besxml", "Done Removing default commands:" << endl ) ;
187 
188  return true;
189 }
190 
#define DELETE_CONTAINER_STR
#define DELETE_DEFINITIONS_STR
static bool del_command(const string &cmd_str)
Deletes the command called cmd_str from the list of possible commands.
static void add_command(const string &cmd_str, p_xmlcmd_builder cmd)
Add a command to the possible commands allowed by this BES.
#define PROCESS_RESPONSE_STR
#define VERS_RESPONSE_STR
#define SHOWDEFS_RESPONSE_STR
static BESXMLCommand * CommandBuilder(const BESDataHandlerInterface &base_dhi)
static int terminate(void)
Removes the default set of BES XML commands from the list of possible commands.
static int initialize(int argc, char **argv)
Loads the default set of BES XML commands.
#define SETCONTAINER_STR
static BESXMLCommand * CommandBuilder(const BESDataHandlerInterface &base_dhi)
static BESXMLCommand * CommandBuilder(const BESDataHandlerInterface &base_dhi)
#define HELP_RESPONSE_STR
#define GET_RESPONSE
#define SHOW_ERROR_STR
#define CONFIG_RESPONSE_STR
static BESXMLCommand * CommandBuilder(const BESDataHandlerInterface &base_dhi)
#define SERVICE_RESPONSE_STR
#define STATUS_RESPONSE_STR
static BESXMLCommand * CommandBuilder(const BESDataHandlerInterface &base_dhi)
#define DELETE_DEFINITION_STR
#define DELETE_CONTAINERS_STR
static BESXMLCommand * CommandBuilder(const BESDataHandlerInterface &base_dhi)
static BESXMLCommand * CommandBuilder(const BESDataHandlerInterface &base_dhi)
#define SET_CONTEXT_STR
static BESXMLCommand * CommandBuilder(const BESDataHandlerInterface &base_dhi)
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
Definition: BESDebug.h:64
#define SHOWCONTAINERS_RESPONSE_STR
#define SHOW_CONTEXT_STR
#define DEFINE_RESPONSE_STR
static BESXMLCommand * CommandBuilder(const BESDataHandlerInterface &base_dhi)
static BESXMLCommand * CommandBuilder(const BESDataHandlerInterface &base_dhi)