xrootd
XrdFrcProxy.hh
Go to the documentation of this file.
1 #ifndef __XRDFRCPROXY__
2 #define __XRDFRCPROXY__
3 /******************************************************************************/
4 /* */
5 /* X r d F r c P r o x y . h h */
6 /* */
7 /* (c) 2010 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 "XrdFrc/XrdFrcRequest.hh"
34 
35 class XrdFrcReqAgent;
36 class XrdOucStream;
37 class XrdSysLogger;
38 
40 {
41 public:
42 
43 int Add(char Opc, const char *Lfn, const char *Opq, const char *Usr,
44  const char *Rid, const char *Nop, const char *Pop,
45  int Prty=1);
46 
47 int Del(char Opc, const char *Rid);
48 
49 static const int opGet = 1;
50 static const int opPut = 2;
51 static const int opMig = 4;
52 static const int opStg = 8;
53 static const int opAll = 15;
54 
55 class Queues
56  {friend class XrdFrcProxy;
57  int Offset;
58  char Prty;
59  char QList;
60  char QNow;
61  char Active;
62  public:
63  Queues(int opX) : Offset(0), Prty(0), QList(opX), QNow(0), Active(0) {}
64  ~Queues() {}
65  };
66 
67 int List(Queues &State, char *Buff, int Bsz);
68 
69 int List(int qType, int qPrty, XrdFrcRequest::Item *Items, int Num);
70 
71 int Init(int opX, const char *aPath, int aMode, const char *qPath=0);
72 
73  XrdFrcProxy(XrdSysLogger *lP, const char *iName, int Debug=0);
75 
76 private:
77 
78 int Init2(const char *cfgFN);
79 int qChk(XrdOucStream &cFile);
80 
81 struct o2qMap {const char *qName; int qType; int oType;};
82 
83 static o2qMap oqMap[];
84 static int oqNum;
85 
87 const char *insName;
88 char *intName;
89 char *QPath;
90 };
91 #endif
XrdFrcReqAgent
Definition: XrdFrcReqAgent.hh:37
XrdFrcProxy::insName
const char * insName
Definition: XrdFrcProxy.hh:87
XrdFrcProxy::List
int List(int qType, int qPrty, XrdFrcRequest::Item *Items, int Num)
XrdFrcProxy::o2qMap::qName
const char * qName
Definition: XrdFrcProxy.hh:81
XrdFrcProxy::opGet
static const int opGet
Definition: XrdFrcProxy.hh:49
XrdFrcProxy::o2qMap::oType
int oType
Definition: XrdFrcProxy.hh:81
XrdFrcProxy::List
int List(Queues &State, char *Buff, int Bsz)
XrdFrcProxy::intName
char * intName
Definition: XrdFrcProxy.hh:88
XrdFrcProxy::Agent
XrdFrcReqAgent * Agent[XrdFrcRequest::numQ]
Definition: XrdFrcProxy.hh:86
XrdFrcProxy::Add
int Add(char Opc, const char *Lfn, const char *Opq, const char *Usr, const char *Rid, const char *Nop, const char *Pop, int Prty=1)
XrdFrcRequest::numQ
static const int numQ
Definition: XrdFrcRequest.hh:92
XrdFrcProxy::oqMap
static o2qMap oqMap[]
Definition: XrdFrcProxy.hh:83
Macaroons::Debug
@ Debug
Definition: XrdMacaroonsHandler.hh:17
XrdOucStream
Definition: XrdOucStream.hh:46
XrdFrcProxy::opPut
static const int opPut
Definition: XrdFrcProxy.hh:50
XrdFrcProxy::Queues::Prty
char Prty
Definition: XrdFrcProxy.hh:58
XrdFrcProxy::XrdFrcProxy
XrdFrcProxy(XrdSysLogger *lP, const char *iName, int Debug=0)
XrdFrcProxy::o2qMap
Definition: XrdFrcProxy.hh:81
XrdFrcProxy
Definition: XrdFrcProxy.hh:40
XrdFrcProxy::Del
int Del(char Opc, const char *Rid)
XrdFrcProxy::Queues::Queues
Queues(int opX)
Definition: XrdFrcProxy.hh:63
XrdFrcProxy::Queues::~Queues
~Queues()
Definition: XrdFrcProxy.hh:64
XrdFrcRequest::Item
Item
Definition: XrdFrcRequest.hh:82
XrdFrcProxy::QPath
char * QPath
Definition: XrdFrcProxy.hh:89
XrdFrcProxy::opMig
static const int opMig
Definition: XrdFrcProxy.hh:51
XrdSysLogger
Definition: XrdSysLogger.hh:53
XrdFrcProxy::Init
int Init(int opX, const char *aPath, int aMode, const char *qPath=0)
XrdFrcProxy::~XrdFrcProxy
~XrdFrcProxy()
Definition: XrdFrcProxy.hh:74
XrdFrcProxy::Queues::Offset
int Offset
Definition: XrdFrcProxy.hh:57
XrdFrcProxy::Queues::QList
char QList
Definition: XrdFrcProxy.hh:59
XrdFrcProxy::o2qMap::qType
int qType
Definition: XrdFrcProxy.hh:81
XrdFrcProxy::Queues
Definition: XrdFrcProxy.hh:56
XrdFrcProxy::opAll
static const int opAll
Definition: XrdFrcProxy.hh:53
XrdFrcProxy::Queues::QNow
char QNow
Definition: XrdFrcProxy.hh:60
XrdFrcProxy::opStg
static const int opStg
Definition: XrdFrcProxy.hh:52
XrdFrcRequest.hh
XrdFrcProxy::Init2
int Init2(const char *cfgFN)
XrdFrcProxy::Queues::Active
char Active
Definition: XrdFrcProxy.hh:61
XrdFrcProxy::oqNum
static int oqNum
Definition: XrdFrcProxy.hh:84
XrdFrcProxy::qChk
int qChk(XrdOucStream &cFile)