bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
CmrCatalog.h
1// -*- mode: c++; c-basic-offset:4 -*-
2//
3// CMRCatalog.h
4//
5// This file is part of BES cmr_module
6//
7// Copyright (c) 2018 OPeNDAP, Inc.
8// Author: Nathan Potter <ndp@opendap.org>
9//
10// This library is free software; you can redistribute it and/or
11// modify it under the terms of the GNU Lesser General Public
12// License as published by the Free Software Foundation; either
13// version 2.1 of the License, or (at your option) any later version.
14//
15// This library is distributed in the hope that it will be useful,
16// but WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18// Lesser General Public License for more details.
19//
20// You should have received a copy of the GNU Lesser General Public
21// License along with this library; if not, write to the Free Software
22// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23//
24// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
25// Please read the full copyright statement in the file COPYRIGHT_URI.
26//
27
28#ifndef I_CmrCatalog_h
29#define I_CmrCatalog_h 1
30
31#include <list>
32#include <string>
33#include <vector>
34
35#include "BESCatalog.h"
36#include "BESInternalError.h"
37#include "CmrNames.h"
38
39class BESCatalogEntry;
40class BESCatalogUtils;
41
42namespace bes {
43 class CatalogNode;
44}
45
46
47namespace cmr {
50class CmrCatalog: public BESCatalog {
51private:
52 std::vector<std::string> d_collections;
53 std::vector<std::string> d_facets;
54
55 bes::CatalogNode *get_providers_node() const;
56 bes::CatalogNode *get_collections_node(const std::string &path, const std::string &provider_id) const;
57 bes::CatalogNode *get_facets_node(const std::string &path, const std::string &collection_id) const;
58 bes::CatalogNode *get_temporal_facet_nodes(const std::string &path,
59 const std::vector<std::string> &path_elements,
60 const std::string &collection_id) const;
61
62public:
63 explicit CmrCatalog(const std::string &name = CMR_CATALOG_NAME);
64 ~CmrCatalog() override = default;
65
66
70 BESCatalogEntry * show_catalog(const std::string &container, BESCatalogEntry */*entry*/) override {
71 throw BESInternalError("The CMRCatalog::show_catalog() method is not supported. (container: '" + container + "')",__FILE__,__LINE__);
72 }
73
77 std::string get_root() const override { return ""; }
78
82 void get_site_map(const std::string &/*prefix*/, const std::string &/*node_suffix*/, const std::string &/*leaf_suffix*/, std::ostream &/*out*/,
83 const std::string &/*path = "/"*/) const override {
84 BESDEBUG(MODULE, "The CMRCatalog::get_site_map() method is not currently supported. SKIPPING. file: " << __FILE__ << " line: " << __LINE__ << std::endl);
85 // throw BESInternalError("The CMRCatalog::get_site_map() method is not currently supported.",__FILE__,__LINE__);
86 }
87
88
89 bes::CatalogNode *get_node(const std::string &path) const override;
90
91 void dump(std::ostream &strm) const override;
92
93};
94} // namespace cmr
95
96#endif // I_CmrCatalog_h
97
exception thrown if internal error encountered
BESCatalogEntry * show_catalog(const std::string &container, BESCatalogEntry *) override
Definition CmrCatalog.h:70
bes::CatalogNode * get_node(const std::string &path) const override
CmrCatalog(const std::string &name=CMR_CATALOG_NAME)
A catalog based on NASA's CMR system.
Definition CmrCatalog.cc:87
void dump(std::ostream &strm) const override
dumps information about this object
std::string get_root() const override
Definition CmrCatalog.h:77
void get_site_map(const std::string &, const std::string &, const std::string &, std::ostream &, const std::string &) const override
Definition CmrCatalog.h:82