bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
HttpdCatalog.h
1// HttpCatalog.h
2// -*- mode: c++; c-basic-offset:4 -*-
3//
4// This file is part of BES httpd_catalog_module
5//
6// Copyright (c) 2018 OPeNDAP, Inc.
7// Author: Nathan Potter <ndp@opendap.org>
8//
9// This library is free software; you can redistribute it and/or
10// modify it under the terms of the GNU Lesser General Public
11// License as published by the Free Software Foundation; either
12// version 2.1 of the License, or (at your option) any later version.
13//
14// This library is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17// Lesser General Public License for more details.
18//
19// You should have received a copy of the GNU Lesser General Public
20// License along with this library; if not, write to the Free Software
21// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22//
23// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
24// Please read the full copyright statement in the file COPYRIGHT_URI.
25//
26
27#ifndef _HttpdCatalog_h_
28#define _HttpdCatalog_h_ 1
29
30#include <list>
31#include <string>
32#include <map>
33
34#include "BESCatalog.h"
35#include "BESInternalError.h"
36#include "HttpdCatalogNames.h"
37
38class BESCatalogEntry;
39class BESCatalogUtils;
40
41namespace bes {
42 class CatalogNode;
43}
44
45namespace httpd_catalog {
46
50class HttpdCatalog: public BESCatalog {
51private:
52 std::map<std::string,std::string> d_httpd_catalogs;
53
54public:
55 HttpdCatalog(const std::string &catalog_name = HTTPD_CATALOG_NAME);
56
57 virtual ~HttpdCatalog() { }
58
62 virtual BESCatalogEntry * show_catalog(const std::string &container, BESCatalogEntry */*entry*/){
63 throw BESInternalError("The HttpdCatalog::show_catalog() method is not supported. (container: '" + container + "')",__FILE__,__LINE__);
64 }
65
69 virtual std::string get_root() const { return ""; }
70
74 virtual void get_site_map(
75 const std::string &/*prefix*/,
76 const std::string &/*node_suffix*/,
77 const std::string &/*leaf_suffix*/,
78 std::ostream &/*out*/,
79 const std::string &/*path = "/"*/) const {
80 BESDEBUG(MODULE, "The HttpdCatalog::get_site_map() method is not currently supported. SKIPPING. file: " << __FILE__ << " line: " << __LINE__ << std::endl);
81 }
82
83 virtual bes::CatalogNode *get_node(const std::string &path) const;
84
85 virtual std::string path_to_access_url(const std::string &path) const;
86
87 virtual void dump(std::ostream &strm) const;
88};
89
90} // namespace httpd_catalog
91
92#endif // _HttpdCatalog_h_
93
exception thrown if internal error encountered
virtual bes::CatalogNode * get_node(const std::string &path) const
Produces the bes::CatalogNode for the string ppath.
HttpdCatalog(const std::string &catalog_name=HTTPD_CATALOG_NAME)
A catalog based on scraping the directory pages produced by httpd .
virtual void get_site_map(const std::string &, const std::string &, const std::string &, std::ostream &, const std::string &) const
virtual BESCatalogEntry * show_catalog(const std::string &container, BESCatalogEntry *)
virtual std::string get_root() const
virtual void dump(std::ostream &strm) const
dumps information about this object
virtual std::string path_to_access_url(const std::string &path) const
Takes a path which begins with the name of an HttpdCatalog collection and returns the associated acce...