XrdSsiFileReq Class Reference

#include <XrdSsiFileReq.hh>

Inheritance diagram for XrdSsiFileReq:
Inheritance graph
[legend]
Collaboration diagram for XrdSsiFileReq:
Collaboration graph
[legend]

List of all members.

Public Types

enum  reqState {
  wtReq = 0, xqReq, wtRsp, doRsp,
  odRsp, erRsp, rsEnd
}
enum  rspState {
  isNew = 0, isBegun, isBound, isAbort,
  isDone, isMax
}

Public Member Functions

void Activate (XrdOucBuffer *oP, XrdSfsXioHandle *bR, int rSz)
void Alert (XrdSsiRespInfoMsg &aMsg)
 Send or receive a server generated alert.
void Finalize ()
void Finished (XrdSsiRequest &rqstR, const XrdSsiRespInfo &rInfo, bool cancel=false)
char * GetRequest (int &rLen)
bool ProcessResponse (const XrdSsiErrInfo &eInfo, const XrdSsiRespInfo &resp)
XrdSfsXferSize Read (bool &done, char *buffer, XrdSfsXferSize blen)
void RelRequestBuffer ()
int Send (XrdSfsDio *sfDio, XrdSfsXferSize size)
bool WantResponse (XrdOucErrInfo &eInfo)
void Done (int &Result, XrdOucErrInfo *cbInfo, const char *path=0)
int Same (unsigned long long arg1, unsigned long long arg2)
void DoIt ()
 XrdSsiFileReq (const char *cID=0)
virtual ~XrdSsiFileReq ()

Static Public Member Functions

static XrdSsiFileReq * Alloc (XrdOucErrInfo *eP, XrdSsiFileResource *rP, XrdSsiFileSess *fP, const char *sn, const char *id, unsigned int rnum)
static void SetMax (int mVal)

Private Member Functions

void BindDone ()
void Dispose ()
int Emsg (const char *pfx, int ecode, const char *op)
int Emsg (const char *pfx, XrdSsiErrInfo &eObj, const char *op)
void Init (const char *cID=0)
XrdSfsXferSize readStrmA (XrdSsiStream *strmP, char *buff, XrdSfsXferSize blen)
XrdSfsXferSize readStrmP (XrdSsiStream *strmP, char *buff, XrdSfsXferSize blen)
int sendStrmA (XrdSsiStream *strmP, XrdSfsDio *sfDio, XrdSfsXferSize blen)
void Recycle ()
void WakeUp (XrdSsiAlert *aP=0)

Private Attributes

XrdSsiMutex frqMutex
XrdSsiFileReq * nextReq
XrdSysSemaphore * finWait
XrdOucEICB * respCB
unsigned long long respCBarg
XrdSsiAlert * alrtSent
XrdSsiAlert * alrtPend
XrdSsiAlert * alrtLast
char * tident
const char * sessN
XrdOucErrInfo * cbInfo
XrdSsiFileResource * fileR
XrdSsiFileSess * fileP
char * respBuf
long long respOff
union {
   long long   fileSz
   int   respLen
}; 
XrdSfsXioHandle * sfsBref
XrdOucBuffer * oucBuff
XrdSsiStream::Buffer * strBuff
reqState myState
rspState urState
int reqSize
unsigned int reqID
bool haveResp
bool respWait
bool strmEOF
bool schedDone
bool isEnding
char rID [8]

Static Private Attributes

static XrdSysMutex aqMutex
static XrdSsiFileReq * freeReq
static int freeCnt
static int freeMax

Member Enumeration Documentation

Enumerator:
wtReq 
xqReq 
wtRsp 
doRsp 
odRsp 
erRsp 
rsEnd 
Enumerator:
isNew 
isBegun 
isBound 
isAbort 
isDone 
isMax 

Constructor & Destructor Documentation

XrdSsiFileReq::XrdSsiFileReq ( const char *  cID = 0  )  [inline]

References Init().

virtual XrdSsiFileReq::~XrdSsiFileReq (  )  [inline, virtual]

References tident.


Member Function Documentation

void XrdSsiFileReq::Activate ( XrdOucBuffer *  oP,
XrdSfsXioHandle *  bR,
int  rSz 
)
void XrdSsiFileReq::Alert ( XrdSsiRespInfoMsg &  aMsg  )  [virtual]

Send or receive a server generated alert.

The Alert() method is used server-side to send one or more alerts before a response is posted (alerts afterwards are ignored). To avoid race conditions, server-side alerts should be sent via the Responder's Alert() method. Clients must implement this method in order to receive alerts.

Parameters:
aMsg Reference to the message object containing the alert message. Non-positive alert lengths cause the alert call to be ignored. You should call the message RecycleMsg() method once you have consumed the message to release its resources.

Reimplemented from XrdSsiRequest.

static XrdSsiFileReq* XrdSsiFileReq::Alloc ( XrdOucErrInfo *  eP,
XrdSsiFileResource *  rP,
XrdSsiFileSess *  fP,
const char *  sn,
const char *  id,
unsigned int  rnum 
) [static]
void XrdSsiFileReq::BindDone (  )  [private, virtual]

Reimplemented from XrdSsiRequest.

void XrdSsiFileReq::Dispose (  )  [private, virtual]

Reimplemented from XrdSsiRequest.

void XrdSsiFileReq::DoIt (  )  [virtual]

Implements XrdJob.

void XrdSsiFileReq::Done ( int &  Result,
XrdOucErrInfo *  eInfo,
const char *  Path = 0 
) [virtual]

Invoke a callback after an operation completes.

Parameters:
Result - the original function's result (may be changed).
eInfo - Associated error information. The eInfo object may not be modified until it's own callback Done() method is called, if supplied. If the callback function in eInfo is zero, then the eInfo object is deleted by the invoked callback. Otherwise, that method must be invoked by this callback function after the actual callback message is sent. This allows the callback requestor to do post-processing and be asynchronous being assured that the callback completed.
Path - Optionally, the path related to thid request. It is used for tracing and detailed monitoring purposes.

Implements XrdOucEICB.

int XrdSsiFileReq::Emsg ( const char *  pfx,
XrdSsiErrInfo &  eObj,
const char *  op 
) [private]
int XrdSsiFileReq::Emsg ( const char *  pfx,
int  ecode,
const char *  op 
) [private]
void XrdSsiFileReq::Finalize (  ) 
void XrdSsiFileReq::Finished ( XrdSsiRequest &  rqstR,
const XrdSsiRespInfo &  rInfo,
bool  cancel = false 
) [inline]
char* XrdSsiFileReq::GetRequest ( int &  dlen  )  [virtual]

Obtain the request data sent by a client.

This method is duplicated in XrdSsiResponder to allow calling consistency.

Parameters:
dlen holds the length of the request after the call.
Returns:
=0 No request data available, dlen has been set to zero.
!0 Pointer to the buffer holding the request, dlen has the length

Implements XrdSsiRequest.

void XrdSsiFileReq::Init ( const char *  cID = 0  )  [private]

Referenced by XrdSsiFileReq().

bool XrdSsiFileReq::ProcessResponse ( const XrdSsiErrInfo &  eInfo,
const XrdSsiRespInfo &  rInfo 
) [virtual]

Notify request that a response is ready to be processed. This method must be supplied by the request object's implementation.

Parameters:
eInfo Error information. You can check if an error occurred using eInfo.hasError() or eInfo.isOK().
rInfo Raw response information.
Returns:
true Response processed.
false Response could not be processed, the request is not active.

Implements XrdSsiRequest.

XrdSfsXferSize XrdSsiFileReq::Read ( bool &  done,
char *  buffer,
XrdSfsXferSize  blen 
)
XrdSfsXferSize XrdSsiFileReq::readStrmA ( XrdSsiStream *  strmP,
char *  buff,
XrdSfsXferSize  blen 
) [private]
XrdSfsXferSize XrdSsiFileReq::readStrmP ( XrdSsiStream *  strmP,
char *  buff,
XrdSfsXferSize  blen 
) [private]
void XrdSsiFileReq::Recycle (  )  [private]
void XrdSsiFileReq::RelRequestBuffer (  )  [virtual]

Release the request buffer. Use this method to optimize storage use; this is especially relevant for long-running requests. If the request buffer has been consumed and is no longer needed, early return of the buffer will minimize memory usage. This method is also invoked via XrdSsiResponder.

Note: This method is called with the object's recursive mutex locked when it is invoked via XrdSsiResponder's ReleaseRequestBuffer().

Reimplemented from XrdSsiRequest.

int XrdSsiFileReq::Same ( unsigned long long  arg1,
unsigned long long  arg2 
) [inline, virtual]

Determine if two callback arguments refer to the same client.

Parameters:
arg1 - The first callback argument.
arg2 - The second callback argument.
Returns:
!0 - The arguments refer to the same client.
=0 - The arguments refer to the different clients.

Implements XrdOucEICB.

int XrdSsiFileReq::Send ( XrdSfsDio *  sfDio,
XrdSfsXferSize  size 
)
int XrdSsiFileReq::sendStrmA ( XrdSsiStream *  strmP,
XrdSfsDio *  sfDio,
XrdSfsXferSize  blen 
) [private]
static void XrdSsiFileReq::SetMax ( int  mVal  )  [inline, static]

References freeMax.

void XrdSsiFileReq::WakeUp ( XrdSsiAlert *  aP = 0  )  [private]
bool XrdSsiFileReq::WantResponse ( XrdOucErrInfo &  eInfo  ) 

Member Data Documentation

union { ... } [private]
int XrdSsiFileReq::freeCnt [static, private]
int XrdSsiFileReq::freeMax [static, private]

Referenced by SetMax().

bool XrdSsiFileReq::haveResp [private]
bool XrdSsiFileReq::isEnding [private]
unsigned int XrdSsiFileReq::reqID [private]

Reimplemented from XrdSsiRequest.

int XrdSsiFileReq::reqSize [private]
char* XrdSsiFileReq::respBuf [private]
unsigned long long XrdSsiFileReq::respCBarg [private]
long long XrdSsiFileReq::respOff [private]
bool XrdSsiFileReq::respWait [private]
char XrdSsiFileReq::rID[8] [private]
bool XrdSsiFileReq::schedDone [private]
const char* XrdSsiFileReq::sessN [private]
bool XrdSsiFileReq::strmEOF [private]
char* XrdSsiFileReq::tident [private]

Referenced by ~XrdSsiFileReq().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 16 Oct 2020 for xrootd by  doxygen 1.6.1