00001 #ifndef DTRLIST_H_ 00002 #define DTRLIST_H_ 00003 00004 #include <arc/Thread.h> 00005 00006 #include "DTR.h" 00007 00008 namespace DataStaging { 00009 00011 00012 class DTRList { 00013 00014 private: 00015 00017 std::list<DTR_ptr> DTRs; 00018 00020 Arc::SimpleCondition Lock; 00021 00023 std::set<std::string> CachingSources; 00024 00026 Arc::SimpleCondition CachingLock; 00027 00028 public: 00029 00031 bool add_dtr(DTR_ptr DTRToAdd); 00032 00034 bool delete_dtr(DTR_ptr DTRToDelete); 00035 00038 bool filter_dtrs_by_owner(StagingProcesses OwnerToFilter, std::list<DTR_ptr>& FilteredList); 00039 00041 int number_of_dtrs_by_owner(StagingProcesses OwnerToFilter); 00042 00044 00049 bool filter_dtrs_by_status(DTRStatus::DTRStatusType StatusToFilter, std::list<DTR_ptr>& FilteredList); 00050 00053 bool filter_dtrs_by_statuses(const std::vector<DTRStatus::DTRStatusType>& StatusesToFilter, 00054 std::list<DTR_ptr>& FilteredList); 00055 00059 bool filter_dtrs_by_statuses(const std::vector<DTRStatus::DTRStatusType>& StatusesToFilter, 00060 std::map<DTRStatus::DTRStatusType, std::list<DTR_ptr> >& FilteredList); 00061 00063 00067 bool filter_dtrs_by_next_receiver(StagingProcesses NextReceiver, std::list<DTR_ptr>& FilteredList); 00068 00070 00074 bool filter_pending_dtrs(std::list<DTR_ptr>& FilteredList); 00075 00078 bool filter_dtrs_by_job(const std::string& jobid, std::list<DTR_ptr>& FilteredList); 00079 00081 void caching_started(DTR_ptr request); 00082 00084 void caching_finished(DTR_ptr request); 00085 00087 bool is_being_cached(DTR_ptr DTRToCheck); 00088 00090 bool empty(); 00091 00093 std::list<std::string> all_jobs(); 00094 00096 00099 void dumpState(const std::string& path); 00100 00101 }; 00102 00103 } // namespace DataStaging 00104 00105 #endif /*DTRLIST_H_*/