xrootd
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 <errno.h>
80
83
84class XrdSsiCluster;
85class XrdSsiLogger;
86class XrdSsiService;
87
89{
90public:
91
92//-----------------------------------------------------------------------------
108//-----------------------------------------------------------------------------
109
110virtual
112 const std::string &contact,
113 int oHold=256
114 ) {eInfo.Set("Service not implemented!", ENOTSUP);
115 return 0;
116 }
117
118//-----------------------------------------------------------------------------
122//-----------------------------------------------------------------------------
123
124static const int SsiVersion = 0x00010000;
125
126 int GetVersion() {return SsiVersion;}
127
128//-----------------------------------------------------------------------------
147//-----------------------------------------------------------------------------
148
149virtual bool Init(XrdSsiLogger *logP,
150 XrdSsiCluster *clsP,
151 std::string cfgFn,
152 std::string parms,
153 int argc,
154 char **argv
155 ) = 0;
156
157//-----------------------------------------------------------------------------
178//-----------------------------------------------------------------------------
179
181
182virtual rStat QueryResource(const char *rName,
183 const char *contact=0
184 ) = 0;
185
186//-----------------------------------------------------------------------------
193//-----------------------------------------------------------------------------
194
195virtual void ResourceAdded(const char *rName) {}
196
197//-----------------------------------------------------------------------------
204//-----------------------------------------------------------------------------
205
206virtual void ResourceRemoved(const char *rName) {}
207
208//-----------------------------------------------------------------------------
221//-----------------------------------------------------------------------------
222
223virtual void SetCBThreads(int cbNum, int ntNum=0) {(void)cbNum; (void)ntNum;}
224
225//-----------------------------------------------------------------------------
230//-----------------------------------------------------------------------------
231
237 stream_T
238 };
239
240virtual void SetTimeout(tmoType what, int tmoval) {(void)what; (void)tmoval;}
241
242//-----------------------------------------------------------------------------
244//-----------------------------------------------------------------------------
245
247protected:
248
249//-----------------------------------------------------------------------------
251//-----------------------------------------------------------------------------
252
253virtual ~XrdSsiProvider() {}
254};
255#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
static const int SsiVersion
Definition: XrdSsiProvider.hh:124
virtual void SetTimeout(tmoType what, int tmoval)
Definition: XrdSsiProvider.hh:240
virtual rStat QueryResource(const char *rName, const char *contact=0)=0
virtual void ResourceAdded(const char *rName)
Definition: XrdSsiProvider.hh:195
virtual void SetCBThreads(int cbNum, int ntNum=0)
Definition: XrdSsiProvider.hh:223
tmoType
Definition: XrdSsiProvider.hh:232
@ idleClose
Time before an idle socket is closed (client)
Definition: XrdSsiProvider.hh:234
@ stream_T
Time to wait for socket activity (Client)
Definition: XrdSsiProvider.hh:237
@ connect_T
Time to wait for a connection (client)
Definition: XrdSsiProvider.hh:233
@ request_T
Time to wait for a request to finsish(client)
Definition: XrdSsiProvider.hh:235
@ response_T
Time for client to wait for a resp (Server)
Definition: XrdSsiProvider.hh:236
@ connect_N
Number of times to try connection (client)
Definition: XrdSsiProvider.hh:232
virtual ~XrdSsiProvider()
Destructor. The providor object cannot be and never is explicitly deleted.
Definition: XrdSsiProvider.hh:253
rStat
Definition: XrdSsiProvider.hh:180
@ notPresent
Definition: XrdSsiProvider.hh:180
@ isPending
Definition: XrdSsiProvider.hh:180
@ isPresent
Definition: XrdSsiProvider.hh:180
int GetVersion()
Definition: XrdSsiProvider.hh:126
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:206
XrdSsiProvider()
Constructor.
Definition: XrdSsiProvider.hh:246
virtual XrdSsiService * GetService(XrdSsiErrInfo &eInfo, const std::string &contact, int oHold=256)
Definition: XrdSsiProvider.hh:111
Definition: XrdSsiService.hh:55