bes  Updated for version 3.20.5
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 using std::list;
36 using std::string;
37 
38 #include "BESCatalog.h"
39 #include "BESInternalError.h"
40 #include "CmrNames.h"
41 
42 class BESCatalogEntry;
43 class BESCatalogUtils;
44 
45 namespace bes {
46  class CatalogNode;
47 }
48 
49 
50 namespace cmr {
53 class CmrCatalog: public BESCatalog {
54 private:
55  std::vector<std::string> d_collections;
56  std::vector<std::string> d_facets;
57 
58 
59 public:
60  CmrCatalog(const std::string &name = CMR_CATALOG_NAME);
61  virtual ~CmrCatalog();
62 
66  virtual BESCatalogEntry * show_catalog(const string &container, BESCatalogEntry */*entry*/){
67  throw BESInternalError("The CMRCatalog::show_catalog() method is not supported. (container: '" + container + "')",__FILE__,__LINE__);
68  }
69 
73  virtual std::string get_root() const { return ""; }
74 
78  virtual void get_site_map(const std::string &/*prefix*/, const std::string &/*node_suffix*/, const std::string &/*leaf_suffix*/, ostream &/*out*/,
79  const std::string &/*path = "/"*/) const {
80  BESDEBUG(MODULE, "The CMRCatalog::get_site_map() method is not currently supported. SKIPPING. file: " << __FILE__ << " line: " << __LINE__ << endl);
81  // throw BESInternalError("The CMRCatalog::get_site_map() method is not currently supported.",__FILE__,__LINE__);
82  }
83 
84 
85  virtual bes::CatalogNode *get_node(const std::string &path) const;
86  virtual bes::CatalogNode *get_node_OLD(const std::string &path) const;
87  virtual bes::CatalogNode *get_node_NEW(const std::string &path) const;
88 
89 
90  virtual void dump(ostream &strm) const;
91 
92 };
93 } // namespace cmr
94 
95 #endif // I_CmrCatalog_h
96 
cmr::CmrCatalog
builds catalogs from a directory structure
Definition: CmrCatalog.h:53
cmr::CmrCatalog::CmrCatalog
CmrCatalog(const std::string &name=CMR_CATALOG_NAME)
A catalog based on NASA's CMR system.
Definition: CmrCatalog.cc:85
BESCatalogUtils
Definition: BESCatalogUtils.h:61
bes::CatalogNode
Definition: CatalogNode.h:45
BESInternalError
exception thrown if inernal error encountered
Definition: BESInternalError.h:43
cmr::CmrCatalog::show_catalog
virtual BESCatalogEntry * show_catalog(const string &container, BESCatalogEntry *)
Definition: CmrCatalog.h:66
BESCatalogEntry
Definition: BESCatalogEntry.h:46
cmr::CmrCatalog::dump
virtual void dump(ostream &strm) const
dumps information about this object
Definition: CmrCatalog.cc:579
cmr::CmrCatalog::get_root
virtual std::string get_root() const
Definition: CmrCatalog.h:73
cmr::CmrCatalog::get_node_OLD
virtual bes::CatalogNode * get_node_OLD(const std::string &path) const
Get a CatalogNode for the given path in the current catalog.
Definition: CmrCatalog.cc:322
BESCatalog
Catalogs provide a hierarchical organization for data.
Definition: BESCatalog.h:51
cmr::CmrCatalog::get_site_map
virtual void get_site_map(const std::string &, const std::string &, const std::string &, ostream &, const std::string &) const
Definition: CmrCatalog.h:78