bes  Updated for version 3.20.6
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 
39 class BESCatalogEntry;
40 class BESCatalogUtils;
41 
42 namespace bes {
43  class CatalogNode;
44 }
45 
46 
47 namespace cmr {
50 class CmrCatalog: public BESCatalog {
51 private:
52  std::vector<std::string> d_collections;
53  std::vector<std::string> d_facets;
54 
55 
56 public:
57  CmrCatalog(const std::string &name = CMR_CATALOG_NAME);
58  virtual ~CmrCatalog();
59 
63  virtual BESCatalogEntry * show_catalog(const std::string &container, BESCatalogEntry */*entry*/){
64  throw BESInternalError("The CMRCatalog::show_catalog() method is not supported. (container: '" + container + "')",__FILE__,__LINE__);
65  }
66 
70  virtual std::string get_root() const { return ""; }
71 
75  virtual void get_site_map(const std::string &/*prefix*/, const std::string &/*node_suffix*/, const std::string &/*leaf_suffix*/, std::ostream &/*out*/,
76  const std::string &/*path = "/"*/) const {
77  BESDEBUG(MODULE, "The CMRCatalog::get_site_map() method is not currently supported. SKIPPING. file: " << __FILE__ << " line: " << __LINE__ << std::endl);
78  // throw BESInternalError("The CMRCatalog::get_site_map() method is not currently supported.",__FILE__,__LINE__);
79  }
80 
81 
82  virtual bes::CatalogNode *get_node(const std::string &path) const;
83  virtual bes::CatalogNode *get_node_OLD(const std::string &path) const;
84  virtual bes::CatalogNode *get_node_NEW(const std::string &path) const;
85 
86 
87  virtual void dump(std::ostream &strm) const;
88 
89 };
90 } // namespace cmr
91 
92 #endif // I_CmrCatalog_h
93 
cmr::CmrCatalog
builds catalogs from a directory structure
Definition: CmrCatalog.h:50
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
cmr::CmrCatalog::dump
virtual void dump(std::ostream &strm) const
dumps information about this object
Definition: CmrCatalog.cc:579
cmr::CmrCatalog::show_catalog
virtual BESCatalogEntry * show_catalog(const std::string &container, BESCatalogEntry *)
Definition: CmrCatalog.h:63
cmr::CmrCatalog::get_site_map
virtual void get_site_map(const std::string &, const std::string &, const std::string &, std::ostream &, const std::string &) const
Definition: CmrCatalog.h:75
bes::CatalogNode
Definition: CatalogNode.h:45
BESInternalError
exception thrown if internal error encountered
Definition: BESInternalError.h:43
BESCatalogEntry
Definition: BESCatalogEntry.h:46
cmr::CmrCatalog::get_root
virtual std::string get_root() const
Definition: CmrCatalog.h:70
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