00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TXProofMgr
00013 #define ROOT_TXProofMgr
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef ROOT_TProofMgr
00028 #include "TProofMgr.h"
00029 #endif
00030 #ifndef ROOT_TUrl
00031 #include "TUrl.h"
00032 #endif
00033 #ifndef ROOT_TXHandler
00034 #include "TXHandler.h"
00035 #endif
00036
00037
00038
00039
00040
00041 const Int_t kXPROOF_Protocol = 1;
00042
00043 class TStopwatch;
00044 class TXSocket;
00045
00046 class TXProofMgr : public TProofMgr, public TXHandler {
00047
00048 private:
00049
00050 TXSocket *fSocket;
00051
00052 Int_t Init(Int_t loglevel = -1);
00053
00054 void CpProgress(const char *pfx, Long64_t bytes,
00055 Long64_t size, TStopwatch *watch, Bool_t cr = kFALSE);
00056 TObjString *Exec(Int_t action,
00057 const char *what, const char *how, const char *where);
00058
00059 public:
00060 TXProofMgr(const char *url, Int_t loglevel = -1, const char *alias = "");
00061 virtual ~TXProofMgr();
00062
00063 Bool_t HandleInput(const void *);
00064 Bool_t HandleError(const void *in = 0);
00065
00066 Bool_t IsValid() const { return fSocket; }
00067 void SetInvalid();
00068
00069 TProof *AttachSession(Int_t id, Bool_t gui = kFALSE)
00070 { return TProofMgr::AttachSession(id, gui); }
00071 TProof *AttachSession(TProofDesc *d, Bool_t gui = kFALSE);
00072 void DetachSession(Int_t, Option_t * = "");
00073 void DetachSession(TProof *, Option_t * = "");
00074 TProofLog *GetSessionLogs(Int_t ridx = 0, const char *stag = 0,
00075 const char *pattern = "-v \"| SvcMsg\"");
00076 Bool_t MatchUrl(const char *url);
00077 void ShowROOTVersions();
00078 TList *QuerySessions(Option_t *opt = "S");
00079 TObjString *ReadBuffer(const char *file, Long64_t ofs, Int_t len);
00080 TObjString *ReadBuffer(const char *file, const char *pattern);
00081 Int_t Reset(Bool_t hard = kFALSE, const char *usr = 0);
00082 Int_t SendMsgToUsers(const char *msg, const char *usr = 0);
00083 void SetROOTVersion(const char *tag);
00084 void ShowWorkers();
00085
00086
00087 Int_t Cp(const char *src, const char *dst = 0, const char *opts = 0);
00088 void Find(const char *what = "~/", const char *how = "-type f", const char *where = 0);
00089 void Grep(const char *what, const char *how = 0, const char *where = 0);
00090 void Ls(const char *what = "~/", const char *how = 0, const char *where = 0);
00091 void More(const char *what, const char *how = 0, const char *where = 0);
00092 Int_t Rm(const char *what, const char *how = 0, const char *where = 0);
00093 void Tail(const char *what, const char *how = 0, const char *where = 0);
00094 Int_t Md5sum(const char *what, TString &sum, const char *where = 0);
00095 Int_t Stat(const char *what, FileStat_t &st, const char *where = 0);
00096
00097 Int_t GetFile(const char *remote, const char *local, const char *opt = 0);
00098 Int_t PutFile(const char *local, const char *remote, const char *opt = 0);
00099
00100 ClassDef(TXProofMgr,0)
00101 };
00102
00103 #endif