xrootd
XrdCmsPrepare.hh
Go to the documentation of this file.
1 #ifndef __CMS_PREPARE__H
2 #define __CMS_PREPARE__H
3 /******************************************************************************/
4 /* */
5 /* X r d C m s P r e p a r e . h h */
6 /* */
7 /* (c) 2007 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Department of Energy */
11 /******************************************************************************/
12 
13 #include "Xrd/XrdJob.hh"
14 #include "Xrd/XrdScheduler.hh"
15 
16 #include "XrdCms/XrdCmsPrepArgs.hh"
17 #include "XrdOuc/XrdOucHash.hh"
18 #include "XrdOuc/XrdOucStream.hh"
19 #include "XrdSys/XrdSysPthread.hh"
20 
21 class XrdFrcProxy;
22 class XrdNetMsg;
23 class XrdOucMsubs;
24 class XrdOucName2Name;
25 
26 class XrdCmsPrepare : public XrdJob
27 {
28 public:
29 
30 int Add(XrdCmsPrepArgs &pargs);
31 
32 int Del(char *reqid);
33 
34 int Exists(char *path);
35 
36 void Gone(char *path);
37 
38 void DoIt();
39 
40 void Inform(const char *cmd, XrdCmsPrepArgs *pargs);
41 
42 int isOK() {return prepOK;}
43 
44 int Pending() {return NumFiles;}
45 
46 void Prepare(XrdCmsPrepArgs *pargs);
47 
48 void Reset(const char *iName, const char *aPath, int aMode);
49 
50 int setParms(int rcnt, int stime, int deco=0);
51 
52 int setParms(const char *ifpgm, char *ifmsg=0);
53 
54 int setParms(XrdOucName2Name *n2n) {N2N = n2n; return 0;}
55 
56  XrdCmsPrepare();
57  ~XrdCmsPrepare() {} // Never gets deleted
58 
59 private:
60 
61 int isOnline(char *path);
62 void Reset();
63 void Scrub();
64 int startIF();
65 
73 char *prepif;
74 time_t lastemsg;
75 pid_t preppid;
76 int prepOK;
78 int doEcho;
82 };
83 
84 namespace XrdCms
85 {
86 extern XrdCmsPrepare PrepQ;
87 }
88 #endif