10 #include <arc/DateTime.h> 
   11 #include <arc/Logger.h> 
   13 #include "FileCacheHash.h" 
   23     std::string cache_path;
 
   24     std::string cache_link_path;
 
   66     std::map <std::string, struct CacheParameters> _cache_map;
 
   69     std::vector<struct CacheParameters> _caches;
 
   72     std::vector<struct CacheParameters> _remote_caches;
 
   74     std::vector<struct CacheParameters> _draining_caches;
 
   77     std::set<std::string> _urls_unlocked;
 
   87     static const std::string CACHE_DATA_DIR;
 
   89     static const std::string CACHE_JOB_DIR;
 
   91     static const int CACHE_DIR_LENGTH;
 
   93     static const int CACHE_DIR_LEVELS;
 
   95     static const std::string CACHE_META_SUFFIX;
 
   97     static const int CACHE_DEFAULT_AUTH_VALIDITY;
 
  100     static const int CACHE_LOCK_TIMEOUT;
 
  102     static const int CACHE_META_LOCK_TIMEOUT;
 
  105     bool _init(
const std::vector<std::string>& caches,
 
  106                const std::vector<std::string>& remote_caches,
 
  107                const std::vector<std::string>& draining_caches,
 
  108                const std::string& 
id,
 
  114     bool _checkMetaFile(
const std::string& filename, 
const std::string& url, 
bool& is_locked);
 
  116     std::string _getMetaFileName(
const std::string& url);
 
  118     std::string _getHash(
const std::string& url) 
const;
 
  123     float _getCacheInfo(const std::string& path) const;
 
  125     bool _cleanFilesAndReturnFalse(const std::string& hard_link_file, bool& locked);
 
  146               const std::string& id,
 
  160     FileCache(const std::vector<std::string>& caches,
 
  161               const std::string& id,
 
  180     FileCache(const std::vector<std::string>& caches,
 
  181               const std::vector<std::string>& remote_caches,
 
  182               const std::vector<std::string>& draining_caches,
 
  183               const std::string& id,
 
  214     bool Start(
const std::string& url,
 
  217                bool use_remote = 
true,
 
  218                bool delete_first = 
false);
 
  234     bool Stop(
const std::string& url);
 
  255     std::string 
File(
const std::string& url);
 
  295     bool Link(
const std::string& link_path,
 
  296               const std::string& url,
 
  320     bool AddDN(
const std::string& url, 
const std::string& DN, 
const Time& expiry_time);
 
  330     bool CheckDN(
const std::string& url, 
const std::string& DN);
 
  376       return (!_caches.empty());
 
  389               const std::string& 
id,
 
  392     FileCache(
const std::vector<std::string>& caches,
 
  393               const std::string& 
id,
 
  396     FileCache(
const std::vector<std::string>& caches,
 
  397               const std::vector<std::string>& remote_caches,
 
  398               const std::vector<std::string>& draining_caches,
 
  399               const std::string& 
id,
 
  403               int cache_min=100) {}
 
  406     bool Start(
const std::string& url, 
bool& available, 
bool& is_locked, 
bool use_remote=
true, 
bool delete_first=
false) { 
return false; }
 
  407     bool Stop(
const std::string& url) { 
return false; }
 
  409     std::string 
File(
const std::string& url) { 
return url; }
 
  410     bool Link(
const std::string& link_path, 
const std::string& url, 
bool copy, 
bool executable, 
bool holding_lock, 
bool& try_again)  { 
return false; }
 
  411     bool Release()
 const { 
return false;}
 
  412     bool AddDN(
const std::string& url, 
const std::string& DN, 
const Time& expiry_time) { 
return false;}
 
  413     bool CheckDN(
const std::string& url, 
const std::string& DN) { 
return false; }
 
  414     bool CheckCreated(
const std::string& url){ 
return false; }
 
  415     Time 
GetCreated(
const std::string& url) { 
return Time(); }
 
  416     bool CheckValid(
const std::string& url) { 
return false; }
 
  417     Time 
GetValid(
const std::string& url)  { 
return Time(); }
 
  418     bool SetValid(
const std::string& url, 
const Time& val) { 
return false; }