Go to the documentation of this file.
19 #ifndef __XRD_CL_XROOTD_RESPONSES_HH__
20 #define __XRD_CL_XROOTD_RESPONSES_HH__
221 const std::string &message =
"" ):
229 const std::string &message =
"" ):
256 std::ostringstream o;
257 o <<
"[ERROR] Server responded with an error: [" <<
errNo <<
"] ";
359 StatInfo(
const std::string &
id, uint64_t size, uint32_t flags,
409 tm *t = gmtime( &modTime );
410 strftime( ts, 255,
"%F %T", t );
524 const std::string &name,
679 size_t pos = parent.find(
'?' );
680 pParent = pos == std::string::npos ? parent : parent.substr( 0, pos );
773 ChunkInfo( uint64_t off = 0, uint32_t len = 0,
void *buff = 0 ):
887 (void)status; (void)response;
892 #endif // __XRD_CL_XROOTD_RESPONSES_HH__
uint16_t code
Error type, or additional hints on what to do.
Definition: XrdClStatus.hh:137
Describe a data chunk for vector read.
Definition: XrdClXRootDResponses.hh:769
@ Read
read access is allowed
Definition: XrdClXRootDResponses.hh:56
@ IsManager
Manager.
Definition: XrdClXRootDResponses.hh:287
bool TestFlags(uint32_t flags) const
Test flags.
Definition: XrdClXRootDResponses.hh:389
uint64_t pFreeStaging
Definition: XrdClXRootDResponses.hh:503
uint32_t GetVersion() const
Get version info.
Definition: XrdClXRootDResponses.hh:303
Handle an async response.
Definition: XrdClXRootDResponses.hh:855
uint32_t GetSize() const
Get number of locations.
Definition: XrdClXRootDResponses.hh:146
uint64_t pSize
Definition: XrdClXRootDResponses.hh:425
StatInfoVFS()
Constructor.
uint64_t GetModTime() const
Get modification time (in seconds since epoch)
Definition: XrdClXRootDResponses.hh:397
void Add(ListEntry *entry)
Add an entry to the list - takes ownership.
Definition: XrdClXRootDResponses.hh:613
std::string pId
Definition: XrdClXRootDResponses.hh:424
bool ParseServerResponse(const char *data)
Parse server response and fill up the object.
LocationList pLocations
Definition: XrdClXRootDResponses.hh:206
uint64_t pModTime
Definition: XrdClXRootDResponses.hh:427
Buffer BinaryDataInfo
Binary buffer.
Definition: XrdClXRootDResponses.hh:274
#define kXR_isManager
Definition: XProtocol.hh:86
LocationList::iterator Iterator
Iterator over locations.
Definition: XrdClXRootDResponses.hh:131
virtual void HandleResponseWithHosts(XRootDStatus *status, AnyObject *response, HostList *hostList)
Definition: XrdClXRootDResponses.hh:868
#define access(a, b)
Definition: XrdPosix.hh:39
uint32_t protocol
Version of the protocol the host is speaking.
Definition: XrdClXRootDResponses.hh:844
bool ParseServerResponse(const std::string &hostId, const char *data, bool isDStat)
Parse chunked server response and fill up the object.
@ ManagerOnline
manager node where the file is online
Definition: XrdClXRootDResponses.hh:45
@ XBitSet
Executable/searchable bit set.
Definition: XrdClXRootDResponses.hh:340
std::string ToString() const
Create a string representation.
Path location info.
Definition: XrdClXRootDResponses.hh:38
virtual ~ResponseHandler()
Definition: XrdClXRootDResponses.hh:857
std::string pAddress
Definition: XrdClXRootDResponses.hh:118
LocationInfo()
Constructor.
VFS stat info.
Definition: XrdClXRootDResponses.hh:434
bool IsServer() const
Check whether the location is a server.
Definition: XrdClXRootDResponses.hh:104
ChunkList & GetChunks()
Get chunks.
Definition: XrdClXRootDResponses.hh:816
void SetErrorMessage(const std::string &message)
Set the error message.
Definition: XrdClXRootDResponses.hh:244
@ kXR_writable
Definition: XProtocol.hh:205
std::vector< ListEntry * > DirList
Directory listing.
Definition: XrdClXRootDResponses.hh:598
const std::string & GetHostAddress() const
Get host address.
Definition: XrdClXRootDResponses.hh:542
@ kXR_isDir
Definition: XProtocol.hh:201
~OpenInfo()
Destructor.
Definition: XrdClXRootDResponses.hh:730
@ kXR_other
Definition: XProtocol.hh:202
@ ServerOnline
server node where the file is online
Definition: XrdClXRootDResponses.hh:47
@ IsDir
This is a directory.
Definition: XrdClXRootDResponses.hh:341
Location.
Definition: XrdClXRootDResponses.hh:64
ConstIterator Begin() const
Get the location begin iterator.
Definition: XrdClXRootDResponses.hh:170
DirectoryList()
Constructor.
uint8_t GetUtilizationRW() const
Get percentage of the partition utilization represented by FreeRW.
Definition: XrdClXRootDResponses.hh:460
const StatInfo * GetStatInfo() const
Get the stat info.
Definition: XrdClXRootDResponses.hh:746
uint64_t GetSize() const
Get size (in bytes)
Definition: XrdClXRootDResponses.hh:373
bool ParseServerResponse(const char *data)
Parse server response and fill up the object.
static bool HasStatInfo(const char *data)
Returns true if data contain stat info.
uint64_t pSessionId
Definition: XrdClXRootDResponses.hh:761
virtual void HandleResponse(XRootDStatus *status, AnyObject *response)
Definition: XrdClXRootDResponses.hh:884
uint32_t pVersion
Definition: XrdClXRootDResponses.hh:325
ChunkInfo(uint64_t off=0, uint32_t len=0, void *buff=0)
Constructor.
Definition: XrdClXRootDResponses.hh:773
DirList pDirList
Definition: XrdClXRootDResponses.hh:704
@ Offline
File is not online (ie. on disk)
Definition: XrdClXRootDResponses.hh:343
OpenInfo(const uint8_t *fileHandle, uint64_t sessionId, StatInfo *statInfo=0)
Constructor.
Definition: XrdClXRootDResponses.hh:719
void SetParentName(const std::string &parent)
Set name of the parent directory.
Definition: XrdClXRootDResponses.hh:677
@ ManagerPending
manager node where the file is pending to be online
Definition: XrdClXRootDResponses.hh:46
void Add(const Location &location)
Add a location.
Definition: XrdClXRootDResponses.hh:194
ConstIterator Begin() const
Get the begin iterator.
Definition: XrdClXRootDResponses.hh:637
StatInfo(const std::string &id, uint64_t size, uint32_t flags, uint64_t modTime)
Constructor.
#define kXR_isServer
Definition: XProtocol.hh:87
const StatInfo * GetStatInfo() const
Get the stat info object.
Definition: XrdClXRootDResponses.hh:566
ConstIterator End() const
Get the end iterator.
Definition: XrdClXRootDResponses.hh:653
uint32_t flags
Host type.
Definition: XrdClXRootDResponses.hh:843
AccessType pAccess
Definition: XrdClXRootDResponses.hh:120
Iterator Begin()
Get the location begin iterator.
Definition: XrdClXRootDResponses.hh:162
bool IsManager() const
Check whether the location is a manager.
Definition: XrdClXRootDResponses.hh:112
@ Other
Neither a file nor a directory.
Definition: XrdClXRootDResponses.hh:342
uint32_t errNo
Errno, if any.
Definition: XrdClStatus.hh:138
~DirectoryList()
Destructor.
HostInfo(const URL &u, bool lb=false)
Definition: XrdClXRootDResponses.hh:841
#define kXR_attrSuper
Definition: XProtocol.hh:90
bool ParseServerResponse(const char *data)
Parse server response and fill up the object.
Request status.
Definition: XrdClXRootDResponses.hh:213
Iterator End()
Get the end iterator.
Definition: XrdClXRootDResponses.hh:645
@ kXR_offline
Definition: XProtocol.hh:203
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:784
const std::string & GetParentName() const
Get parent directory name.
Definition: XrdClXRootDResponses.hh:669
uint32_t pFlags
Definition: XrdClXRootDResponses.hh:426
uint64_t pNodesRW
Definition: XrdClXRootDResponses.hh:499
@ ReadWrite
write access is allowed
Definition: XrdClXRootDResponses.hh:57
#define kXR_attrMeta
Definition: XProtocol.hh:88
const uint16_t errErrorResponse
Definition: XrdClStatus.hh:101
Protocol response.
Definition: XrdClXRootDResponses.hh:280
bool ProcessLocation(std::string &location)
const std::string & GetAddress() const
Get address.
Definition: XrdClXRootDResponses.hh:80
uint8_t GetUtilizationStaging() const
Get percentage of the partition utilization represented by FreeStaging.
Definition: XrdClXRootDResponses.hh:484
@ IsWritable
Write access is allowed.
Definition: XrdClXRootDResponses.hh:347
const ChunkList & GetChunks() const
Get chunks.
Definition: XrdClXRootDResponses.hh:824
Directory list.
Definition: XrdClXRootDResponses.hh:511
Flags
Flags.
Definition: XrdClXRootDResponses.hh:339
const std::string & GetName() const
Get file name.
Definition: XrdClXRootDResponses.hh:550
#define kXR_attrProxy
Definition: XProtocol.hh:89
ChunkList pChunks
Definition: XrdClXRootDResponses.hh:830
uint64_t pFreeRW
Definition: XrdClXRootDResponses.hh:500
XRootDStatus(const Status &st, const std::string &message="")
Constructor.
Definition: XrdClXRootDResponses.hh:228
const std::string GetId() const
Get id.
Definition: XrdClXRootDResponses.hh:365
@ IsReadable
Read access is allowed.
Definition: XrdClXRootDResponses.hh:346
uint8_t pFileHandle[4]
Definition: XrdClXRootDResponses.hh:760
ProtocolInfo(uint32_t version, uint32_t hostInfo)
Constructor.
Definition: XrdClXRootDResponses.hh:297
@ ServerPending
server node where the file is pending to be online
Definition: XrdClXRootDResponses.hh:48
LocationList::const_iterator ConstIterator
Iterator over locations.
Definition: XrdClXRootDResponses.hh:136
StatInfo * GetStatInfo()
Get the stat info object.
Definition: XrdClXRootDResponses.hh:558
uint64_t pNodesStaging
Definition: XrdClXRootDResponses.hh:502
uint32_t pUtilizationRW
Definition: XrdClXRootDResponses.hh:501
void GetFileHandle(uint8_t *fileHandle) const
Get the file handle (4bytes)
Definition: XrdClXRootDResponses.hh:738
XRootDStatus(uint16_t st=0, uint16_t code=0, uint32_t errN=0, const std::string &message="")
Constructor.
Definition: XrdClXRootDResponses.hh:218
DirList::iterator Iterator
Directory listing iterator.
Definition: XrdClXRootDResponses.hh:603
std::string pHostAddress
Definition: XrdClXRootDResponses.hh:580
uint32_t GetFlags() const
Get flags.
Definition: XrdClXRootDResponses.hh:381
DirList::const_iterator ConstIterator
Directory listing const iterator.
Definition: XrdClXRootDResponses.hh:608
uint32_t length
offset in the file
Definition: XrdClXRootDResponses.hh:777
HostInfo()
Definition: XrdClXRootDResponses.hh:839
@ AttrProxy
Proxy attribute.
Definition: XrdClXRootDResponses.hh:290
@ AttrMeta
Meta attribute.
Definition: XrdClXRootDResponses.hh:289
@ AttrSuper
Supervisor attribute.
Definition: XrdClXRootDResponses.hh:291
Location & At(uint32_t index)
Get the location at index.
Definition: XrdClXRootDResponses.hh:154
uint64_t GetFreeStaging() const
Get size of the largest contiguous area of free staging space (in MB)
Definition: XrdClXRootDResponses.hh:476
Directory entry.
Definition: XrdClXRootDResponses.hh:518
@ POSCPending
Definition: XrdClXRootDResponses.hh:344
AccessType
Describes the allowed access type for the file at given location.
Definition: XrdClXRootDResponses.hh:55
uint32_t pSize
Definition: XrdClXRootDResponses.hh:831
void SetStatInfo(StatInfo *info)
Set the stat info object (and transfer the ownership)
Definition: XrdClXRootDResponses.hh:574
@ kXR_xset
Definition: XProtocol.hh:200
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:846
Iterator Begin()
Get the begin iterator.
Definition: XrdClXRootDResponses.hh:629
ListEntry * At(uint32_t index)
Get an entry at given index.
Definition: XrdClXRootDResponses.hh:621
const std::string & GetErrorMessage() const
Get error message.
Definition: XrdClXRootDResponses.hh:236
void * buffer
length of the chunk
Definition: XrdClXRootDResponses.hh:778
uint64_t GetFreeRW() const
Get size of the largest contiguous area of free r/w space (in MB)
Definition: XrdClXRootDResponses.hh:452
std::vector< Location > LocationList
List of locations.
Definition: XrdClXRootDResponses.hh:126
Definition: XrdClAnyObject.hh:26
~ListEntry()
Destructor.
Definition: XrdClXRootDResponses.hh:534
uint64_t GetSessionId() const
Definition: XrdClXRootDResponses.hh:754
uint32_t GetHostInfo() const
Get host info.
Definition: XrdClXRootDResponses.hh:311
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:849
Vector read info.
Definition: XrdClXRootDResponses.hh:790
HostTypes
Types of XRootD servers.
Definition: XrdClXRootDResponses.hh:286
Location(const std::string &address, LocationType type, AccessType access)
Constructor.
Definition: XrdClXRootDResponses.hh:70
std::string ToStr() const
Convert to string.
Definition: XrdClXRootDResponses.hh:252
LocationType GetType() const
Get location type.
Definition: XrdClXRootDResponses.hh:88
VectorReadInfo()
Constructor.
Definition: XrdClXRootDResponses.hh:795
LocationType pType
Definition: XrdClXRootDResponses.hh:119
Iterator End()
Get the location end iterator.
Definition: XrdClXRootDResponses.hh:178
LocationType
Describes the node type and file status for a given location.
Definition: XrdClXRootDResponses.hh:44
std::string GetModTimeAsString() const
Get modification time.
Definition: XrdClXRootDResponses.hh:405
uint32_t pUtilizationStaging
Definition: XrdClXRootDResponses.hh:504
Object stat info.
Definition: XrdClXRootDResponses.hh:333
Definition: XrdClXRootDResponses.hh:838
void SetSize(uint32_t size)
Set size.
Definition: XrdClXRootDResponses.hh:808
Information returned by file open operation.
Definition: XrdClXRootDResponses.hh:714
uint64_t offset
Definition: XrdClXRootDResponses.hh:776
uint32_t GetSize() const
Get the size of the listing.
Definition: XrdClXRootDResponses.hh:661
@ kXR_readable
Definition: XProtocol.hh:204
uint64_t GetNodesStaging() const
Get number of nodes that can provide staging space.
Definition: XrdClXRootDResponses.hh:468
Procedure execution status.
Definition: XrdClStatus.hh:110
URL representation.
Definition: XrdClURL.hh:31
Binary blob representation.
Definition: XrdClBuffer.hh:34
std::string pName
Definition: XrdClXRootDResponses.hh:581
ListEntry(const std::string &hostAddress, const std::string &name, StatInfo *statInfo=0)
Constructor.
Definition: XrdClXRootDResponses.hh:523
@ kXR_poscpend
Definition: XProtocol.hh:206
bool ParseServerResponse(const std::string &hostId, const char *data)
Parse server response and fill up the object.
StatInfo * pStatInfo
Definition: XrdClXRootDResponses.hh:582
AccessType GetAccessType() const
Get access type.
Definition: XrdClXRootDResponses.hh:96
uint32_t pHostInfo
Definition: XrdClXRootDResponses.hh:326
StatInfo * pStatInfo
Definition: XrdClXRootDResponses.hh:762
Definition: XrdClAnyObject.hh:33
std::string pParent
Definition: XrdClXRootDResponses.hh:705
bool loadBalancer
Was the host used as a load balancer.
Definition: XrdClXRootDResponses.hh:845
ConstIterator End() const
Get the location end iterator.
Definition: XrdClXRootDResponses.hh:186
@ kXR_bkpexist
Definition: XProtocol.hh:207
static const std::string dStatPrefix
Definition: XrdClXRootDResponses.hh:707
bool TestHostInfo(uint32_t flags)
Test host info flags.
Definition: XrdClXRootDResponses.hh:319
uint32_t GetSize() const
Get Size.
Definition: XrdClXRootDResponses.hh:800
@ BackUpExists
Back up copy exists.
Definition: XrdClXRootDResponses.hh:348
uint64_t GetNodesRW() const
Get number of nodes that can provide read/write space.
Definition: XrdClXRootDResponses.hh:444
std::string pMessage
Definition: XrdClXRootDResponses.hh:268
@ IsServer
Data server.
Definition: XrdClXRootDResponses.hh:288