XRootD
Loading...
Searching...
No Matches
XrdNetCmsNotify Class Reference

#include <XrdNetCmsNotify.hh>

+ Collaboration diagram for XrdNetCmsNotify:

Public Member Functions

 XrdNetCmsNotify (XrdSysError *erp, const char *aPath, const char *iName, int Opts=0)
 
 ~XrdNetCmsNotify ()
 
int Gone (const char *Path, int isPfn=1)
 
int Have (const char *Path, int isPfn=1)
 

Static Public Attributes

static const int isServ = 0x0001
 
static const int noPace = 0x0002
 

Detailed Description

Definition at line 36 of file XrdNetCmsNotify.hh.

Constructor & Destructor Documentation

◆ XrdNetCmsNotify()

XrdNetCmsNotify::XrdNetCmsNotify ( XrdSysError * erp,
const char * aPath,
const char * iName,
int Opts = 0 )

Definition at line 46 of file XrdNetCmsNotify.cc.

48{
49 char buff[1024], *p;
50
51// Make sure we are not getting anon as an instance name
52//
53 if (iName) iName = XrdOucUtils::InstName(iName,0);
54
55// Construct the path for notification
56//
57 p = XrdOucUtils::genPath(aPath, iName, ".olb");
58 strcpy(buff, p); strcat(buff, (Opts & isServ ? "olbd.notes":"olbd.seton"));
59 destPath = strdup(buff); free(p);
60
61// Construct message object
62//
63 xMsg = new XrdNetMsg(erp, destPath);
64
65// Complete initialization
66//
67 eDest= erp;
68 Pace = !(Opts & noPace);
69}
static const int isServ
static const int noPace
static char * genPath(const char *path, const char *inst, const char *psfx=0)
static const char * InstName(int TranOpt=0)

References XrdOucUtils::genPath(), XrdOucUtils::InstName(), isServ, and noPace.

+ Here is the call graph for this function:

◆ ~XrdNetCmsNotify()

XrdNetCmsNotify::~XrdNetCmsNotify ( )

Definition at line 75 of file XrdNetCmsNotify.cc.

76{
77 if (destPath) free(destPath);
78 if (xMsg) delete xMsg;
79}

Member Function Documentation

◆ Gone()

int XrdNetCmsNotify::Gone ( const char * Path,
int isPfn = 1 )

Definition at line 85 of file XrdNetCmsNotify.cc.

86{
87 static const int Cln = 6;
88 const char *Cmd = (isPfn ? "gone " : "rmdid ");
89 char theMsg[MAXPATHLEN+8];
90 int n;
91
92// Construct message to be sent
93//
94 if ((n = strlen(Path)) > MAXPATHLEN) return -ENAMETOOLONG;
95 strcpy(theMsg, Cmd); strcpy(theMsg+Cln, Path);
96 n += Cln; theMsg[n] = '\n';
97
98// Send the message
99//
100 return Send(theMsg, n);
101}
XrdOucString Path

References Path.

◆ Have()

int XrdNetCmsNotify::Have ( const char * Path,
int isPfn = 1 )

Definition at line 107 of file XrdNetCmsNotify.cc.

108{
109 static const int Cln = 6;
110 const char *Cmd = (isPfn ? "have " : "newfn ");
111 char theMsg[MAXPATHLEN+8];
112 int n;
113
114// Construct message to be sent
115//
116 if ((n = strlen(Path)) > MAXPATHLEN) return -ENAMETOOLONG;
117 strcpy(theMsg, Cmd); strcpy(theMsg+Cln, Path);
118 n += Cln; theMsg[n] = '\n';
119
120// Send the message
121//
122 return Send(theMsg, n);
123}

References Path.

Member Data Documentation

◆ isServ

const int XrdNetCmsNotify::isServ = 0x0001
static

Definition at line 44 of file XrdNetCmsNotify.hh.

Referenced by XrdNetCmsNotify().

◆ noPace

const int XrdNetCmsNotify::noPace = 0x0002
static

Definition at line 45 of file XrdNetCmsNotify.hh.

Referenced by XrdNetCmsNotify().


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