25 #ifndef __XRD_CL_MESSAGE_UTILS_HH__
26 #define __XRD_CL_MESSAGE_UTILS_HH__
36 class LocalFileHandler;
96 while (pStatus == 0) {
183 resp->
Get( response );
184 resp->
Set( (
int *)0 );
197 template<
class Request>
200 uint32_t payloadSize = 0 )
202 msg =
new Message(
sizeof(Request) + payloadSize );
244 const std::string &newPath );
267 std::vector<char> &avec );
276 std::vector<char> &nvec );
287 const std::vector<T> &vec,
288 const std::string &path =
"" )
292 std::vector<char> xattrvec;
298 hdr->
dlen = path.size() + 1;
299 hdr->
dlen += xattrvec.size();
303 msg->
Append( path.c_str(), path.size() + 1, offset );
304 offset += path.size() + 1;
305 msg->
Append( xattrvec.data(), xattrvec.size(), offset );
void Set(Type object, bool own=true)
void Get(Type &object)
Retrieve the object being held.
const char * GetBuffer(uint32_t offset=0) const
Get the message buffer.
void Append(const char *buffer, uint32_t size)
Append data at the position pointed to by the append cursor.
static void MergeCGI(URL::ParamsMap &cgi1, const URL::ParamsMap &cgi2, bool replace)
Merge cgi2 into cgi1.
static Status CreateXAttrVec(const std::vector< xattr_t > &attrs, std::vector< char > &avec)
Create xattr vector.
static void ProcessSendParams(MessageSendParams &sendParams)
Process sending params.
static void RewriteCGIAndPath(Message *msg, const URL::ParamsMap &newCgi, bool replace, const std::string &newPath)
Append cgi to the one already present in the message.
static Status CreateXAttrBody(Message *msg, const std::vector< T > &vec, const std::string &path="")
static XrdCl::XRootDStatus WaitForResponse(SyncResponseHandler *handler, Type *&response)
Wait for the response.
static Status RedirectMessage(const URL &url, Message *msg, ResponseHandler *handler, MessageSendParams &sendParams, LocalFileHandler *lFileHandler)
Redirect message.
static XRootDStatus SendMessage(const URL &url, Message *msg, ResponseHandler *handler, MessageSendParams &sendParams, LocalFileHandler *lFileHandler)
Send message.
static void CreateRequest(Message *&msg, Request *&req, uint32_t payloadSize=0)
Create a message.
static XRootDStatus WaitForStatus(SyncResponseHandler *handler)
Wait and return the status of the query.
The message representation used throughout the system.
virtual void HandleResponseWithHosts(XrdCl::XRootDStatus *status, XrdCl::AnyObject *response, XrdCl::HostList *hostList)
Handle an async response.
Synchronize the response.
AnyObject * GetResponse()
Get the response.
virtual void HandleResponse(XRootDStatus *status, AnyObject *response)
Handle the response.
virtual ~SyncResponseHandler()
Destructor.
SyncResponseHandler()
Constructor.
XRootDStatus * GetStatus()
Get the status.
void WaitForResponse()
Wait for the arrival of the response.
std::map< std::string, std::string > ParamsMap
const uint16_t stError
An error occurred that could potentially be retried.
std::vector< HostInfo > HostList
const uint16_t errInternal
Internal error.
std::vector< ChunkInfo > ChunkList
List of chunks.
std::vector< uint32_t > crc32cDigests
XrdSys::KernelBuffer * kbuff
Procedure execution status.
bool IsOK() const
We're fine.