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 /* This file is part of the XRootD software suite. */
13 /* */
14 /* XRootD is free software: you can redistribute it and/or modify it under */
15 /* the terms of the GNU Lesser General Public License as published by the */
16 /* Free Software Foundation, either version 3 of the License, or (at your */
17 /* option) any later version. */
18 /* */
19 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22 /* License for more details. */
23 /* */
24 /* You should have received a copy of the GNU Lesser General Public License */
25 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27 /* */
28 /* The copyright holder's institutional names and contributor's names may not */
29 /* be used to endorse or promote products derived from this software without */
30 /* specific prior written permission of the institution or contributor. */
31 /******************************************************************************/
32 
33 #include "Xrd/XrdJob.hh"
34 #include "Xrd/XrdScheduler.hh"
35 
36 #include "XrdCms/XrdCmsPrepArgs.hh"
37 #include "XrdOuc/XrdOucHash.hh"
38 #include "XrdOuc/XrdOucStream.hh"
39 #include "XrdSys/XrdSysPthread.hh"
40 
41 class XrdFrcProxy;
42 class XrdNetMsg;
43 class XrdOucMsubs;
44 class XrdOucName2Name;
45 
46 class XrdCmsPrepare : public XrdJob
47 {
48 public:
49 
50 int Add(XrdCmsPrepArgs &pargs);
51 
52 int Del(char *reqid);
53 
54 int Exists(char *path);
55 
56 void Gone(char *path);
57 
58 void DoIt();
59 
60 void Init();
61 
62 void Inform(const char *cmd, XrdCmsPrepArgs *pargs);
63 
64 int isOK() {return prepOK;}
65 
66 int Pending() {return NumFiles;}
67 
68 void Prepare(XrdCmsPrepArgs *pargs);
69 
70 void Reset(const char *iName, const char *aPath, int aMode);
71 
72 int setParms(int rcnt, int stime, int deco=0);
73 
74 int setParms(const char *ifpgm, char *ifmsg=0);
75 
76 int setParms(XrdOucName2Name *n2n) {N2N = n2n; return 0;}
77 
79  ~XrdCmsPrepare() {} // Never gets deleted
80 
81 private:
82 
83 int isOnline(char *path);
84 void Reset();
85 void Scrub();
86 int startIF();
87 
95 char *prepif;
96 time_t lastemsg;
97 pid_t preppid;
98 int prepOK;
100 int doEcho;
104 };
105 
106 namespace XrdCms
107 {
108 extern XrdCmsPrepare PrepQ;
109 }
110 #endif
XrdCmsPrepare::XrdCmsPrepare
XrdCmsPrepare()
XrdCmsPrepare::scrubtime
int scrubtime
Definition: XrdCmsPrepare.hh:103
XrdCmsPrepArgs.hh
XrdSysMutex
Definition: XrdSysPthread.hh:165
XrdSysPthread.hh
XrdCmsPrepare::Inform
void Inform(const char *cmd, XrdCmsPrepArgs *pargs)
XrdCmsPrepare::Del
int Del(char *reqid)
XrdCmsPrepare::isOnline
int isOnline(char *path)
XrdOucMsubs
Definition: XrdOucMsubs.hh:91
XrdOucHash< char >
XrdCmsPrepare::Add
int Add(XrdCmsPrepArgs &pargs)
XrdCms::PrepQ
XrdCmsPrepare PrepQ
XrdCmsPrepare::preppid
pid_t preppid
Definition: XrdCmsPrepare.hh:97
XrdNetMsg
Definition: XrdNetMsg.hh:49
XrdOucStream
Definition: XrdOucStream.hh:47
XrdOucHash.hh
XrdCmsPrepare::Prepare
void Prepare(XrdCmsPrepArgs *pargs)
XrdCmsPrepare::NumFiles
int NumFiles
Definition: XrdCmsPrepare.hh:99
XrdFrcProxy
Definition: XrdFrcProxy.hh:40
XrdCms
Definition: YProtocol.hh:78
XrdCmsPrepare::PTMutex
XrdSysMutex PTMutex
Definition: XrdCmsPrepare.hh:88
XrdCmsPrepare::setParms
int setParms(int rcnt, int stime, int deco=0)
XrdCmsPrepare::Reset
void Reset(const char *iName, const char *aPath, int aMode)
XrdCmsPrepare::PTable
XrdOucHash< char > PTable
Definition: XrdCmsPrepare.hh:89
XrdCmsPrepare::Pending
int Pending()
Definition: XrdCmsPrepare.hh:66
XrdCmsPrepArgs
Definition: XrdCmsPrepArgs.hh:41
XrdJob
Definition: XrdJob.hh:43
XrdCmsPrepare::Init
void Init()
XrdCmsPrepare::prepSched
XrdOucStream prepSched
Definition: XrdCmsPrepare.hh:90
XrdCmsPrepare::resetcnt
int resetcnt
Definition: XrdCmsPrepare.hh:101
XrdScheduler.hh
XrdCmsPrepare::scrub2rst
int scrub2rst
Definition: XrdCmsPrepare.hh:102
XrdCmsPrepare
Definition: XrdCmsPrepare.hh:47
XrdCmsPrepare::setParms
int setParms(const char *ifpgm, char *ifmsg=0)
XrdCmsPrepare::Scrub
void Scrub()
XrdCmsPrepare::Reset
void Reset()
XrdCmsPrepare::setParms
int setParms(XrdOucName2Name *n2n)
Definition: XrdCmsPrepare.hh:76
XrdOucName2Name
Definition: XrdOucName2Name.hh:49
XrdCmsPrepare::PrepFrm
XrdFrcProxy * PrepFrm
Definition: XrdCmsPrepare.hh:94
XrdCmsPrepare::N2N
XrdOucName2Name * N2N
Definition: XrdCmsPrepare.hh:91
XrdCmsPrepare::isOK
int isOK()
Definition: XrdCmsPrepare.hh:64
XrdCmsPrepare::DoIt
void DoIt()
XrdCmsPrepare::prepOK
int prepOK
Definition: XrdCmsPrepare.hh:98
XrdJob.hh
XrdCmsPrepare::Relay
XrdNetMsg * Relay
Definition: XrdCmsPrepare.hh:93
XrdOucStream.hh
XrdCmsPrepare::prepif
char * prepif
Definition: XrdCmsPrepare.hh:95
XrdCmsPrepare::~XrdCmsPrepare
~XrdCmsPrepare()
Definition: XrdCmsPrepare.hh:79
XrdCmsPrepare::startIF
int startIF()
XrdCmsPrepare::Exists
int Exists(char *path)
XrdCmsPrepare::prepMsg
XrdOucMsubs * prepMsg
Definition: XrdCmsPrepare.hh:92
XrdCmsPrepare::Gone
void Gone(char *path)
XrdCmsPrepare::lastemsg
time_t lastemsg
Definition: XrdCmsPrepare.hh:96
XrdCmsPrepare::doEcho
int doEcho
Definition: XrdCmsPrepare.hh:100