File indexing completed on 2025-01-18 10:12:04
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGrid
0013 #define ROOT_TGrid
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #include "TObject.h"
0032
0033 #include "TString.h"
0034
0035 #include "TGridJob.h"
0036
0037 class TGridResult;
0038 class TGridJDL;
0039 class TGridJob;
0040 class TGridCollection;
0041 class TGridJobStatusList;
0042
0043
0044 class TGrid : public TObject {
0045
0046 protected:
0047 TString fGridUrl;
0048 TString fGrid;
0049 TString fHost;
0050 TString fUser;
0051 TString fPw;
0052 TString fOptions;
0053 Int_t fPort;
0054
0055 public:
0056 TGrid() : fGridUrl(), fGrid(), fHost(), fUser(), fPw(), fOptions(), fPort(-1) {}
0057 virtual ~TGrid() {}
0058
0059 const char *GridUrl() const { return fGridUrl; }
0060 const char *GetGrid() const { return fGrid; }
0061 const char *GetHost() const { return fHost; }
0062 const char *GetUser() const { return fUser; }
0063 const char *GetPw() const { return fPw; }
0064 const char *GetOptions() const { return fOptions; }
0065 Int_t GetPort() const { return fPort; }
0066 virtual Bool_t IsConnected() const { return fPort == -1 ? kFALSE : kTRUE; }
0067
0068 virtual void Shell() { MayNotUse("Shell"); }
0069 virtual void Stdout() { MayNotUse("Stdout"); }
0070 virtual void Stderr() { MayNotUse("Stderr"); }
0071
0072 virtual TGridResult *Command(const char * ,
0073 Bool_t = kFALSE,
0074 UInt_t = 2)
0075 { MayNotUse("Command"); return nullptr; }
0076
0077 virtual TGridResult *Query(const char * , const char * ,
0078 const char * = "", const char * = "")
0079 { MayNotUse("Query"); return nullptr; }
0080
0081 virtual TGridResult *LocateSites() { MayNotUse("LocalSites"); return nullptr; }
0082
0083
0084 virtual TGridResult *Ls(const char* ="", Option_t* ="", Bool_t =kFALSE)
0085 { MayNotUse("Ls"); return nullptr; }
0086 virtual const char *Pwd(Bool_t =kFALSE)
0087 { MayNotUse("Pwd"); return nullptr; }
0088 virtual const char *GetHomeDirectory()
0089 { MayNotUse("GetHomeDirectory"); return nullptr; }
0090 virtual Bool_t Cd(const char* ="",Bool_t =kFALSE)
0091 { MayNotUse("Cd"); return kFALSE; }
0092 virtual Int_t Mkdir(const char* ="", Option_t* ="", Bool_t =kFALSE)
0093 { MayNotUse("Mkdir"); return kFALSE; }
0094 virtual Bool_t Rmdir(const char* ="", Option_t* ="", Bool_t =kFALSE)
0095 { MayNotUse("Mkdir"); return kFALSE; }
0096 virtual Bool_t Register(const char* , const char* , Long_t =-1, const char* =nullptr, const char* =nullptr, Bool_t =kFALSE)
0097 { MayNotUse("Mkdir"); return kFALSE; }
0098 virtual Bool_t Rm(const char* , Option_t* ="", Bool_t =kFALSE)
0099 { MayNotUse("Mkdir"); return kFALSE; }
0100
0101
0102 virtual TGridJob *Submit(const char * )
0103 { MayNotUse("Submit"); return nullptr; }
0104 virtual TGridJDL *GetJDLGenerator()
0105 { MayNotUse("GetJDLGenerator"); return nullptr; }
0106 virtual TGridCollection *OpenCollection(const char *, UInt_t = 1000000)
0107 { MayNotUse("OpenCollection"); return nullptr; }
0108 virtual TGridCollection *OpenCollectionQuery(TGridResult * ,Bool_t = kFALSE)
0109 { MayNotUse("OpenCollection"); return nullptr; }
0110 virtual TGridJobStatusList* Ps(const char* , Bool_t = kTRUE)
0111 { MayNotUse("Ps"); return nullptr; }
0112 virtual Bool_t KillById(TString )
0113 { MayNotUse("KillById"); return kFALSE; }
0114 virtual Bool_t ResubmitById(TString )
0115 { MayNotUse("ResubmitById"); return kFALSE; }
0116 virtual Bool_t Kill(TGridJob *gridjob)
0117 { return ((gridjob)?KillById(gridjob->GetJobID()):kFALSE); }
0118 virtual Bool_t Resubmit(TGridJob* gridjob)
0119 { return ((gridjob)?ResubmitById(gridjob->GetJobID()):kFALSE); }
0120
0121
0122 static TGrid *Connect(const char *grid, const char *uid = nullptr,
0123 const char *pw = nullptr, const char *options = nullptr);
0124
0125 ClassDefOverride(TGrid,0)
0126 };
0127
0128 R__EXTERN TGrid *gGrid;
0129
0130 #endif