bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
BuildDmrppModule.cc
1// -*- mode: c++; c-basic-offset:4 -*-
2
3// This file is part of builddmrpp_module, A C++ module that can be loaded in to
4// the OPeNDAP Back-End Server (BES) and is able to handle remote requests.
5
6// Copyright (c) 2023 OPeNDAP, Inc.
7// Author: Daniel Holloway <dholloway@opendap.org>
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// Authors:
25// dan Daniel Holloway <dholloway@opendap.org>
26// ndp Nathan Potter <ndp@opendap.org>
27
28#include "config.h"
29
30#include <iostream>
31#include <vector>
32#include <string>
33
34#include <BESRequestHandlerList.h>
35#include <BESDebug.h>
36#include <BESContainerStorageList.h>
37
38#include "BuildDmrppModule.h"
39#include "BuildDmrppRequestHandler.h"
40#include "NgapBuildDmrppContainerStorage.h"
41
42using namespace std;
43using namespace builddmrpp;
44
45void BuildDmrppModule::initialize(const string &modname)
46{
47 BESDEBUG(modname, "Initializing BuildDmrpp Module " << modname << endl);
48
49 BESRequestHandlerList::TheList()->add_handler(modname, new BuildDmrppRequestHandler(modname));
50
51 BESContainerStorageList::TheList()->add_persistence(new NgapBuildDmrppContainerStorage(modname));
52
53 BESDebug::Register(modname);
54
55 BESDEBUG(modname, "Done Initializing BuildDmrpp Module " << modname << endl);
56}
57
58void BuildDmrppModule::terminate(const string &modname)
59{
60 BESDEBUG(modname, "Cleaning BuildDmrpp module " << modname << endl);
61
62 BESRequestHandler *rh = BESRequestHandlerList::TheList()->remove_handler(modname);
63 delete rh;
64
65 BESContainerStorageList::TheList()->deref_persistence(modname);
66
67 BESDEBUG(modname, "Done Cleaning BuildDmrpp module " << modname << endl);
68}
69
70void BuildDmrppModule::dump(ostream &strm) const
71{
72 strm << BESIndent::LMarg << "BuildDmrppModule::dump - (" << (void *) this << ")" << endl;
73}
74
75extern "C"
76BESAbstractModule *maker()
77{
78 return new BuildDmrppModule;
79}
80
static void Register(const std::string &flagName)
register the specified debug flag
Definition BESDebug.h:126
void dump(std::ostream &strm) const override
dump the contents of this object to the specified ostream