OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
DapModule.cc
Go to the documentation of this file.
1
// DapModule.cc
2
3
#include <iostream>
4
5
using
std::endl ;
6
7
#include "
DapModule.h
"
8
#include "
DapRequestHandler.h
"
9
#include "
DapResponseNames.h
"
10
11
#include <
BESRequestHandlerList.h
>
12
#include <
BESDebug.h
>
13
#include <
BESResponseHandlerList.h
>
14
#include <
BESResponseNames.h
>
15
#include <
BESContainerStorageList.h
>
16
#include <
BESContainerStorageCatalog.h
>
17
#include <
BESCatalogDirectory.h
>
18
#include <
BESCatalogList.h
>
19
20
#define DAP_CATALOG "catalog"
21
22
void
23
DapModule::initialize
(
const
string
&modname )
24
{
25
BESDEBUG
( modname,
"Initializing Dap Module "
26
<< modname << endl ) ;
27
28
BESDEBUG
( modname,
" adding dap request handler"
<< endl ) ;
29
BESRequestHandlerList::TheList
()->
add_handler
( modname,
new
DapRequestHandler
( modname ) ) ;
30
31
BESDEBUG
(
"nc"
,
" adding "
<<
DAP_CATALOG
<<
" catalog"
<< endl ) ;
32
if
( !
BESCatalogList::TheCatalogList
()->ref_catalog(
DAP_CATALOG
) )
33
{
34
BESCatalogList::TheCatalogList
()->
35
add_catalog(
new
BESCatalogDirectory
(
DAP_CATALOG
) ) ;
36
}
37
else
38
{
39
BESDEBUG
(
"nc"
,
" catalog already exists, skipping"
<< endl ) ;
40
}
41
42
BESDEBUG
(
"nc"
,
" adding catalog container storage "
<<
DAP_CATALOG
43
<< endl ) ;
44
if
( !
BESContainerStorageList::TheList
()->ref_persistence(
DAP_CATALOG
) )
45
{
46
BESContainerStorageCatalog
*csc =
47
new
BESContainerStorageCatalog
(
DAP_CATALOG
) ;
48
BESContainerStorageList::TheList
()->
add_persistence
( csc ) ;
49
}
50
else
51
{
52
BESDEBUG
(
"nc"
,
" storage already exists, skipping"
<< endl ) ;
53
}
54
55
BESDEBUG
( modname,
" adding Dap debug context"
<< endl ) ;
56
BESDebug::Register
( modname ) ;
57
58
BESDEBUG
( modname,
"Done Initializing Dap Module "
59
<< modname << endl ) ;
60
}
61
62
void
63
DapModule::terminate
(
const
string
&modname )
64
{
65
BESDEBUG
( modname,
"Cleaning Dap module "
<< modname << endl ) ;
66
67
BESRequestHandler
*rh = 0 ;
68
69
BESDEBUG
( modname,
" removing dap request handler"
<< endl ) ;
70
rh =
BESRequestHandlerList::TheList
()->
remove_handler
( modname ) ;
71
if
( rh )
delete
rh ; rh = 0 ;
72
73
BESDEBUG
(
"nc"
,
" removing catalog container storage"
74
<<
DAP_CATALOG
<< endl ) ;
75
BESContainerStorageList::TheList
()->
deref_persistence
(
DAP_CATALOG
) ;
76
77
BESDEBUG
(
"nc"
,
" removing "
<<
DAP_CATALOG
<<
" catalog"
<< endl ) ;
78
BESCatalogList::TheCatalogList
()->
deref_catalog
(
DAP_CATALOG
) ;
79
80
BESDEBUG
( modname,
"Done Cleaning Dap module "
81
<< modname << endl ) ;
82
}
83
84
extern
"C"
85
{
86
BESAbstractModule
*
maker
()
87
{
88
return
new
DapModule
;
89
}
90
}
91
92
void
93
DapModule::dump
( ostream &strm )
const
94
{
95
strm <<
BESIndent::LMarg
<<
"DapModule::dump - ("
96
<< (
void
*)
this
<<
")"
<< endl ;
97
}
98
dapreader
DapModule.cc
Generated by
1.8.4