Go to the documentation of this file.
19 #ifndef __XRD_CL_XROOTD_RESPONSES_HH__
20 #define __XRD_CL_XROOTD_RESPONSES_HH__
223 const std::string &message =
"" ):
231 const std::string &message =
"" ):
258 std::ostringstream o;
259 o <<
"[ERROR] Server responded with an error: [" <<
errNo <<
"] ";
285 typedef std::tuple<std::string, std::string>
xattr_t;
422 StatInfo(
const std::string &
id, uint64_t size, uint32_t flags,
525 time_t modTime = time;
526 tm *t = gmtime( &modTime );
527 strftime( ts, 255,
"%F %T", t );
533 static const uint8_t r_mask = 0x4;
534 static const uint8_t w_mask = 0x2;
535 static const uint8_t x_mask = 0x1;
537 if( r_mask & oct ) str.push_back(
'r' );
538 else str.push_back(
'-' );
540 if( w_mask & oct ) str.push_back(
'w' );
541 else str.push_back(
'-' );
543 if( x_mask & oct ) str.push_back(
'x' );
544 else str.push_back(
'-' );
547 std::unique_ptr<StatInfoImpl>
pImpl;
644 const std::string &name,
799 size_t pos = parent.find(
'?' );
800 pParent = pos == std::string::npos ? parent : parent.substr( 0, pos );
893 ChunkInfo( uint64_t off = 0, uint32_t len = 0,
void *buff = 0 ):
1007 (void)status; (void)response;
1012 #endif // __XRD_CL_XROOTD_RESPONSES_HH__
uint16_t code
Error type, or additional hints on what to do.
Definition: XrdClStatus.hh:138
Describe a data chunk for vector read.
Definition: XrdClXRootDResponses.hh:889
@ Read
read access is allowed
Definition: XrdClXRootDResponses.hh:58
@ IsManager
Manager.
Definition: XrdClXRootDResponses.hh:345
bool TestFlags(uint32_t flags) const
Test flags.
uint64_t pFreeStaging
Definition: XrdClXRootDResponses.hh:623
Extended attribute operation status.
Definition: XrdClXRootDResponses.hh:291
const std::string & GetOwner() const
Get owner.
uint32_t GetVersion() const
Get version info.
Definition: XrdClXRootDResponses.hh:361
Handle an async response.
Definition: XrdClXRootDResponses.hh:975
uint32_t GetSize() const
Get number of locations.
Definition: XrdClXRootDResponses.hh:148
StatInfoVFS()
Constructor.
uint64_t GetModTime() const
Get modification time (in seconds since epoch)
void Add(ListEntry *entry)
Add an entry to the list - takes ownership.
Definition: XrdClXRootDResponses.hh:733
bool ParseServerResponse(const char *data)
Parse server response and fill up the object.
LocationList pLocations
Definition: XrdClXRootDResponses.hh:208
Buffer BinaryDataInfo
Binary buffer.
Definition: XrdClXRootDResponses.hh:332
StatInfo(const StatInfo &info)
Copy constructor.
#define kXR_isManager
Definition: XProtocol.hh:1055
XRootDStatus status
Definition: XrdClXRootDResponses.hh:302
static void OctToString(uint8_t oct, std::string &str)
Definition: XrdClXRootDResponses.hh:531
LocationList::iterator Iterator
Iterator over locations.
Definition: XrdClXRootDResponses.hh:133
virtual void HandleResponseWithHosts(XRootDStatus *status, AnyObject *response, HostList *hostList)
Definition: XrdClXRootDResponses.hh:988
#define access(a, b)
Definition: XrdPosix.hh:39
uint32_t protocol
Version of the protocol the host is speaking.
Definition: XrdClXRootDResponses.hh:964
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:47
@ XBitSet
Executable/searchable bit set.
Definition: XrdClXRootDResponses.hh:403
std::string ToString() const
Create a string representation.
Path location info.
Definition: XrdClXRootDResponses.hh:40
Extended attributes with status.
Definition: XrdClXRootDResponses.hh:309
virtual ~ResponseHandler()
Definition: XrdClXRootDResponses.hh:977
bool ExtendedFormat() const
Parse server response and fill up the object.
std::string pAddress
Definition: XrdClXRootDResponses.hh:120
LocationInfo()
Constructor.
VFS stat info.
Definition: XrdClXRootDResponses.hh:554
bool IsServer() const
Check whether the location is a server.
Definition: XrdClXRootDResponses.hh:106
ChunkList & GetChunks()
Get chunks.
Definition: XrdClXRootDResponses.hh:936
void SetErrorMessage(const std::string &message)
Set the error message.
Definition: XrdClXRootDResponses.hh:246
@ kXR_writable
Definition: XProtocol.hh:1117
std::vector< ListEntry * > DirList
Directory listing.
Definition: XrdClXRootDResponses.hh:718
const std::string & GetHostAddress() const
Get host address.
Definition: XrdClXRootDResponses.hh:662
@ kXR_isDir
Definition: XProtocol.hh:1113
~OpenInfo()
Destructor.
Definition: XrdClXRootDResponses.hh:850
XAttr(const std::string &name, const XRootDStatus &status)
Definition: XrdClXRootDResponses.hh:313
std::string value
Definition: XrdClXRootDResponses.hh:326
Handle the stateful operations.
Definition: XrdClFileStateHandler.hh:50
@ kXR_other
Definition: XProtocol.hh:1114
@ ServerOnline
server node where the file is online
Definition: XrdClXRootDResponses.hh:49
@ IsDir
This is a directory.
Definition: XrdClXRootDResponses.hh:404
Location.
Definition: XrdClXRootDResponses.hh:66
ConstIterator Begin() const
Get the location begin iterator.
Definition: XrdClXRootDResponses.hh:172
DirectoryList()
Constructor.
uint8_t GetUtilizationRW() const
Get percentage of the partition utilization represented by FreeRW.
Definition: XrdClXRootDResponses.hh:580
const std::string & GetModeAsString() const
Get mode.
const StatInfo * GetStatInfo() const
Get the stat info.
Definition: XrdClXRootDResponses.hh:866
uint64_t GetSize() const
Get size (in bytes)
const std::string & GetGroup() const
Get group.
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:881
virtual void HandleResponse(XRootDStatus *status, AnyObject *response)
Definition: XrdClXRootDResponses.hh:1004
uint32_t pVersion
Definition: XrdClXRootDResponses.hh:383
ChunkInfo(uint64_t off=0, uint32_t len=0, void *buff=0)
Constructor.
Definition: XrdClXRootDResponses.hh:893
DirList pDirList
Definition: XrdClXRootDResponses.hh:824
@ Offline
File is not online (ie. on disk)
Definition: XrdClXRootDResponses.hh:406
OpenInfo(const uint8_t *fileHandle, uint64_t sessionId, StatInfo *statInfo=0)
Constructor.
Definition: XrdClXRootDResponses.hh:839
void SetParentName(const std::string &parent)
Set name of the parent directory.
Definition: XrdClXRootDResponses.hh:797
@ ManagerPending
manager node where the file is pending to be online
Definition: XrdClXRootDResponses.hh:48
void Add(const Location &location)
Add a location.
Definition: XrdClXRootDResponses.hh:196
std::string GetAccessTimeAsString() const
Get change time.
ConstIterator Begin() const
Get the begin iterator.
Definition: XrdClXRootDResponses.hh:757
StatInfo(const std::string &id, uint64_t size, uint32_t flags, uint64_t modTime)
Constructor.
#define kXR_isServer
Definition: XProtocol.hh:1056
const StatInfo * GetStatInfo() const
Get the stat info object.
Definition: XrdClXRootDResponses.hh:686
ConstIterator End() const
Get the end iterator.
Definition: XrdClXRootDResponses.hh:773
uint32_t flags
Host type.
Definition: XrdClXRootDResponses.hh:963
AccessType pAccess
Definition: XrdClXRootDResponses.hh:122
Iterator Begin()
Get the location begin iterator.
Definition: XrdClXRootDResponses.hh:164
const std::string & GetId() const
Get id.
bool IsManager() const
Check whether the location is a manager.
Definition: XrdClXRootDResponses.hh:114
@ Other
Neither a file nor a directory.
Definition: XrdClXRootDResponses.hh:405
uint32_t errNo
Errno, if any.
Definition: XrdClStatus.hh:139
~DirectoryList()
Destructor.
HostInfo(const URL &u, bool lb=false)
Definition: XrdClXRootDResponses.hh:961
#define kXR_attrSuper
Definition: XProtocol.hh:1059
bool ParseServerResponse(const char *data)
Parse server response and fill up the object.
Request status.
Definition: XrdClXRootDResponses.hh:215
std::string GetChangeTimeAsString() const
Get change time.
Iterator End()
Get the end iterator.
Definition: XrdClXRootDResponses.hh:765
@ kXR_offline
Definition: XProtocol.hh:1115
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:904
const std::string & GetParentName() const
Get parent directory name.
Definition: XrdClXRootDResponses.hh:789
uint64_t pNodesRW
Definition: XrdClXRootDResponses.hh:619
XAttr(const std::string &name, const std::string &value="", const XRootDStatus &status=XRootDStatus())
Definition: XrdClXRootDResponses.hh:319
@ ReadWrite
write access is allowed
Definition: XrdClXRootDResponses.hh:59
#define kXR_attrMeta
Definition: XProtocol.hh:1057
const uint16_t errErrorResponse
Definition: XrdClStatus.hh:102
Protocol response.
Definition: XrdClXRootDResponses.hh:338
bool ProcessLocation(std::string &location)
const std::string & GetAddress() const
Get address.
Definition: XrdClXRootDResponses.hh:82
uint8_t GetUtilizationStaging() const
Get percentage of the partition utilization represented by FreeStaging.
Definition: XrdClXRootDResponses.hh:604
uint64_t GetAccessTime() const
Get change time (in seconds since epoch)
@ IsWritable
Write access is allowed.
Definition: XrdClXRootDResponses.hh:410
const ChunkList & GetChunks() const
Get chunks.
Definition: XrdClXRootDResponses.hh:944
Directory list.
Definition: XrdClXRootDResponses.hh:631
Flags
Flags.
Definition: XrdClXRootDResponses.hh:402
const std::string & GetName() const
Get file name.
Definition: XrdClXRootDResponses.hh:670
#define kXR_attrProxy
Definition: XProtocol.hh:1058
ChunkList pChunks
Definition: XrdClXRootDResponses.hh:950
uint64_t GetChangeTime() const
Get change time (in seconds since epoch)
uint64_t pFreeRW
Definition: XrdClXRootDResponses.hh:620
XRootDStatus(const Status &st, const std::string &message="")
Constructor.
Definition: XrdClXRootDResponses.hh:230
@ IsReadable
Read access is allowed.
Definition: XrdClXRootDResponses.hh:409
uint8_t pFileHandle[4]
Definition: XrdClXRootDResponses.hh:880
ProtocolInfo(uint32_t version, uint32_t hostInfo)
Constructor.
Definition: XrdClXRootDResponses.hh:355
@ ServerPending
server node where the file is pending to be online
Definition: XrdClXRootDResponses.hh:50
LocationList::const_iterator ConstIterator
Iterator over locations.
Definition: XrdClXRootDResponses.hh:138
StatInfo * GetStatInfo()
Get the stat info object.
Definition: XrdClXRootDResponses.hh:678
uint64_t pNodesStaging
Definition: XrdClXRootDResponses.hh:622
uint32_t pUtilizationRW
Definition: XrdClXRootDResponses.hh:621
std::unique_ptr< StatInfoImpl > pImpl
Definition: XrdClXRootDResponses.hh:547
void GetFileHandle(uint8_t *fileHandle) const
Get the file handle (4bytes)
Definition: XrdClXRootDResponses.hh:858
XRootDStatus(uint16_t st=0, uint16_t code=0, uint32_t errN=0, const std::string &message="")
Constructor.
Definition: XrdClXRootDResponses.hh:220
DirList::iterator Iterator
Directory listing iterator.
Definition: XrdClXRootDResponses.hh:723
std::string pHostAddress
Definition: XrdClXRootDResponses.hh:700
@ xattr_name
Definition: XrdClXRootDResponses.hh:278
uint32_t GetFlags() const
Get flags.
DirList::const_iterator ConstIterator
Directory listing const iterator.
Definition: XrdClXRootDResponses.hh:728
uint32_t length
offset in the file
Definition: XrdClXRootDResponses.hh:897
HostInfo()
Definition: XrdClXRootDResponses.hh:959
@ AttrProxy
Proxy attribute.
Definition: XrdClXRootDResponses.hh:348
@ AttrMeta
Meta attribute.
Definition: XrdClXRootDResponses.hh:347
@ AttrSuper
Supervisor attribute.
Definition: XrdClXRootDResponses.hh:349
Location & At(uint32_t index)
Get the location at index.
Definition: XrdClXRootDResponses.hh:156
std::string name
Definition: XrdClXRootDResponses.hh:301
uint64_t GetFreeStaging() const
Get size of the largest contiguous area of free staging space (in MB)
Definition: XrdClXRootDResponses.hh:596
Directory entry.
Definition: XrdClXRootDResponses.hh:638
@ POSCPending
Definition: XrdClXRootDResponses.hh:407
Send file/filesystem queries to an XRootD cluster.
Definition: XrdClFileSystem.hh:202
AccessType
Describes the allowed access type for the file at given location.
Definition: XrdClXRootDResponses.hh:57
@ xattr_value
Definition: XrdClXRootDResponses.hh:279
uint32_t pSize
Definition: XrdClXRootDResponses.hh:951
void SetStatInfo(StatInfo *info)
Set the stat info object (and transfer the ownership)
Definition: XrdClXRootDResponses.hh:694
@ kXR_xset
Definition: XProtocol.hh:1112
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:966
Iterator Begin()
Get the begin iterator.
Definition: XrdClXRootDResponses.hh:749
ListEntry * At(uint32_t index)
Get an entry at given index.
Definition: XrdClXRootDResponses.hh:741
const std::string & GetErrorMessage() const
Get error message.
Definition: XrdClXRootDResponses.hh:238
void * buffer
length of the chunk
Definition: XrdClXRootDResponses.hh:898
uint64_t GetFreeRW() const
Get size of the largest contiguous area of free r/w space (in MB)
Definition: XrdClXRootDResponses.hh:572
std::vector< Location > LocationList
List of locations.
Definition: XrdClXRootDResponses.hh:128
Definition: XrdClAnyObject.hh:26
~ListEntry()
Destructor.
Definition: XrdClXRootDResponses.hh:654
uint64_t GetSessionId() const
Definition: XrdClXRootDResponses.hh:874
uint32_t GetHostInfo() const
Get host info.
Definition: XrdClXRootDResponses.hh:369
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:969
Vector read info.
Definition: XrdClXRootDResponses.hh:910
HostTypes
Types of XRootD servers.
Definition: XrdClXRootDResponses.hh:344
Location(const std::string &address, LocationType type, AccessType access)
Constructor.
Definition: XrdClXRootDResponses.hh:72
std::string ToStr() const
Convert to string.
Definition: XrdClXRootDResponses.hh:254
LocationType GetType() const
Get location type.
Definition: XrdClXRootDResponses.hh:90
VectorReadInfo()
Constructor.
Definition: XrdClXRootDResponses.hh:915
LocationType pType
Definition: XrdClXRootDResponses.hh:121
Iterator End()
Get the location end iterator.
Definition: XrdClXRootDResponses.hh:180
const std::string GetModeAsOctString() const
Get mode.
LocationType
Describes the node type and file status for a given location.
Definition: XrdClXRootDResponses.hh:46
std::string GetModTimeAsString() const
Get modification time.
uint32_t pUtilizationStaging
Definition: XrdClXRootDResponses.hh:624
Object stat info.
Definition: XrdClXRootDResponses.hh:396
Definition: XrdClXRootDResponses.hh:958
void SetSize(uint32_t size)
Set size.
Definition: XrdClXRootDResponses.hh:928
Information returned by file open operation.
Definition: XrdClXRootDResponses.hh:834
uint64_t offset
Definition: XrdClXRootDResponses.hh:896
uint32_t GetSize() const
Get the size of the listing.
Definition: XrdClXRootDResponses.hh:781
@ kXR_readable
Definition: XProtocol.hh:1116
uint64_t GetNodesStaging() const
Get number of nodes that can provide staging space.
Definition: XrdClXRootDResponses.hh:588
Procedure execution status.
Definition: XrdClStatus.hh:111
URL representation.
Definition: XrdClURL.hh:31
static std::string TimeToString(uint64_t time)
Definition: XrdClXRootDResponses.hh:522
Binary blob representation.
Definition: XrdClBuffer.hh:34
std::string pName
Definition: XrdClXRootDResponses.hh:701
ListEntry(const std::string &hostAddress, const std::string &name, StatInfo *statInfo=0)
Constructor.
Definition: XrdClXRootDResponses.hh:643
@ kXR_poscpend
Definition: XProtocol.hh:1118
bool ParseServerResponse(const std::string &hostId, const char *data)
Parse server response and fill up the object.
StatInfo * pStatInfo
Definition: XrdClXRootDResponses.hh:702
AccessType GetAccessType() const
Get access type.
Definition: XrdClXRootDResponses.hh:98
uint32_t pHostInfo
Definition: XrdClXRootDResponses.hh:384
void SetFlags(uint32_t flags)
Set flags.
StatInfo * pStatInfo
Definition: XrdClXRootDResponses.hh:882
Definition: XrdClAnyObject.hh:33
std::string pParent
Definition: XrdClXRootDResponses.hh:825
bool loadBalancer
Was the host used as a load balancer.
Definition: XrdClXRootDResponses.hh:965
ConstIterator End() const
Get the location end iterator.
Definition: XrdClXRootDResponses.hh:188
@ kXR_bkpexist
Definition: XProtocol.hh:1119
static const std::string dStatPrefix
Definition: XrdClXRootDResponses.hh:827
bool TestHostInfo(uint32_t flags)
Test host info flags.
Definition: XrdClXRootDResponses.hh:377
uint32_t GetSize() const
Get Size.
Definition: XrdClXRootDResponses.hh:920
@ BackUpExists
Back up copy exists.
Definition: XrdClXRootDResponses.hh:411
XAttrStatus(const std::string &name, const XRootDStatus &status)
Definition: XrdClXRootDResponses.hh:295
std::tuple< std::string, std::string > xattr_t
Extended attribute key - value pair.
Definition: XrdClXRootDResponses.hh:285
uint64_t GetNodesRW() const
Get number of nodes that can provide read/write space.
Definition: XrdClXRootDResponses.hh:564
std::string pMessage
Definition: XrdClXRootDResponses.hh:270
@ IsServer
Data server.
Definition: XrdClXRootDResponses.hh:346