XRootD
XrdCl::AssignLastURLHandler Class Reference

Wrapper class used to assign last URL. More...

+ Inheritance diagram for XrdCl::AssignLastURLHandler:
+ Collaboration diagram for XrdCl::AssignLastURLHandler:

Public Member Functions

 AssignLastURLHandler (std::shared_ptr< FileSystemData > &fs, ResponseHandler *userHandler)
 
virtual ~AssignLastURLHandler ()
 
virtual void HandleResponseWithHosts (XRootDStatus *status, AnyObject *response, HostList *hostList)
 
- Public Member Functions inherited from XrdCl::ResponseHandler
virtual ~ResponseHandler ()
 
virtual void HandleResponse (XRootDStatus *status, AnyObject *response)
 

Additional Inherited Members

- Static Public Member Functions inherited from XrdCl::ResponseHandler
static ResponseHandlerWrap (std::function< void(XRootDStatus &, AnyObject &)> func)
 
static ResponseHandlerWrap (std::function< void(XRootDStatus *, AnyObject *)> func)
 

Detailed Description

Wrapper class used to assign last URL.

Definition at line 909 of file XrdClFileSystem.cc.

Constructor & Destructor Documentation

◆ AssignLastURLHandler()

XrdCl::AssignLastURLHandler::AssignLastURLHandler ( std::shared_ptr< FileSystemData > &  fs,
ResponseHandler userHandler 
)
inline

Definition at line 915 of file XrdClFileSystem.cc.

916  :
917  pFS(fs), pUserHandler(userHandler) {}

◆ ~AssignLastURLHandler()

virtual XrdCl::AssignLastURLHandler::~AssignLastURLHandler ( )
inlinevirtual

Definition at line 919 of file XrdClFileSystem.cc.

919 {}

Member Function Documentation

◆ HandleResponseWithHosts()

void XrdCl::AssignLastURLHandler::HandleResponseWithHosts ( XRootDStatus status,
AnyObject response,
HostList hostList 
)
virtual

Called when a response to associated request arrives or an error occurs

Parameters
statusstatus of the request
responsean object associated with the response (request dependent)
hostListlist of hosts the request was redirected to

Reimplemented from XrdCl::ResponseHandler.

Definition at line 1066 of file XrdClFileSystem.cc.

1069  {
1070  if( status->IsOK() && hostList )
1071  pFS->AssignLastURL( hostList->front().url );
1072 
1073  bool finalrsp = !( status->IsOK() && status->code == suContinue );
1074 
1075  SyncResponseHandler *syncHandler = dynamic_cast<SyncResponseHandler*>( pUserHandler );
1076  if( !syncHandler )
1077  pUserHandler->HandleResponseWithHosts( status, response, hostList );
1078 
1079  if( finalrsp )
1080  {
1081  if( syncHandler )
1082  pUserHandler->HandleResponseWithHosts( status, response, hostList );
1083  delete this;
1084  }
1085  }
virtual void HandleResponseWithHosts(XRootDStatus *status, AnyObject *response, HostList *hostList)
Synchronize the response.
const uint16_t suContinue
Definition: XrdClStatus.hh:39
uint16_t code
Error type, or additional hints on what to do.
Definition: XrdClStatus.hh:147
bool IsOK() const
We're fine.
Definition: XrdClStatus.hh:124

References XrdCl::Status::code, XrdCl::ResponseHandler::HandleResponseWithHosts(), XrdCl::Status::IsOK(), and XrdCl::suContinue.

+ Here is the call graph for this function:

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