27#ifndef _bes_http_REMOTE_HTTP_RESOURCE_H_
28#define _bes_http_REMOTE_HTTP_RESOURCE_H_ 1
38#include <libdap/InternalErr.h>
39#include <libdap/RCReader.h>
43#include "RemoteResource.h"
57 friend class RemoteResourceTest;
60 std::shared_ptr<http::url> d_remoteResourceUrl;
75 std::string d_resourceCacheFileName;
81 std::vector<std::string> *d_response_headers;
84 std::map<std::string, std::string> *d_http_response_headers;
87 long long d_expires_interval;
95 void setType(
const std::vector<std::string> *resp_hdrs);
101 void writeResourceToFile(
int fd);
107 void ingest_http_headers_and_type();
119 void filter_retrieved_resource(
const std::map<std::string, std::string> &content_filters);
125 bool cached_resource_is_expired();
130 void update_file_and_headers();
137 void update_file_and_headers(
const std::map<std::string, std::string> &content_filters);
142 void load_hdrs_from_file();
146 d_remoteResourceUrl(), d_fd(0), d_initialized(
false), d_resourceCacheFileName(
""),
147 d_response_headers(0), d_http_response_headers(0), d_expires_interval(HttpCache::getCacheExpiresTime()) {
154 RemoteResource(std::shared_ptr<http::url> target_url,
const std::string &uid =
"",
long long expires_interval = HttpCache::getCacheExpiresTime());
159 void retrieveResource(
const std::map<std::string, std::string> &content_filters);
std::string get_response_as_string()
std::string getCacheFileName()
std::string get_http_response_header(const std::string header_name)
std::vector< std::string > * getResponseHeaders()
rapidjson::Document get_as_json()
get_as_json() This function returns the cached resource parsed into a JSON document.
virtual ~RemoteResource()
utility class for the HTTP catalog module