![]() |
XRootD
|
#include <XrdXrootdBridge.hh>
Public Member Functions | |
Result () | |
Constructor & Destructor. More... | |
virtual | ~Result () |
virtual bool | Data (Bridge::Context &info, const struct iovec *iovP, int iovN, int iovL, bool final)=0 |
virtual bool | Done (Bridge::Context &info)=0 |
the result context More... | |
virtual bool | Error (Bridge::Context &info, int ecode, const char *etext)=0 |
virtual int | File (Bridge::Context &info, int dlen)=0 |
virtual void | Free (Bridge::Context &info, char *buffP, int buffL) |
virtual bool | Redir (Bridge::Context &info, int port, const char *hname)=0 |
virtual bool | Wait (Bridge::Context &info, int wtime, const char *wtext) |
virtual Bridge::Result * | WaitResp (Bridge::Context &info, int wtime, const char *wtext) |
Handle xroot protocol execution results.
The Result object is an abstract class that defines the interface used by the xroot protocol stack to effect a client response using whatever alternate protocol is needed. You must define an implementation and pass it as an argument to the Login() Bridge method.
Definition at line 293 of file XrdXrootdBridge.hh.
|
inline |
|
inlinevirtual |
Definition at line 487 of file XrdXrootdBridge.hh.
|
pure virtual |
Effect a client data response.
The Data() method is called when Run() resulted in a successful data response. The method should rewrite the data and send it to the client using the associated XrdLink object. As an example, 1) Result::Data(info, iovP, iovN, iovL) is called. 2) Inspect iovP, rewrite the data. 3) Send the response: info->linkP->Send(new_iovP, new_iovN, new_iovL); 4) Handle send errors and cleanup(e.g. deallocate storage). 5) Return, the exchange is now complete.
info | the context associated with the result. |
iovP | a pointer to the iovec structure containing the xrootd data response about to be sent to the client. The request header is not included in the iovec structure. The elements of this structure must not be modified by the method. |
iovN | the number of elements in the iovec structure array. |
iovL | total number of data bytes that would be sent to the client. This is simply the sum of all the lengths in the iovec. |
final | True is this is the final result. Otherwise, this is a partial result (i.e. kXR_oksofar) and more data will result causing additional callbacks. For write requests, any supplied data buffer may now be reused or freed. |
info | the result context |
iovP | pointer to data array |
iovN | array count |
iovL | byte count |
final | true -> final result |
Implemented in XrdHttpReq.
Referenced by XrdXrootdTransit::Send().
|
pure virtual |
the result context
Effect a client acknowledgement.
The Done() method is called when Run() resulted in success and there is no associated data for the client (equivalent to a simple kXR_ok response).
info | the context associated with the result. |
Implemented in XrdHttpReq.
Referenced by XrdXrootdTransit::Send().
|
pure virtual |
Effect a client error response.
The Error() method is called when an error was encountered while processing the Run() request. The error should be reflected to the client.
info | the context associated with the result. |
ecode | the "kXR" error code describing the nature of the error. The code is in host byte format. |
etext | a null terminated string describing the error in human terms |
info | the result context |
ecode | the "kXR" error code |
etext | associated error message |
Implemented in XrdHttpReq.
Referenced by XrdXrootdTransit::Send().
|
pure virtual |
Notify callback that a sendfile() request is pending.
The File() method is called when Run() resulted in a sendfile response (i.e. sendfile() would have been used to send data to the client). This allows the callback to reframe the sendfile() data using the Send() method in the passed context object (see class Context above).
info | the context associated with the result. |
dlen | total number of data bytes that would be sent to the client. |
info | the result context |
dlen | byte count |
Implemented in XrdHttpReq.
Referenced by XrdXrootdTransit::Send().
|
inlinevirtual |
Notify callback that a write buffer is now available for reuse.
The Free() method is called when Run() was called to write data and a buffer was supplied. Normally, he buffer is pinned and cannot be reused until the write completes. This callback provides the notification that the buffer is no longer in use. The callback is invoked prior to any other callbacks and is only invoked if a buffer was supplied.
info | the context associated with this call. |
buffP | pointer to the buffer. |
buffL | the length originally supplied in the Run() call. |
info | the result context |
buffP | pointer to the buffer |
buffL | original length to Run() |
Definition at line 401 of file XrdXrootdBridge.hh.
Referenced by XrdXrootdTransit::Send().
|
pure virtual |
Redirect the client to another host:port.
The Redir() method is called when the client must be redirected to another host.
info | the context associated with the result. |
port | the port number in host byte format. |
hname | the DNS name of the host or IP address is IPV4 or IPV6 format (i.e. "n.n.n.n" or "[ipv6_addr]"). |
info | the result context |
port | the port number |
hname | the destination host |
Implemented in XrdHttpReq.
Referenced by XrdXrootdTransit::Send().
|
inlinevirtual |
Effect a client wait.
The Wait() method is called when Run() needs to delay a request. Normally, delays are internally handled. However, you can request that delays be reflected via a callback using the Bridge SetWait() method.
info | the context associated with the result. |
wtime | the number of seconds to delay the request. |
wtext | a null terminated string describing the wait in human terms |
info | the result context |
wtime | the wait time |
wtext | associated message |
Definition at line 444 of file XrdXrootdBridge.hh.
|
inlinevirtual |
Effect a client wait response (waitresp) NOT CURRENTLY IMPLEMENTED!
The WaitResp() method is called when an operation ended with a wait for response (waitresp) condition. The wait for response condition indicates that the actual response will be delivered at a later time. You can use context object to determine the operation being delayed. This callback provides you the opportunity to say how the waitresp is to be handled.
info | the context associated with the result. |
wtime | the number of seconds in which a response is expected. |
wtext | a null terminated string describing the delay in human terms |
info | the result context |
wtime | the wait time |
wtext | associated message |
Definition at line 473 of file XrdXrootdBridge.hh.