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