Back to index

nordugrid-arc-nox  1.1.0~rc6
DataPointSRM.h
Go to the documentation of this file.
00001 // -*- indent-tabs-mode: nil -*-
00002 
00003 #ifndef __ARC_DATAPOINTSRM_H__
00004 #define __ARC_DATAPOINTSRM_H__
00005 
00006 #include <list>
00007 
00008 #include <arc/Thread.h>
00009 #include <arc/data/DataPointDirect.h>
00010 #include <arc/data/DataHandle.h>
00011 
00012 #include "srmclient/SRMClient.h"
00013 
00014 namespace Arc {
00015 
00016   class DataPointSRM
00017     : public DataPointDirect {
00018   public:
00019     DataPointSRM(const URL& url, const UserConfig& usercfg);
00020     virtual ~DataPointSRM();
00021     static Plugin* Instance(PluginArgument *arg);
00022     virtual DataStatus StartReading(DataBuffer& buffer);
00023     virtual DataStatus StartWriting(DataBuffer& buffer,
00024                                     DataCallback *space_cb = NULL);
00025     virtual DataStatus StopReading();
00026     virtual DataStatus StopWriting();
00027     virtual DataStatus Check();
00028     virtual DataStatus Remove();
00029     virtual DataStatus ListFiles(std::list<FileInfo>& files,
00030                                  bool long_list = false,
00031                                  bool resolve = false,
00032                                  bool metadata = false);
00033     virtual const std::string DefaultCheckSum() const;
00034   private:
00035     SRMClientRequest *srm_request; /* holds SRM request ID between Start* and Stop* */
00036     static Logger logger;
00037     URL r_url;
00038     DataHandle *r_handle;  /* handle used for redirected operations */
00039     bool reading;
00040     bool writing;
00041     bool timeout; /* flag to say whether connection timed out */
00042   };
00043 
00044 } // namespace Arc
00045 
00046 #endif // __ARC_DATAPOINTSRM_H__