25 #ifndef _bes_store_result_cache_h
26 #define _bes_store_result_cache_h
30 #include <DapXmlNamespaces.h>
33 #include "BESFileLockingCache.h"
35 #undef DAP2_STORED_RESULTS
39 class ConstraintEvaluator;
54 static bool d_enabled;
56 static void delete_instance()
62 string d_storedResultsSubdir;
64 string d_resultFilePrefix;
65 unsigned long d_maxCacheSize;
72 bool is_valid(
const std::string &cache_file_name,
const std::string &dataset);
73 #ifdef DAP2_STORED_RESULTS
74 bool read_dap2_data_from_cache(
const string &cache_file_name, libdap::DDS *fdds);
76 bool read_dap4_data_from_cache(
const string &cache_file_name, libdap::DMR *dmr);
78 friend class StoredDap2ResultTest;
79 friend class StoredDap4ResultTest;
80 friend class ResponseBuilderTest;
82 string get_stored_result_local_id(
const string &dataset,
const string &ce, libdap::DAPVersion version);
84 string getBesDataRootDirFromConfig();
85 string getSubDirFromConfig();
86 string getResultPrefixFromConfig();
87 unsigned long getCacheSizeFromConfig();
92 unsigned long long size);
95 static const string SUBDIR_KEY;
96 static const string PREFIX_KEY;
97 static const string SIZE_KEY;
102 const string &stored_results_subdir,
const string &prefix,
unsigned long long size);
105 #ifdef DAP2_STORED_RESULTS
106 libdap::DDS *get_cached_dap2_data_ddx(
const std::string &cache_file_name, libdap::BaseTypeFactory *factory,
const std::string &dataset);
108 virtual string store_dap2_result(libdap::DDS &dds,
const std::string &constraint,
BESDapResponseBuilder *rb,
109 libdap::ConstraintEvaluator *eval);
112 libdap::DMR *
get_cached_dap4_data(
const string &cache_file_name, libdap::D4BaseTypeFactory *factory,
113 const string &filename);
119 #endif // _bes_store_result_cache_h