XRootD
XrdFrmXfrAgent Class Reference

#include <XrdFrmXfrAgent.hh>

+ Collaboration diagram for XrdFrmXfrAgent:

Public Member Functions

 XrdFrmXfrAgent ()
 
 ~XrdFrmXfrAgent ()
 

Static Public Member Functions

static void Process (XrdOucStream &Request)
 
static int Start ()
 

Detailed Description

Definition at line 38 of file XrdFrmXfrAgent.hh.

Constructor & Destructor Documentation

◆ XrdFrmXfrAgent()

XrdFrmXfrAgent::XrdFrmXfrAgent ( )
inline

Definition at line 46 of file XrdFrmXfrAgent.hh.

46 {}

◆ ~XrdFrmXfrAgent()

XrdFrmXfrAgent::~XrdFrmXfrAgent ( )
inline

Definition at line 47 of file XrdFrmXfrAgent.hh.

47 {}

Member Function Documentation

◆ Process()

void XrdFrmXfrAgent::Process ( XrdOucStream Request)
static

Definition at line 199 of file XrdFrmXfrAgent.cc.

200 {
201  char *tp;
202 
203 // Each frm request comes in as:
204 //
205 // Copy in: <[<traceid>] <reqid> <npath> <prty> <mode> <path> [. . .]
206 // Copy purge: =[<traceid>] <reqid> <npath> <prty> <mode> <path> [. . .]
207 // Copy out: >[<traceid>] <reqid> <npath> <prty> <mode> <path> [. . .]
208 // Migrate: &[<traceid>] <reqid> <npath> <prty> <mode> <path> [. . .]
209 // Migr+Purge: ^[<traceid>] <reqid> <npath> <prty> <mode> <path> [. . .]
210 // Stage: +[<traceid>] <reqid> <npath> <prty> <mode> <path> [. . .]
211 // Cancel in: - <requestid>
212 // Cancel out: ~ <requestid>
213 // List: ?[<][+][&][>]
214 // Wakeup: ![<][+][&][>]
215 //
216  if ((tp = Request.GetToken()))
217  switch(*tp)
218  {case '+': Add(Request, tp, StgAgent); break;
219  case '<': Add(Request, tp, GetAgent); break;
220  case '=':
221  case '>': Add(Request, tp, PutAgent); break;
222  case '&':
223  case '^': Add(Request, tp, MigAgent); break;
224  case '-': Del(Request, tp+1, StgAgent);
225  Del(Request, tp+1, GetAgent);
226  break;
227  case '~': Del(Request, tp+1, MigAgent);
228  Del(Request, tp+1, PutAgent);
229  break;
230  case '?': List(Request, tp+1); break;
231  case '!': GetAgent.Ping(tp); break;
232  default: Say.Emsg("Agent", "Invalid request, '", tp, "'.");
233  }
234 }
void Ping(const char *Msg=0)
char * GetToken(int lowcase=0)
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition: XrdSysError.cc:95
XrdSysError Say

References XrdSysError::Emsg(), XrdOucStream::GetToken(), XrdCl::List(), and XrdFrc::Say.

Referenced by XrdFrmXfrDaemon::Pong().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Start()

int XrdFrmXfrAgent::Start ( )
static

Definition at line 240 of file XrdFrmXfrAgent.cc.

241 {
242  EPNAME("Agent");
243  XrdOucStream Request;
244  char *tp;
245 
246 // Prepare our agents
247 //
248  if (!StgAgent.Start(Config.QPath, Config.AdminMode)
249  || !MigAgent.Start(Config.QPath, Config.AdminMode)
250  || !GetAgent.Start(Config.QPath, Config.AdminMode)
251  || !PutAgent.Start(Config.QPath, Config.AdminMode)) return 2;
252 
253 // Attach stdin to the Request stream
254 //
255  Request.Attach(STDIN_FILENO, 8*1024);
256 
257 // Process all input
258 //
259  while((tp = Request.GetLine()))
260  {DEBUG ("Request: '" <<tp <<"'");
261  Process(Request);
262  }
263 
264 // If we exit then we lost the connection
265 //
266  Say.Emsg("Agent", "Exiting; lost request connection!");
267  return 8;
268 }
#define DEBUG(x)
Definition: XrdBwmTrace.hh:54
#define EPNAME(x)
Definition: XrdBwmTrace.hh:56
int Start(char *aPath, int aMode)
static void Process(XrdOucStream &Request)
char * GetLine()
int Attach(int FileDescriptor, int bsz=2047)
XrdCmsConfig Config

References XrdOucStream::Attach(), XrdCms::Config, DEBUG, XrdSysError::Emsg(), EPNAME, XrdOucStream::GetLine(), and XrdFrc::Say.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: