00001 // TestRequestHandler.cc 00002 00003 // -*- mode: c++; c-basic-offset:4 -*- 00004 00005 // This file is part of cdf-handler, a C++ server of OPeNDAP for access to cdf 00006 // data 00007 00008 // Copyright (c) 2002,2003 OPeNDAP, Inc. 00009 // Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu> 00010 // 00011 // This library is free software; you can redistribute it and/or 00012 // modify it under the terms of the GNU Lesser General Public 00013 // License as published by the Free Software Foundation; either 00014 // version 2.1 of the License, or (at your option) any later version. 00015 // 00016 // This library is distributed in the hope that it will be useful, 00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 // Lesser General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU Lesser General Public 00022 // License along with this library; if not, write to the Free Software 00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 // 00025 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. 00026 00027 // Implementation for TestRequestHandler. 00028 // 00029 // Authors: 00030 // pwest Patrick West <pwest@ucar.edu> 00031 // jgarcia Jose Garcia <jgarcia@ucar.edu> 00032 00033 #ifdef __GNUG__ 00034 #pragma implementation 00035 #endif 00036 00037 #include "TestRequestHandler.h" 00038 #include "BESResponseNames.h" 00039 #include "BESResponseHandler.h" 00040 #include "BESInfo.h" 00041 00042 TestRequestHandler::TestRequestHandler( string name ) 00043 : BESRequestHandler( name ) 00044 { 00045 add_handler( HELP_RESPONSE, TestRequestHandler::cdf_build_help ) ; 00046 } 00047 00048 TestRequestHandler::~TestRequestHandler() 00049 { 00050 } 00051 00052 bool 00053 TestRequestHandler::cdf_build_help( BESDataHandlerInterface &dhi ) 00054 { 00055 BESInfo *info = (BESInfo *)dhi.response_handler->get_response_object() ; 00056 string key ; 00057 if( dhi.transmit_protocol == "HTTP" ) 00058 key = (string)"Test.Help." + dhi.transmit_protocol ; 00059 else 00060 key = "Test.Help.TXT" ; 00061 info->add_data_from_file( key, "Test Handler Help" ) ; 00062 00063 return true ; 00064 } 00065 00072 void 00073 TestRequestHandler::dump( ostream &strm ) const 00074 { 00075 strm << BESIndent::LMarg << "TestRequestHandler::dump - (" 00076 << (void *)this << ")" << endl ; 00077 BESIndent::Indent() ; 00078 BESRequestHandler::dump( strm ) ; 00079 BESIndent::UnIndent() ; 00080 } 00081