xrootd
XrdFrcProxy.hh
Go to the documentation of this file.
00001 #ifndef __XRDFRCPROXY__
00002 #define __XRDFRCPROXY__
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                        X r d F r c P r o x y . h h                         */
00006 /*                                                                            */
00007 /* (c) 2010 by the Board of Trustees of the Leland Stanford, Jr., University  */
00008 /*                            All Rights Reserved                             */
00009 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
00010 /*              DE-AC02-76-SFO0515 with the Department of Energy              */
00011 /******************************************************************************/
00012 
00013 #include "XrdFrc/XrdFrcRequest.hh"
00014 
00015 class XrdFrcReqAgent;
00016 class XrdOucStream;
00017 class XrdSysLogger;
00018   
00019 class XrdFrcProxy
00020 {
00021 public:
00022 
00023 int   Add(char Opc, const char *Lfn, const char *Opq, const char *Usr,
00024                     const char *Rid, const char *Nop, const char *Pop,
00025           int Prty=1);
00026 
00027 int   Del(char Opc, const char *Rid);
00028 
00029 static const int opGet =  1;
00030 static const int opPut =  2;
00031 static const int opMig =  4;
00032 static const int opStg =  8;
00033 static const int opAll = 15;
00034 
00035 class Queues
00036       {friend class XrdFrcProxy;
00037        int   Offset;
00038        char  Prty;
00039        char  QList;
00040        char  QNow;
00041        char  Active;
00042        public:
00043        Queues(int opX) : Offset(0), Prty(0), QList(opX), QNow(0), Active(0) {}
00044       ~Queues() {}
00045       };
00046 
00047 int   List(Queues &State, char *Buff, int Bsz);
00048 
00049 int   List(int qType, int qPrty, XrdFrcRequest::Item *Items, int Num);
00050 
00051 int   Init(int opX, const char *aPath, int aMode, const char *qPath=0);
00052 
00053       XrdFrcProxy(XrdSysLogger *lP, const char *iName, int Debug=0);
00054      ~XrdFrcProxy() {}
00055 
00056 private:
00057 
00058 int Init2(const char *cfgFN);
00059 int qChk(XrdOucStream &cFile);
00060 
00061 struct o2qMap {const char *qName; int qType; int oType;};
00062 
00063 static o2qMap   oqMap[];
00064 static int      oqNum;
00065 
00066 XrdFrcReqAgent *Agent[XrdFrcRequest::numQ];
00067 const char     *insName;
00068 char           *intName;
00069 char           *QPath;
00070 };
00071 #endif