bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
S3Container.h
1// -*- mode: c++; c-basic-offset:4 -*-
2
3// This file is part of S3_module, A C++ module that can be loaded in to
4// the OPeNDAP Back-End Server (BES) and is able to handle remote requests.
5
6// Copyright (c) 2020 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
25
26#ifndef S3Container_h_
27#define S3Container_h_ 1
28
29#include <string>
30#include <ostream>
31#include <memory>
32
33#include "BESContainer.h"
34#include "RemoteResource.h"
35
36namespace s3 {
37
47
48class S3Container: public BESContainer {
49
50 std::shared_ptr<http::RemoteResource> d_dmrpp_rresource = nullptr;
51
52 void initialize();
53 void _duplicate(S3Container &copy_to);
54
55public:
56 S3Container() = default;
57 S3Container(const std::string &sym_name, const std::string &real_name, const std::string &type);
58
59 S3Container(const S3Container &copy_from) = delete;
60 S3Container& operator=(const S3Container& other) = delete;
61
62 ~S3Container() = default;
63
64 // These three methods are abstract in the BESContainer parent class. jhrg 10/18/22
65 BESContainer *ptr_duplicate() override;
66
67 void filter_response(const std::map<std::string, std::string, std::less<>> &content_filters) const;
68
69 std::string access() override;
70
71 bool release() override;
72
73 void dump(std::ostream &strm) const override;
74};
75
76} // namespace s3
77
78#endif // S3Container_h_
std::string access() override
access the remote target response by making the remote request
bool release() override
release the resources
BESContainer * ptr_duplicate() override
pure abstract method to duplicate this instances of BESContainer
void dump(std::ostream &strm) const override
dumps information about this object
void filter_response(const std::map< std::string, std::string, std::less<> > &content_filters) const
Filter the cached resource. Each key in content_filters is replaced with its associated map value.