OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
BESDMRResponseHandler.cc
Go to the documentation of this file.
1
// BESDMRResponseHandler.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) 2013 OPeNDAP, Inc.
7
// Author: Patrick West <pwest@rpi.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 OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
24
25
#include <DMR.h>
26
27
#include "
BESDMRResponseHandler.h
"
28
#include "
BESDMRResponse.h
"
29
#include "
BESRequestHandlerList.h
"
30
#include "
BESDapNames.h
"
31
#include "
BESDapTransmit.h
"
32
#include "
BESContextManager.h
"
33
34
BESDMRResponseHandler::BESDMRResponseHandler
(
const
string
&name) :
35
BESResponseHandler
(name)
36
{
37
}
38
39
BESDMRResponseHandler::~BESDMRResponseHandler
()
40
{
41
}
42
56
void
BESDMRResponseHandler::execute
(
BESDataHandlerInterface
&dhi)
57
{
58
dhi.
action_name
=
DMR_RESPONSE_STR
;
59
DMR *dmr =
new
DMR();
60
61
// Here we might set the dap and dmr version if they should be different from
62
// 4.0 and 1.0. jhrg 11/6/13
63
64
bool
found =
false
;
65
string
xml_base =
BESContextManager::TheManager
()->
get_context
(
"xml:base"
, found);
66
if
(found && !xml_base.empty()) {
67
dmr->set_request_xml_base(xml_base);
68
}
69
70
_response
=
new
BESDMRResponse
(dmr);
71
BESRequestHandlerList::TheList
()->
execute_each
(dhi);
72
}
73
86
void
BESDMRResponseHandler::transmit
(
BESTransmitter
*transmitter,
BESDataHandlerInterface
&dhi)
87
{
88
if
(
_response
) {
89
transmitter->
send_response
(
DMR_SERVICE
,
_response
, dhi);
90
}
91
}
92
99
void
BESDMRResponseHandler::dump
(ostream &strm)
const
100
{
101
strm <<
BESIndent::LMarg
<<
"BESDMRResponseHandler::dump - ("
<< (
void
*)
this
<<
")"
<< endl;
102
BESIndent::Indent
();
103
BESResponseHandler::dump
(strm);
104
BESIndent::UnIndent
();
105
}
106
107
BESResponseHandler
*
108
BESDMRResponseHandler::DMRResponseBuilder
(
const
string
&name)
109
{
110
return
new
BESDMRResponseHandler
(name);
111
}
112
BESDataHandlerInterface::action_name
string action_name
Definition:
BESDataHandlerInterface.h:140
BESDMRResponseHandler::transmit
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
transmit the response object built by the execute command using the specified transmitter object ...
Definition:
BESDMRResponseHandler.cc:86
BESTransmitter
Definition:
BESTransmitter.h:48
BESDMRResponseHandler::dump
virtual void dump(ostream &strm) const
dumps information about this object
Definition:
BESDMRResponseHandler.cc:99
BESDapNames.h
DMR_SERVICE
#define DMR_SERVICE
Definition:
BESDapNames.h:82
BESDMRResponseHandler::BESDMRResponseHandler
BESDMRResponseHandler(const string &name)
Definition:
BESDMRResponseHandler.cc:34
BESDMRResponseHandler::execute
virtual void execute(BESDataHandlerInterface &dhi)
executes the command 'get dmr for def_name;' by executing the request for each container in the speci...
Definition:
BESDMRResponseHandler.cc:56
BESRequestHandlerList.h
BESContextManager::get_context
virtual string get_context(const string &name, bool &found)
retrieve the value of the specified context from the BES
Definition:
BESContextManager.cc:70
BESIndent::Indent
static void Indent()
Definition:
BESIndent.cc:38
BESResponseHandler::_response
BESResponseObject * _response
Definition:
BESResponseHandler.h:85
BESDapTransmit.h
BESResponseHandler
handler object that knows how to create a specific response object
Definition:
BESResponseHandler.h:81
BESTransmitter::send_response
virtual void send_response(const string &method, BESResponseObject *obj, BESDataHandlerInterface &dhi)
Definition:
BESTransmitter.cc:69
BESDMRResponse.h
BESIndent::LMarg
static ostream & LMarg(ostream &strm)
Definition:
BESIndent.cc:73
BESDMRResponse
Represents an OPeNDAP DMR DAP4 data object within the BES.
Definition:
BESDMRResponse.h:39
BESRequestHandlerList::execute_each
virtual void execute_each(BESDataHandlerInterface &dhi)
for each container in the given data handler interface, execute the given request ...
Definition:
BESRequestHandlerList.cc:173
BESDMRResponseHandler::DMRResponseBuilder
static BESResponseHandler * DMRResponseBuilder(const string &name)
Definition:
BESDMRResponseHandler.cc:108
BESResponseHandler::dump
virtual void dump(ostream &strm) const
dumps information about this object
Definition:
BESResponseHandler.cc:74
BESDMRResponseHandler::~BESDMRResponseHandler
virtual ~BESDMRResponseHandler()
Definition:
BESDMRResponseHandler.cc:39
BESContextManager::TheManager
static BESContextManager * TheManager()
Definition:
BESContextManager.cc:138
BESRequestHandlerList::TheList
static BESRequestHandlerList * TheList()
Definition:
BESRequestHandlerList.cc:345
BESDataHandlerInterface
Structure storing information used by the BES to handle the request.
Definition:
BESDataHandlerInterface.h:60
BESContextManager.h
BESIndent::UnIndent
static void UnIndent()
Definition:
BESIndent.cc:44
BESDMRResponseHandler.h
DMR_RESPONSE_STR
#define DMR_RESPONSE_STR
Definition:
BESDapNames.h:84
dap
BESDMRResponseHandler.cc
Generated by
1.8.9.1