XRootD
Loading...
Searching...
No Matches
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
37#include "XrdOuc/XrdOucHash.hh"
40
41class XrdFrcProxy;
42class XrdNetMsg;
43class XrdOucMsubs;
44class XrdOucName2Name;
45
46class XrdCmsPrepare : public XrdJob
47{
48public:
49
50int Add(XrdCmsPrepArgs &pargs);
51
52int Del(char *reqid);
53
54int Exists(char *path);
55
56void Gone(char *path);
57
58void DoIt();
59
60void Init();
61
62void Inform(const char *cmd, XrdCmsPrepArgs *pargs);
63
64int isOK() {return prepOK;}
65
66int Pending() {return NumFiles;}
67
68void Prepare(XrdCmsPrepArgs *pargs);
69
70void Reset(const char *iName, const char *aPath, int aMode);
71
72int setParms(int rcnt, int stime, int deco=0);
73
74int setParms(const char *ifpgm, char *ifmsg=0);
75
76int setParms(XrdOucName2Name *n2n) {N2N = n2n; return 0;}
77
79 ~XrdCmsPrepare() {} // Never gets deleted
80
81private:
82
83int isOnline(char *path);
84void Reset();
85void Scrub();
86int startIF();
87
88XrdSysMutex PTMutex;
89XrdOucHash<char> PTable;
90XrdOucStream prepSched;
92XrdOucMsubs *prepMsg;
93XrdNetMsg *Relay;
94XrdFrcProxy *PrepFrm;
95char *prepif;
96time_t lastemsg;
97pid_t preppid;
98int prepOK;
99int NumFiles;
100int doEcho;
101int resetcnt;
102int scrub2rst;
103int scrubtime;
104};
105
106namespace XrdCms
107{
108extern XrdCmsPrepare PrepQ;
109}
110#endif
bool Exists
void Prepare(XrdCmsPrepArgs *pargs)
int setParms(XrdOucName2Name *n2n)
int setParms(int rcnt, int stime, int deco=0)
void Gone(char *path)
void Inform(const char *cmd, XrdCmsPrepArgs *pargs)
int Add(XrdCmsPrepArgs &pargs)
int Del(char *reqid)