xrootd
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
XrdSsiService Class Referenceabstract

#include <XrdSsiService.hh>

Inheritance diagram for XrdSsiService:
Inheritance graph
[legend]

Public Member Functions

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

Static Public Attributes

static const int SsiVersion = 0x00020000
 

Protected Member Functions

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

Constructor & Destructor Documentation

◆ XrdSsiService()

XrdSsiService::XrdSsiService ( )
inline

Constructor.

◆ ~XrdSsiService()

virtual XrdSsiService::~XrdSsiService ( )
inlineprotectedvirtual

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

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.

◆ GetVersion()

int XrdSsiService::GetVersion ( )
inline

References SsiVersion.

◆ Prepare()

virtual 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.

◆ 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.

◆ 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.

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.

Referenced by GetVersion().


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