XRootD
XrdSsiService Class Referenceabstract

#include <XrdSsiService.hh>

+ Inheritance diagram for XrdSsiService:
+ Collaboration diagram for XrdSsiService:

Public Member Functions

 XrdSsiService ()
 Constructor. More...
 
virtual bool Attach (XrdSsiErrInfo &eInfo, const std::string &handle, XrdSsiRequest &reqRef, XrdSsiResource *resP=0)
 Attach to a backgrounded request. More...
 
int GetVersion ()
 
virtual bool Prepare (XrdSsiErrInfo &eInfo, const XrdSsiResource &rDesc)
 Prepare for processing subsequent resource request. More...
 
virtual void ProcessRequest (XrdSsiRequest &reqRef, XrdSsiResource &resRef)=0
 Process a request; client-side or server-side. More...
 
virtual bool Stop (bool immed=false)
 Stop the client-side service. This is never called server-side. More...
 

Static Public Attributes

static const int SsiVersion = 0x00020000
 

Protected Member Functions

virtual ~XrdSsiService ()
 Destructor. The service object cannot be explicitly deleted. Use Stop(). More...
 

Detailed Description

Definition at line 54 of file XrdSsiService.hh.

Constructor & Destructor Documentation

◆ XrdSsiService()

XrdSsiService::XrdSsiService ( )
inline

Constructor.

Definition at line 181 of file XrdSsiService.hh.

181 {}

◆ ~XrdSsiService()

virtual XrdSsiService::~XrdSsiService ( )
inlineprotectedvirtual

Destructor. The service object cannot be explicitly deleted. Use Stop().

Definition at line 188 of file XrdSsiService.hh.

188 {}

Member Function Documentation

◆ Attach()

virtual bool XrdSsiService::Attach ( XrdSsiErrInfo eInfo,
const std::string &  handle,
XrdSsiRequest reqRef,
XrdSsiResource resP = 0 
)
inlinevirtual

Attach to a backgrounded request.

When a client calls Attach() the server-side Attach() is invoked to indicate that the backgrounded request is now a foreground request. Many times such notification is not needed so a default nil implementation is provided. Server-side Attach() calls are always passed the original request object reference so that it can pair up the request with the attach.

Parameters
eInfoReference to an error info object which will contain the error describing why the attach failed (i.e. return false).
handleReference to the handle provided to the callback method XrdSsiRequest::ProcessResponse() via isHandle response type. This is always an empty string on server-side calls.
reqRefReference to the request object that is to attach to the backgrounded request. It need not be the original request object (client-side) but it always is the original request object server-side.
resPA pointer to the resource object describing the request resources. This is meaningless for client calls and should not be specified. For server-side calls, it can be used to reauthorize the request since the client performing the attach may be different from the client that actually started the request.
Returns
true Continue normally, no issues detected. false An exception occurred, the eInfo object has the reason. For server side calls this provides the service the ability to reject request reattachment.

Definition at line 102 of file XrdSsiService.hh.

106  {return true;}

◆ GetVersion()

int XrdSsiService::GetVersion ( )
inline

Definition at line 66 of file XrdSsiService.hh.

66 {return SsiVersion;}
static const int SsiVersion

References SsiVersion.

◆ Prepare()

bool XrdSsiService::Prepare ( XrdSsiErrInfo eInfo,
const XrdSsiResource rDesc 
)
virtual

Prepare for processing subsequent resource request.

This method is meant to be used server-side to optimize subsequent request processing, perform authorization, and allow a service to stall or redirect requests. It is optional and a default implementation is provided that simply asks the provider if the resource exists on the server. Clients need not call or implement this method.

Parameters
eInfoThe object where error information is to be placed.
rDescReference to the resource object that describes the resource subsequent requests will use.
Returns
true Continue normally, no issues detected. false An exception occurred, the eInfo object has the reason.

Special notes for server-side processing:

1) Two special errors are recognized that allow for a client retry:

resP->eInfo.eNum = EAGAIN (client should retry elsewhere) resP->eInfo.eMsg = the host name where the client is redirected resP->eInfo.eArg = the port number to be used by the client

resP->eInfo.eNum = EBUSY (client should wait and then retry). resP->eInfo.eMsg = an optional reason for the wait. resP->eInfo.eArg = the number of seconds the client should wait.

Definition at line 46 of file XrdSsiService.cc.

47 {
48 // The default implementation simply asks the proviuder if the resource exists
49 //
51  && XrdSsi::Provider->QueryResource(rDesc.rName.c_str()) !=
52  XrdSsiProvider::notPresent) return true;
53 
54 // Indicate we do not have the resource
55 //
56  eInfo.Set("Resource not available.", ENOENT);
57  return false;
58 }
void Set(const char *eMsg=0, int eNum=0, int eArg=0)
std::string rName
-> Name of the resource to be used
XrdSsiProvider * Provider

References XrdSsiProvider::notPresent, XrdSsi::Provider, XrdSsiResource::rName, and XrdSsiErrInfo::Set().

Referenced by XrdSsiFileSess::open().

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

◆ ProcessRequest()

virtual void XrdSsiService::ProcessRequest ( XrdSsiRequest reqRef,
XrdSsiResource resRef 
)
pure virtual

Process a request; client-side or server-side.

When a client calls ProcessRequest() the same method is called server-side with the same parameters that the client specified except for timeOut which is always set to zero server-side.

Parameters
reqRefReference to the Request object that describes the request.
resRefReference to the Resource object that describes the resource that the request will be using.

All results are returned via the request object callback methods. For background queries, the XrdSsiRequest::ProcessResponse() is called with a response type of isHandle when the request is handed off to the endpoint for execution (see XrdSsiRequest::SetDetachTTL).

Implemented in XrdSsiServReal.

Referenced by XrdSsiFileReq::DoIt().

+ Here is the caller graph for this function:

◆ Stop()

virtual bool XrdSsiService::Stop ( bool  immed = false)
inlinevirtual

Stop the client-side service. This is never called server-side.

Parameters
immedWhen true, the service is only stopped if here are no active requests. Otherwise, after all requests have finished. the service object is deleted.
Returns
true Service has been stopped. Once all requests have been completed, the service object will be deleted.
false Service cannot be stopped because there are still active foreground requests and the immed parameter was true.

Reimplemented in XrdSsiServReal.

Definition at line 175 of file XrdSsiService.hh.

175 {return !immed;}

Member Data Documentation

◆ SsiVersion

const int XrdSsiService::SsiVersion = 0x00020000
static

Obtain the version of the abstract class used by underlying implementation. The version returned must match the version compiled in the loading library. If it does not, initialization fails.

Definition at line 64 of file XrdSsiService.hh.

Referenced by GetVersion().


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