bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
Granule.h
1// -*- mode: c++; c-basic-offset:4 -*-
2
3// This file is part of cmr_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) 2015 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 * Granule.h
27 *
28 * Created on: July, 14 2018
29 * Author: ndp
30 */
31#ifndef MODULES_CMR_MODULE_GRANULE_H_
32#define MODULES_CMR_MODULE_GRANULE_H_
33
34#include <string>
35#include <vector>
36#include "nlohmann/json.hpp"
37#include "CatalogItem.h"
38#include "BESCatalogUtils.h"
39
40
41namespace cmr {
42
43class Granule {
44private:
45
46 std::string d_name;
47 std::string d_id;
48 std::string d_data_access_url;
49 std::string d_dap_service_url;
50 std::string d_metadata_access_url;
51 std::string d_size_str;
52 std::string d_last_modified_time;
53
54 void setName(const nlohmann::json& jobj);
55 void setId(const nlohmann::json& go);
56 void setDataGranuleUrl(const nlohmann::json& go);
57 void setDapServiceUrl(const nlohmann::json& go);
58 void setMetadataAccessUrl(const nlohmann::json& granule_obj);
59 void setSize(const nlohmann::json& j_obj);
60 void setLastModifiedStr(const nlohmann::json& go);
61 const nlohmann::json& get_links_array(const nlohmann::json& go) const;
62
63public:
64 explicit Granule(const nlohmann::json& granule_json);
65
66 std::string getName() const { return d_name; }
67 std::string getId() const { return d_id; }
68 std::string getDataGranuleUrl() const { return d_data_access_url; }
69 std::string getDapServiceUrl() const { return d_dap_service_url; }
70 std::string getMetadataAccessUrl(){ return d_metadata_access_url; }
71 std::string getSizeStr() const { return d_size_str; }
72 std::string getLastModifiedStr() const { return d_last_modified_time; }
73 size_t getSize() const;
74
75 bes::CatalogItem *getCatalogItem(const BESCatalogUtils *d_catalog_utils) const ;
76};
77
78} // namespace cmr
79
80#endif /* MODULES_CMR_MODULE_GRANULE_H_ */
81
82
83
Granule(const nlohmann::json &granule_json)
Definition Granule.cc:145