bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
GranuleUMM.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_UMM_H_
32#define MODULES_CMR_MODULE_GRANULE_UMM_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
55private:
56
57 std::string d_name;
58 std::string d_id;
59 std::string d_data_access_url;
60 std::string d_dap_service_url;
61 std::string d_metadata_access_url;
62 double d_size_orig{};
63 uint64_t d_size{};
64 std::string d_size_str;
65 std::string d_size_units_str;
66 std::string d_last_modified_time;
67 std::string d_description;
68
69 void setName(const nlohmann::json& granule_umm_json);
70 void setConceptId(const nlohmann::json& granule_umm_json);
71 void setDataGranuleUrl(const nlohmann::json& granule_umm_json);
72 void setDapServiceUrl(const nlohmann::json& granule_umm_json);
73 void setSize(const nlohmann::json& granule_umm_json);
74 void setLastModifiedStr(const nlohmann::json& granule_umm_json);
75 void setDescription(const nlohmann::json& granule_umm_json);
76
77
78public:
79 explicit GranuleUMM(const nlohmann::json& granule_umm_json);
80
81 std::string getName() const { return d_name; }
82 std::string getConceptId() const { return d_id; }
83 std::string getDataGranuleUrl() const { return d_data_access_url; }
84 std::string getDapServiceUrl() const { return d_dap_service_url; }
85 std::string getMetadataAccessUrl() const { return d_metadata_access_url; }
86 std::string getSizeStr() const { return d_size_str; }
87 std::string getLastModifiedStr() const { return d_last_modified_time; }
88 uint64_t getSize() const { return d_size; }
89
90 // For now we use getName() until a better option appears.
91 std::string getDescription() const { return getName(); }
92
93 bes::CatalogItem *getCatalogItem(const BESCatalogUtils *d_catalog_utils);
94};
95
96} // namespace cmr
97
98#endif /* MODULES_CMR_MODULE_GRANULE_UMM_H_ */
99
100
101
bes::CatalogItem * getCatalogItem(const BESCatalogUtils *d_catalog_utils)
GranuleUMM(const nlohmann::json &granule_umm_json)
Definition GranuleUMM.cc:60