xrootd
Loading...
Searching...
No Matches
XrdSsiProvider.hh
Go to the documentation of this file.
1#ifndef __XRDSSIPROVIDER_HH__
2#define __XRDSSIPROVIDER_HH__
3/******************************************************************************/
4/* */
5/* X r d S s i P r o v i d e r . h h */
6/* */
7/* (c) 2015 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* Produced by Andrew Hanushevsky for Stanford University under contract */
9/* DE-AC02-76-SFO0515 with the Department of Energy */
10/* */
11/* This file is part of the XRootD software suite. */
12/* */
13/* XRootD is free software: you can redistribute it and/or modify it under */
14/* the terms of the GNU Lesser General Public License as published by the */
15/* Free Software Foundation, either version 3 of the License, or (at your */
16/* option) any later version. */
17/* */
18/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
19/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
20/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
21/* License for more details. */
22/* */
23/* You should have received a copy of the GNU Lesser General Public License */
24/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
25/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
26/* */
27/* The copyright holder's institutional names and contributor's names may not */
28/* be used to endorse or promote products derived from this software without */
29/* specific prior written permission of the institution or contributor. */
30/******************************************************************************/
31
32//-----------------------------------------------------------------------------
77//-----------------------------------------------------------------------------
78
79#include <cerrno>
80
83
84class XrdSsiCluster;
85class XrdSsiLogger;
86class XrdSsiService;
87
89{
90public:
91
92//-----------------------------------------------------------------------------
103//-----------------------------------------------------------------------------
104
105enum CTL_Cmd {CTL_None = 0};
106
107virtual int Control(CTL_Cmd cmd, const void *argP, void *&resP)
108 {(void)cmd; (void)argP; (void)resP;
109 return (cmd == CTL_None ? 0 : -ENOTSUP);
110 }
111
112//-----------------------------------------------------------------------------
131//-----------------------------------------------------------------------------
132
133virtual
135 const std::string &contact,
136 int oHold=256
137 ) {eInfo.Set("Service not implemented!", ENOTSUP);
138 return 0;
139 }
140
141//-----------------------------------------------------------------------------
145//-----------------------------------------------------------------------------
146
147static const int SsiVersion = 0x00010000;
148
149 int GetVersion() {return SsiVersion;}
150
151//-----------------------------------------------------------------------------
170//-----------------------------------------------------------------------------
171
172virtual bool Init(XrdSsiLogger *logP,
173 XrdSsiCluster *clsP,
174 std::string cfgFn,
175 std::string parms,
176 int argc,
177 char **argv
178 ) = 0;
179
180//-----------------------------------------------------------------------------
201//-----------------------------------------------------------------------------
202
204
205virtual rStat QueryResource(const char *rName,
206 const char *contact=0
207 ) = 0;
208
209//-----------------------------------------------------------------------------
216//-----------------------------------------------------------------------------
217
218virtual void ResourceAdded(const char *rName) {}
219
220//-----------------------------------------------------------------------------
227//-----------------------------------------------------------------------------
228
229virtual void ResourceRemoved(const char *rName) {}
230
231//-----------------------------------------------------------------------------
237//-----------------------------------------------------------------------------
238
239virtual void SetCBThreads(int cbNum, int ntNum=0) {(void)cbNum; (void)ntNum;}
240
241//-----------------------------------------------------------------------------
252//-----------------------------------------------------------------------------
253
279virtual bool SetConfig(XrdSsiErrInfo &eInfo,
280 std::string &optname,
281 int optvalue)
282 {(void)optname; (void)optvalue; return 0;}
283
284//-----------------------------------------------------------------------------
299//-----------------------------------------------------------------------------
300
301virtual void SetSpread(short ssz) {(void)ssz;}
302
303//-----------------------------------------------------------------------------
308//-----------------------------------------------------------------------------
309
315 stream_T
316 };
317
318virtual void SetTimeout(tmoType what, int tmoval) {(void)what; (void)tmoval;}
319
320//-----------------------------------------------------------------------------
322//-----------------------------------------------------------------------------
323
325protected:
326
327//-----------------------------------------------------------------------------
329//-----------------------------------------------------------------------------
330
331virtual ~XrdSsiProvider() {}
332};
333#endif
Definition XrdSsiCluster.hh:41
Definition XrdSsiErrInfo.hh:41
void Set(const char *eMsg=0, int eNum=0, int eArg=0)
Definition XrdSsiErrInfo.hh:103
Definition XrdSsiLogger.hh:41
Definition XrdSsiProvider.hh:89
virtual void SetSpread(short ssz)
Definition XrdSsiProvider.hh:301
static const int SsiVersion
Definition XrdSsiProvider.hh:147
virtual void SetTimeout(tmoType what, int tmoval)
Definition XrdSsiProvider.hh:318
virtual int Control(CTL_Cmd cmd, const void *argP, void *&resP)
Definition XrdSsiProvider.hh:107
CTL_Cmd
Definition XrdSsiProvider.hh:105
@ CTL_None
Definition XrdSsiProvider.hh:105
virtual bool SetConfig(XrdSsiErrInfo &eInfo, std::string &optname, int optvalue)
Definition XrdSsiProvider.hh:279
virtual rStat QueryResource(const char *rName, const char *contact=0)=0
virtual void ResourceAdded(const char *rName)
Definition XrdSsiProvider.hh:218
virtual void SetCBThreads(int cbNum, int ntNum=0)
Definition XrdSsiProvider.hh:239
tmoType
Definition XrdSsiProvider.hh:310
@ idleClose
Time before an idle socket is closed (client)
Definition XrdSsiProvider.hh:312
@ stream_T
Time to wait for socket activity (Client)
Definition XrdSsiProvider.hh:315
@ connect_T
Time to wait for a connection (client)
Definition XrdSsiProvider.hh:311
@ request_T
Time to wait for a request to finsish(client)
Definition XrdSsiProvider.hh:313
@ response_T
Time for client to wait for a resp (Server)
Definition XrdSsiProvider.hh:314
@ connect_N
Number of times to try connection (client)
Definition XrdSsiProvider.hh:310
virtual ~XrdSsiProvider()
Destructor. The providor object cannot be and never is explicitly deleted.
Definition XrdSsiProvider.hh:331
rStat
Definition XrdSsiProvider.hh:203
@ notPresent
Definition XrdSsiProvider.hh:203
@ isPending
Definition XrdSsiProvider.hh:203
@ isPresent
Definition XrdSsiProvider.hh:203
int GetVersion()
Definition XrdSsiProvider.hh:149
virtual bool Init(XrdSsiLogger *logP, XrdSsiCluster *clsP, std::string cfgFn, std::string parms, int argc, char **argv)=0
virtual void ResourceRemoved(const char *rName)
Definition XrdSsiProvider.hh:229
XrdSsiProvider()
Constructor.
Definition XrdSsiProvider.hh:324
virtual XrdSsiService * GetService(XrdSsiErrInfo &eInfo, const std::string &contact, int oHold=256)
Definition XrdSsiProvider.hh:134
Definition XrdSsiService.hh:55