26 #ifndef _bes_store_result_cache_h
27 #define _bes_store_result_cache_h
31 #include <DapXmlNamespaces.h>
43 class ConstraintEvaluator;
57 static void delete_instance();
59 string d_storedResultsSubdir;
61 string d_resultFilePrefix;
62 unsigned long d_maxCacheSize;
68 bool is_valid(
const std::string &cache_file_name,
const std::string &dataset);
69 bool read_dap2_data_from_cache(
const string &cache_file_name, libdap::DDS *fdds);
70 bool read_dap4_data_from_cache(
const string &cache_file_name, libdap::DMR *dmr);
76 string get_stored_result_local_id(
const string &dataset,
const string &ce, libdap::DAPVersion version);
78 string getBesDataRootDirFromConfig();
79 string getSubDirFromConfig();
80 string getResultPrefixFromConfig();
81 unsigned long getCacheSizeFromConfig();
85 BESStoredDapResultCache(
const string &data_root_dir,
const string &stored_results_subdir,
const string &prefix,
unsigned long long size);
94 static string assemblePath(
const string &firstPart,
const string &secondPart,
bool addLeadingSlash =
false);
96 libdap::DDS *
get_cached_dap2_data_ddx(
const std::string &cache_file_name, libdap::BaseTypeFactory *factory,
const std::string &dataset);
97 libdap::DMR *
get_cached_dap4_data(
const string &cache_file_name, libdap::D4BaseTypeFactory *factory,
const string &filename);
103 libdap::ConstraintEvaluator *eval);
115 #endif // _bes_store_result_cache_h
static string assemblePath(const string &firstPart, const string &secondPart, bool addLeadingSlash=false)
virtual string get_cache_file_name(const string &src, bool mangle=false)
Build the name of file that will holds the uncompressed data from 'src' in the cache.
static const string SIZE_KEY
virtual string store_dap4_result(libdap::DMR &dmr, const string &constraint, BESDapResponseBuilder *rb)
libdap::DMR * get_cached_dap4_data(const string &cache_file_name, libdap::D4BaseTypeFactory *factory, const string &filename)
Read data from cache.
Implementation of a caching mechanism for compressed data.
static class NCMLUtil overview
virtual ~BESStoredDapResultCache()
friend class StoredDap2ResultTest
static BESStoredDapResultCache * get_instance()
Get the default instance of the BESStoredDapResultCache object.
libdap::DDS * get_cached_dap2_data_ddx(const std::string &cache_file_name, libdap::BaseTypeFactory *factory, const std::string &dataset)
Read data from cache.
static const string SUBDIR_KEY
friend class ResponseBuilderTest
static const string PREFIX_KEY
This class is used to build responses for/by the BES.
friend class StoredDap4ResultTest
This class is used to cache DAP2 response objects.
virtual string store_dap2_result(libdap::DDS &dds, const std::string &constraint, BESDapResponseBuilder *rb, libdap::ConstraintEvaluator *eval)