OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
BESDDSResponseHandler.cc
Go to the documentation of this file.
1
// BESDDSResponseHandler.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 "
BESDDSResponseHandler.h
"
34
#include "
BESDDSResponse.h
"
35
#include "
BESRequestHandlerList.h
"
36
#include "
BESDapNames.h
"
37
#include "
BESDataNames.h
"
38
#include "
BESDapTransmit.h
"
39
40
#include "
BESDebug.h
"
41
42
BESDDSResponseHandler::BESDDSResponseHandler
(
const
string
&name )
43
:
BESResponseHandler
( name )
44
{
45
}
46
47
BESDDSResponseHandler::~BESDDSResponseHandler
( )
48
{
49
}
50
64
void
65
BESDDSResponseHandler::execute
(
BESDataHandlerInterface
&dhi )
66
{
67
// NOTE: It is the responsibility of the specific request handler to set
68
// the BaseTypeFactory. It is set to NULL here
69
dhi.
action_name
=
DDS_RESPONSE_STR
;
70
DDS *dds =
new
DDS( NULL,
"virtual"
) ;
71
BESDDSResponse
*bdds =
new
BESDDSResponse
( dds ) ;
72
73
// Set the DAP protocol version requested by the client
74
75
dhi.
first_container
();
76
BESDEBUG
(
"version"
,
"Initial CE: "
<< dhi.
container
->
get_constraint
() << endl);
77
dhi.
container
->
set_constraint
(dds->get_keywords().parse_keywords(dhi.
container
->
get_constraint
()));
78
BESDEBUG
(
"version"
,
"CE after keyword processing: "
<< dhi.
container
->
get_constraint
() << endl);
79
80
if
(dds->get_keywords().has_keyword(
"dap"
)) {
81
dds->set_dap_version(dds->get_keywords().get_keyword_value(
"dap"
));
82
}
83
else
if
(!bdds->
get_dap_client_protocol
().empty()) {
84
dds->set_dap_version( bdds->
get_dap_client_protocol
() ) ;
85
}
86
87
_response
= bdds ;
88
BESRequestHandlerList::TheList
()->
execute_each
( dhi ) ;
89
}
90
103
void
104
BESDDSResponseHandler::transmit
(
BESTransmitter
*transmitter,
105
BESDataHandlerInterface
&dhi )
106
{
107
if
(
_response
)
108
{
109
transmitter->
send_response
(
DDS_SERVICE
,
_response
, dhi ) ;
110
}
111
}
112
119
void
120
BESDDSResponseHandler::dump
( ostream &strm )
const
121
{
122
strm <<
BESIndent::LMarg
<<
"BESDDSResponseHandler::dump - ("
123
<< (
void
*)
this
<<
")"
<< endl ;
124
BESIndent::Indent
() ;
125
BESResponseHandler::dump
( strm ) ;
126
BESIndent::UnIndent
() ;
127
}
128
129
BESResponseHandler
*
130
BESDDSResponseHandler::DDSResponseBuilder
(
const
string
&name )
131
{
132
return
new
BESDDSResponseHandler
( name ) ;
133
}
134
dispatch
BESDDSResponseHandler.cc
Generated by
1.8.3.1