ARC SDK
DataExternalHelper.h
1 // -*- indent-tabs-mode: nil -*-
2 
3 #ifndef __ARC_DATAEXTERNALHELPER_H__
4 #define __ARC_DATAEXTERNALHELPER_H__
5 
6 #include <istream>
7 #include <ostream>
8 
9 #include <arc/URL.h>
10 #include <arc/data/DataPoint.h>
11 
12 namespace Arc {
14  private:
15  DataPoint* plugin;
16  PluginsFactory* plugins;
17  std::istream& instream;
18  std::ostream& outstream;
19  unsigned int threads;
20  unsigned long long int bufsize; // Size of each buffer
21  unsigned long long int range_start;
22  unsigned long long int range_end;
23  bool force_secure;
24  bool force_passive;
25  bool allow_out_of_order;
28  DataExternalHelper& operator=(DataExternalHelper const&);
29  void SetPluginAttributes();
30  public:
31  DataExternalHelper(char const * modulepath, char const * modulename, const URL& url, const UserConfig& usercfg, std::istream& instream, std::ostream& outstream);
32  virtual ~DataExternalHelper();
33  operator bool(void) const { return (plugin != NULL); };
34  bool operator!(void) const { return (plugin == NULL); };
35  void SetBufferSize(unsigned long long int size) { bufsize = size; };
36  void SetRange(unsigned long long int start, unsigned long long int end) { range_start = start; range_end = end; };
37  // void SetAllowOutOfOrder(bool out_of_order) { allow_out_of_order = out_of_order; };
38  void SetSecure(bool secure) { force_secure = secure; };
39  void SetPassive(bool passive) { force_passive = passive; };
40  void ReadOutOfOrder(bool out_of_order) { allow_out_of_order = out_of_order; }
41  DataStatus Rename(const URL& newurl);
44  DataStatus Check();
45  DataStatus Remove();
46  DataStatus CreateDirectory(bool with_parents=false);
47  DataStatus Read();
48  DataStatus Write();
49  DataStatus Transfer(const URL& otherendpoint, bool source, DataPoint::TransferCallback callback);
50  DataStatus Transfer3rdParty(const URL& source, const URL& destination, DataPoint::TransferCallback callback);
51 
52  static Logger logger;
53  };
54 }
55 
56 #endif // __ARC_DATAEXTERNALHELPER_H__
57 
Arc namespace contains all core ARC classes.
Definition: ArcConfig.h:11
User configuration class
Definition: UserConfig.h:196
Status code returned by many DataPoint methods.
Definition: DataStatus.h:54
A logger class.
Definition: Logger.h:493
A DataPoint represents a data resource and is an abstraction of a URL.
Definition: DataPoint.h:121
Class to represent general URLs.
Definition: URL.h:88
DataPointInfoType
Describes type of information about URL to request.
Definition: DataPoint.h:150
void(* TransferCallback)(unsigned long long int bytes_transferred)
Callback for use in protocol-internal or 3rd party transfers.
Definition: DataPoint.h:131
Definition: DataExternalHelper.h:13
All the parameters.
Definition: DataPoint.h:160