BESXMLDefaultCommands.cc

Go to the documentation of this file.
00001 // BESXMLDefaultCommands.cc
00002 
00003 // This file is part of bes, A C++ back-end server implementation framework
00004 // for the OPeNDAP Data Access Protocol.
00005 
00006 // Copyright (c) 2004-2009 University Corporation for Atmospheric Research
00007 // Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu>
00008 //
00009 // This library is free software; you can redistribute it and/or
00010 // modify it under the terms of the GNU Lesser General Public
00011 // License as published by the Free Software Foundation; either
00012 // version 2.1 of the License, or (at your option) any later version.
00013 // 
00014 // This library is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 // Lesser General Public License for more details.
00018 // 
00019 // You should have received a copy of the GNU Lesser General Public
00020 // License along with this library; if not, write to the Free Software
00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //
00023 // You can contact University Corporation for Atmospheric Research at
00024 // 3080 Center Green Drive, Boulder, CO 80301
00025  
00026 // (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
00027 // Please read the full copyright statement in the file COPYRIGHT_UCAR.
00028 //
00029 // Authors:
00030 //      pwest       Patrick West <pwest@ucar.edu>
00031 //      jgarcia     Jose Garcia <jgarcia@ucar.edu>
00032 
00033 #include <iostream>
00034 
00035 using std::endl ;
00036 
00037 #include "BESXMLDefaultCommands.h"
00038 
00039 #include "BESResponseNames.h"
00040 
00041 #include "BESDebug.h"
00042 
00043 #include "BESXMLShowCommand.h"
00044 #include "BESXMLSetContextCommand.h"
00045 #include "BESXMLSetContainerCommand.h"
00046 #include "BESXMLDefineCommand.h"
00047 #include "BESXMLGetCommand.h"
00048 #include "BESXMLDeleteContainerCommand.h"
00049 #include "BESXMLDeleteContainersCommand.h"
00050 #include "BESXMLDeleteDefinitionCommand.h"
00051 #include "BESXMLDeleteDefinitionsCommand.h"
00052 
00053 int
00054 BESXMLDefaultCommands::initialize( int, char** )
00055 {
00056     BESDEBUG( "besxml", "Initializing default commands:" << endl )
00057 
00058     BESXMLCommand *cmd = NULL ;
00059 
00060     BESDEBUG( "besxml", "    adding " << SHOW_CONTEXT_STR
00061                         << " command" << endl )
00062     BESXMLCommand::add_command( SHOW_CONTEXT_STR,
00063                                 BESXMLShowCommand::CommandBuilder ) ;
00064 
00065     BESDEBUG( "besxml", "    adding " << SHOWDEFS_RESPONSE_STR
00066                         << " command" << endl )
00067     BESXMLCommand::add_command( SHOWDEFS_RESPONSE_STR,
00068                                 BESXMLShowCommand::CommandBuilder ) ;
00069 
00070     BESDEBUG( "besxml", "    adding " << SHOWCONTAINERS_RESPONSE_STR
00071                         << " command" << endl)
00072     BESXMLCommand::add_command( SHOWCONTAINERS_RESPONSE_STR,
00073                                 BESXMLShowCommand::CommandBuilder ) ;
00074 
00075     BESDEBUG( "besxml", "    adding " << HELP_RESPONSE_STR
00076                         << " command" << endl)
00077     BESXMLCommand::add_command( HELP_RESPONSE_STR,
00078                                 BESXMLShowCommand::CommandBuilder ) ;
00079 
00080 #ifdef BES_DEVELOPER
00081     BESDEBUG( "besxml", "    adding " << PROCESS_RESPONSE_STR
00082                         << " command" << endl)
00083     BESXMLCommand::add_command( PROCESS_RESPONSE_STR,
00084                                 BESXMLShowCommand::CommandBuilder ) ;
00085 
00086     BESDEBUG( "besxml", "    adding " << CONFIG_RESPONSE_STR
00087                         << " command" << endl)
00088     BESXMLCommand::add_command( CONFIG_RESPONSE_STR,
00089                                 BESXMLShowCommand::CommandBuilder ) ;
00090 #endif
00091 
00092     BESDEBUG( "besxml", "    adding " << VERS_RESPONSE_STR
00093                         << " command" << endl)
00094     BESXMLCommand::add_command( VERS_RESPONSE_STR,
00095                                 BESXMLShowCommand::CommandBuilder ) ;
00096 
00097     BESDEBUG( "besxml", "    adding " << STATUS_RESPONSE_STR
00098                         << " command" << endl)
00099     BESXMLCommand::add_command( STATUS_RESPONSE_STR,
00100                                 BESXMLShowCommand::CommandBuilder ) ;
00101 
00102     BESDEBUG( "besxml", "    adding " << SERVICE_RESPONSE_STR
00103                         << " command" << endl)
00104     BESXMLCommand::add_command( SERVICE_RESPONSE_STR,
00105                                 BESXMLShowCommand::CommandBuilder ) ;
00106 
00107     BESDEBUG( "besxml", "    adding " << SET_CONTEXT_STR
00108                         << " command" << endl )
00109     BESXMLCommand::add_command( SET_CONTEXT_STR,
00110                                 BESXMLSetContextCommand::CommandBuilder ) ;
00111 
00112     BESDEBUG( "besxml", "    adding " << SETCONTAINER_STR
00113                         << " command" << endl )
00114     BESXMLCommand::add_command( SETCONTAINER_STR,
00115                                 BESXMLSetContainerCommand::CommandBuilder);
00116 
00117     BESDEBUG( "besxml", "    adding " << DEFINE_RESPONSE_STR
00118                         << " command" << endl )
00119     BESXMLCommand::add_command( DEFINE_RESPONSE_STR,
00120                                 BESXMLDefineCommand::CommandBuilder ) ;
00121 
00122     BESDEBUG( "besxml", "    adding " << GET_RESPONSE
00123                         << " command" << endl )
00124     BESXMLCommand::add_command( GET_RESPONSE,
00125                                 BESXMLGetCommand::CommandBuilder ) ;
00126 
00127     BESDEBUG( "besxml", "    adding " << DELETE_CONTAINER_STR
00128                         << " command" << endl )
00129     BESXMLCommand::add_command( DELETE_CONTAINER_STR,
00130                                 BESXMLDeleteContainerCommand::CommandBuilder ) ;
00131 
00132     BESDEBUG( "besxml", "    adding " << DELETE_CONTAINERS_STR
00133                         << " command" << endl )
00134     BESXMLCommand::add_command( DELETE_CONTAINERS_STR,
00135                                 BESXMLDeleteContainersCommand::CommandBuilder );
00136 
00137     BESDEBUG( "besxml", "    adding " << DELETE_DEFINITION_STR
00138                         << " command" << endl )
00139     BESXMLCommand::add_command( DELETE_DEFINITION_STR,
00140                                 BESXMLDeleteDefinitionCommand::CommandBuilder );
00141 
00142     BESDEBUG( "besxml", "    adding " << DELETE_DEFINITIONS_STR
00143                         << " command" << endl )
00144     BESXMLCommand::add_command( DELETE_DEFINITIONS_STR,
00145                                 BESXMLDeleteDefinitionsCommand::CommandBuilder);
00146 
00147     BESDEBUG( "besxml", "Done Initializing default commands:" << endl )
00148 
00149     return 0;
00150 }
00151 
00152 int
00153 BESXMLDefaultCommands::terminate( void )
00154 {
00155     BESDEBUG( "besxml", "Removing default commands:" << endl )
00156 
00157     BESXMLCommand::del_command( GET_RESPONSE ) ;
00158     BESXMLCommand::del_command( SHOW_CONTEXT_STR ) ;
00159     BESXMLCommand::del_command( SHOWDEFS_RESPONSE_STR ) ;
00160     BESXMLCommand::del_command( SHOWCONTAINERS_RESPONSE_STR ) ;
00161     BESXMLCommand::del_command( HELP_RESPONSE_STR ) ;
00162 #ifdef BES_DEVELOPER
00163     BESXMLCommand::del_command( PROCESS_RESPONSE_STR ) ;
00164     BESXMLCommand::del_command( CONFIG_RESPONSE_STR ) ;
00165 #endif
00166     BESXMLCommand::del_command( VERS_RESPONSE_STR ) ;
00167     BESXMLCommand::del_command( STATUS_RESPONSE_STR ) ;
00168     BESXMLCommand::del_command( SET_CONTEXT_STR ) ;
00169     BESXMLCommand::del_command( SETCONTAINER_STR ) ;
00170     BESXMLCommand::del_command( DEFINE_RESPONSE_STR ) ;
00171     BESXMLCommand::del_command( DELETE_CONTAINER_STR ) ;
00172     BESXMLCommand::del_command( DELETE_CONTAINERS_STR ) ;
00173     BESXMLCommand::del_command( DELETE_DEFINITION_STR ) ;
00174 
00175     BESDEBUG( "besxml", "Done Removing default commands:" << endl )
00176 
00177     return true;
00178 }
00179 

Generated on Sat Aug 22 06:04:40 2009 for OPeNDAP Hyrax Back End Server (BES) by  doxygen 1.6.0