Repository navigation
Expand file tree
/
Copy pathSQLModule.h
More file actions
115 lines (95 loc) · 3.04 KB
/
Copy pathSQLModule.h
File metadata and controls
115 lines (95 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
* SQLModule.h
*
* This file is part of the SQLHandler a C++ library to add relational
* database access to the OPeNDAP Hyrax back-end server.
* Copyright (C) 2010 Carlo Cancellieri <ccancellieri@hotmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*
* Created on: 24/Jun/2010
* Author: carlo cancellieri
*
*/
#ifndef I_SQLModule_H
#define I_SQLModule_H 1
#include <BESAbstractModule.h>
#include <iostream>
using std::endl;
#include <BESDebug.h>
#include <BESDapService.h>
#include <BESServiceRegistry.h>
#include <BESRequestHandlerList.h>
#include <BESResponseHandlerList.h>
#include <BESResponseHandler.h>
#include <BESResponseNames.h>
#include <BESContainerStorageList.h>
#include <BESFileContainerStorage.h>
#include <BESCatalogDirectory.h>
#include <BESCatalogList.h>
#include "SQLRequestHandler.h"
#include "container/SQLContainerFactory.h"
#include "container/SQLContainerStorage.h"
/**
* @brief The module of the SQLHandler it
* load the main components of the handler.
*/
class SQLModule : public BESAbstractModule {
public:
/**
* SQLRequestHandler is a wrapper for ALL Requests of
* type sql.
* It is build at the SQLModule load and deleted when
* it is unloaded.
*/
static SQLRequestHandler *rh;
/**
* load and update instances of SQLContainer(s)
* from/to the SQLContainerStorage and the filesystem
*/
static SQLContainerFactory cf;
/**
* @note: this implementation of SQLRequestHandler uses
* SQLContainerStorageVolatile if you want to implement
* your own persistence you can use the
* SQLContainer::setPersistence(SQLContainerStorage*)
* to change it on the fly.
* You could also set it to NULL to make SQLContainerFactory
* to rebuild the SQLContainer each time it is requested.
*/
// store instances of loaded SQLContainer(s)
static SQLContainerStorage *cs;
/**
* @brief ctor
*/
SQLModule() {}
/**
* @brief dtor
*/
virtual ~SQLModule() {}
/**
* @brief initialize BES components.
* Register SQLHandler components into the BES environment
*/
virtual void initialize(const std::string &modname);
/**
* @brief de-register SQLHandler components from the
* BES environment
*/
virtual void terminate(const std::string &modname);
void dump(std::ostream &strm) const override;
};
#endif // I_SQLModule_H