19 #ifndef __XRD_CL_XROOTD_RESPONSES_HH__ 20 #define __XRD_CL_XROOTD_RESPONSES_HH__ 221 const std::string &message =
"" ):
223 pMessage( message ) {}
229 const std::string &message =
"" ):
231 pMessage( message ) {}
256 std::ostringstream o;
257 o <<
"[ERROR] Server responded with an error: [" << errNo <<
"] ";
258 o << pMessage << std::endl;
261 std::string str = ToString();
262 if( !pMessage.empty() )
263 str +=
": " + pMessage;
298 pVersion( version ), pHostInfo( hostInfo ) {}
321 return pHostInfo & flags;
385 return pFlags & flags;
402 time_t modTime = pModTime;
403 tm *t = gmtime( &modTime );
404 strftime( ts, 255,
"%F %T", t );
456 return pUtilizationRW;
464 return pNodesStaging;
480 return pUtilizationStaging;
517 const std::string &name,
519 pHostAddress( hostAddress ),
521 pStatInfo( statInfo )
608 pDirList.push_back( entry );
616 return pDirList[index];
624 return pDirList.begin();
632 return pDirList.begin();
640 return pDirList.end();
648 return pDirList.end();
656 return pDirList.size();
672 size_t pos = parent.find(
'?' );
673 pParent = pos == std::string::npos ? parent : parent.substr( 0, pos );
674 if( !pParent.empty() && pParent[pParent.length()-1] !=
'/' )
701 pSessionId(sessionId), pStatInfo( statInfo )
703 memcpy( pFileHandle, fileHandle, 4 );
719 memcpy( fileHandle, pFileHandle, 4 );
739 uint8_t pFileHandle[4];
752 ChunkInfo( uint64_t off = 0, uint32_t len = 0,
void *buff = 0 ):
753 offset( off ), length( len ), buffer(buff) {}
819 flags(0), protocol(0), loadBalancer(false) {}
821 flags(0), protocol(0), loadBalancer(lb), url(u) {}
852 HandleResponse( status, response );
866 (void)status; (void)response;
871 #endif // __XRD_CL_XROOTD_RESPONSES_HH__ uint32_t pUtilizationStaging
Definition: XrdClXRootDResponses.hh:498
const std::string & GetAddress() const
Get address.
Definition: XrdClXRootDResponses.hh:80
ListEntry(const std::string &hostAddress, const std::string &name, StatInfo *statInfo=0)
Constructor.
Definition: XrdClXRootDResponses.hh:516
Definition: XProtocol.hh:179
virtual ~ResponseHandler()
Definition: XrdClXRootDResponses.hh:836
#define kXR_isServer
Definition: XProtocol.hh:65
Definition: XrdClAnyObject.hh:32
AccessType
Describes the allowed access type for the file at given location.
Definition: XrdClXRootDResponses.hh:54
const std::string & GetErrorMessage() const
Get error message.
Definition: XrdClXRootDResponses.hh:236
#define kXR_attrProxy
Definition: XProtocol.hh:67
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:763
uint64_t pNodesStaging
Definition: XrdClXRootDResponses.hh:496
StatInfo * pStatInfo
Definition: XrdClXRootDResponses.hh:575
Definition: XProtocol.hh:181
Directory list.
Definition: XrdClXRootDResponses.hh:504
AccessType GetAccessType() const
Get access type.
Definition: XrdClXRootDResponses.hh:96
uint64_t pFreeStaging
Definition: XrdClXRootDResponses.hh:497
uint64_t pFreeRW
Definition: XrdClXRootDResponses.hh:494
uint64_t GetFreeRW() const
Get size of the largest contiguous area of free r/w space (in MB)
Definition: XrdClXRootDResponses.hh:446
uint64_t GetNodesStaging() const
Get number of nodes that can provide staging space.
Definition: XrdClXRootDResponses.hh:462
Definition: XProtocol.hh:182
uint32_t GetHostInfo() const
Get host info.
Definition: XrdClXRootDResponses.hh:311
Object stat info.
Definition: XrdClXRootDResponses.hh:332
ConstIterator End() const
Get the end iterator.
Definition: XrdClXRootDResponses.hh:646
const uint16_t errErrorResponse
Definition: XrdClStatus.hh:99
uint32_t pUtilizationRW
Definition: XrdClXRootDResponses.hh:495
#define kXR_attrMeta
Definition: XProtocol.hh:66
bool IsManager() const
Check whether the location is a manager.
Definition: XrdClXRootDResponses.hh:112
ConstIterator Begin() const
Get the begin iterator.
Definition: XrdClXRootDResponses.hh:630
LocationInfo()
Constructor.
HostInfo()
Definition: XrdClXRootDResponses.hh:818
server node where the file is pending to be online
Definition: XrdClXRootDResponses.hh:48
uint64_t GetSize() const
Get size (in bytes)
Definition: XrdClXRootDResponses.hh:367
Definition: XProtocol.hh:178
const std::string & GetHostAddress() const
Get host address.
Definition: XrdClXRootDResponses.hh:535
void Add(ListEntry *entry)
Add an entry to the list - takes ownership.
Definition: XrdClXRootDResponses.hh:606
XRootDStatus(const Status &st, const std::string &message="")
Constructor.
Definition: XrdClXRootDResponses.hh:228
bool IsServer() const
Check whether the location is a server.
Definition: XrdClXRootDResponses.hh:104
std::string pId
Definition: XrdClXRootDResponses.hh:418
std::string pMessage
Definition: XrdClXRootDResponses.hh:268
Path location info.
Definition: XrdClXRootDResponses.hh:37
uint64_t pModTime
Definition: XrdClXRootDResponses.hh:421
void SetErrorMessage(const std::string &message)
Set the error message.
Definition: XrdClXRootDResponses.hh:244
std::vector< Location > LocationList
List of locations.
Definition: XrdClXRootDResponses.hh:126
Location.
Definition: XrdClXRootDResponses.hh:63
uint64_t GetNodesRW() const
Get number of nodes that can provide read/write space.
Definition: XrdClXRootDResponses.hh:438
Iterator Begin()
Get the begin iterator.
Definition: XrdClXRootDResponses.hh:622
LocationType pType
Definition: XrdClXRootDResponses.hh:119
Procedure execution status.
Definition: XrdClStatus.hh:107
ChunkList & GetChunks()
Get chunks.
Definition: XrdClXRootDResponses.hh:795
StatInfo * GetStatInfo()
Get the stat info object.
Definition: XrdClXRootDResponses.hh:551
Definition: XProtocol.hh:180
void SetParentName(const std::string &parent)
Set name of the parent directory.
Definition: XrdClXRootDResponses.hh:670
Information returned by file open operation.
Definition: XrdClXRootDResponses.hh:692
#define kXR_isManager
Definition: XProtocol.hh:64
~OpenInfo()
Destructor.
Definition: XrdClXRootDResponses.hh:709
Definition: XProtocol.hh:176
Iterator End()
Get the location end iterator.
Definition: XrdClXRootDResponses.hh:178
void * buffer
length of the chunk
Definition: XrdClXRootDResponses.hh:757
XRootDStatus(uint16_t st=0, uint16_t code=0, uint32_t errN=0, const std::string &message="")
Constructor.
Definition: XrdClXRootDResponses.hh:218
Protocol response.
Definition: XrdClXRootDResponses.hh:279
const ChunkList & GetChunks() const
Get chunks.
Definition: XrdClXRootDResponses.hh:803
uint64_t GetFreeStaging() const
Get size of the largest contiguous area of free staging space (in MB)
Definition: XrdClXRootDResponses.hh:470
read access is allowed
Definition: XrdClXRootDResponses.hh:56
uint64_t pSessionId
Definition: XrdClXRootDResponses.hh:740
uint32_t GetFlags() const
Get flags.
Definition: XrdClXRootDResponses.hh:375
bool ProcessLocation(std::string &location)
ListEntry * At(uint32_t index)
Get an entry at given index.
Definition: XrdClXRootDResponses.hh:614
const StatInfo * GetStatInfo() const
Get the stat info.
Definition: XrdClXRootDResponses.hh:725
uint8_t GetUtilizationRW() const
Get percentage of the partition utilization represented by FreeRW.
Definition: XrdClXRootDResponses.hh:454
Definition: XrdClXRootDResponses.hh:816
Definition: XProtocol.hh:175
uint32_t GetSize() const
Get number of locations.
Definition: XrdClXRootDResponses.hh:146
OpenInfo(const uint8_t *fileHandle, uint64_t sessionId, StatInfo *statInfo=0)
Constructor.
Definition: XrdClXRootDResponses.hh:698
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:828
DirList::iterator Iterator
Directory listing iterator.
Definition: XrdClXRootDResponses.hh:596
const std::string & GetParentName() const
Get parent directory name.
Definition: XrdClXRootDResponses.hh:662
DirList pDirList
Definition: XrdClXRootDResponses.hh:685
LocationList pLocations
Definition: XrdClXRootDResponses.hh:206
uint32_t flags
Host type.
Definition: XrdClXRootDResponses.hh:822
bool TestHostInfo(uint32_t flags)
Test host info flags.
Definition: XrdClXRootDResponses.hh:319
HostTypes
Types of XRootD servers.
Definition: XrdClXRootDResponses.hh:285
ChunkInfo(uint64_t off=0, uint32_t len=0, void *buff=0)
Constructor.
Definition: XrdClXRootDResponses.hh:752
const StatInfo * GetStatInfo() const
Get the stat info object.
Definition: XrdClXRootDResponses.hh:559
uint32_t length
offset in the file
Definition: XrdClXRootDResponses.hh:756
LocationList::iterator Iterator
Iterator over locations.
Definition: XrdClXRootDResponses.hh:131
manager node where the file is online
Definition: XrdClXRootDResponses.hh:45
const std::string GetId() const
Get id.
Definition: XrdClXRootDResponses.hh:359
Describe a data chunk for vector read.
Definition: XrdClXRootDResponses.hh:747
Request status.
Definition: XrdClXRootDResponses.hh:212
const std::string & GetName() const
Get file name.
Definition: XrdClXRootDResponses.hh:543
Definition: XrdClEnv.hh:28
std::string pHostAddress
Definition: XrdClXRootDResponses.hh:573
void SetStatInfo(StatInfo *info)
Set the stat info object (and transfer the ownership)
Definition: XrdClXRootDResponses.hh:567
LocationType GetType() const
Get location type.
Definition: XrdClXRootDResponses.hh:88
ProtocolInfo(uint32_t version, uint32_t hostInfo)
Constructor.
Definition: XrdClXRootDResponses.hh:297
uint32_t pFlags
Definition: XrdClXRootDResponses.hh:420
server node where the file is online
Definition: XrdClXRootDResponses.hh:47
uint32_t pSize
Definition: XrdClXRootDResponses.hh:810
uint32_t protocol
Version of the protocol the host is speaking.
Definition: XrdClXRootDResponses.hh:823
VFS stat info.
Definition: XrdClXRootDResponses.hh:427
ChunkList pChunks
Definition: XrdClXRootDResponses.hh:809
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:825
std::string pAddress
Definition: XrdClXRootDResponses.hh:118
Iterator End()
Get the end iterator.
Definition: XrdClXRootDResponses.hh:638
ConstIterator Begin() const
Get the location begin iterator.
Definition: XrdClXRootDResponses.hh:170
void SetSize(uint32_t size)
Set size.
Definition: XrdClXRootDResponses.hh:787
manager node where the file is pending to be online
Definition: XrdClXRootDResponses.hh:46
Location & At(uint32_t index)
Get the location at index.
Definition: XrdClXRootDResponses.hh:154
Flags
Flags.
Definition: XrdClXRootDResponses.hh:338
#define kXR_attrSuper
Definition: XProtocol.hh:68
Vector read info.
Definition: XrdClXRootDResponses.hh:768
uint32_t GetVersion() const
Get version info.
Definition: XrdClXRootDResponses.hh:303
HostInfo(const URL &u, bool lb=false)
Definition: XrdClXRootDResponses.hh:820
Handle an async response.
Definition: XrdClXRootDResponses.hh:833
Location(const std::string &address, LocationType type, AccessType access)
Constructor.
Definition: XrdClXRootDResponses.hh:70
uint64_t offset
Definition: XrdClXRootDResponses.hh:755
StatInfo * pStatInfo
Definition: XrdClXRootDResponses.hh:741
AccessType pAccess
Definition: XrdClXRootDResponses.hh:120
std::string pParent
Definition: XrdClXRootDResponses.hh:686
uint32_t GetSize() const
Get the size of the listing.
Definition: XrdClXRootDResponses.hh:654
virtual void HandleResponse(XRootDStatus *status, AnyObject *response)
Definition: XrdClXRootDResponses.hh:863
uint64_t pNodesRW
Definition: XrdClXRootDResponses.hh:493
URL representation.
Definition: XrdClURL.hh:30
virtual void HandleResponseWithHosts(XRootDStatus *status, AnyObject *response, HostList *hostList)
Definition: XrdClXRootDResponses.hh:847
uint32_t GetSize() const
Get Size.
Definition: XrdClXRootDResponses.hh:779
Buffer BinaryDataInfo
Binary buffer.
Definition: XrdClXRootDResponses.hh:274
write access is allowed
Definition: XrdClXRootDResponses.hh:57
uint32_t pVersion
Definition: XrdClXRootDResponses.hh:325
void GetFileHandle(uint8_t *fileHandle) const
Get the file handle (4bytes)
Definition: XrdClXRootDResponses.hh:717
uint32_t pHostInfo
Definition: XrdClXRootDResponses.hh:326
std::string pName
Definition: XrdClXRootDResponses.hh:574
LocationType
Describes the node type and file status for a given location.
Definition: XrdClXRootDResponses.hh:43
~ListEntry()
Destructor.
Definition: XrdClXRootDResponses.hh:527
bool ParseServerResponse(const char *data)
Parse server response and fill up the object.
uint64_t pSize
Definition: XrdClXRootDResponses.hh:419
DirList::const_iterator ConstIterator
Directory listing const iterator.
Definition: XrdClXRootDResponses.hh:601
std::string GetModTimeAsString() const
Get modification time.
Definition: XrdClXRootDResponses.hh:399
std::string ToStr() const
Convert to string.
Definition: XrdClXRootDResponses.hh:252
void Add(const Location &location)
Add a location.
Definition: XrdClXRootDResponses.hh:194
VectorReadInfo()
Constructor.
Definition: XrdClXRootDResponses.hh:774
uint64_t GetModTime() const
Get modification time (in seconds since epoch)
Definition: XrdClXRootDResponses.hh:391
bool loadBalancer
Was the host used as a load balancer.
Definition: XrdClXRootDResponses.hh:824
uint64_t GetSessionId() const
Definition: XrdClXRootDResponses.hh:733
std::vector< ListEntry * > DirList
Directory listing.
Definition: XrdClXRootDResponses.hh:591
uint8_t GetUtilizationStaging() const
Get percentage of the partition utilization represented by FreeStaging.
Definition: XrdClXRootDResponses.hh:478
ConstIterator End() const
Get the location end iterator.
Definition: XrdClXRootDResponses.hh:186
LocationList::const_iterator ConstIterator
Iterator over locations.
Definition: XrdClXRootDResponses.hh:136
Iterator Begin()
Get the location begin iterator.
Definition: XrdClXRootDResponses.hh:162
Binary blob representation.
Definition: XrdClBuffer.hh:33
Directory entry.
Definition: XrdClXRootDResponses.hh:510
Definition: XProtocol.hh:177
bool TestFlags(uint32_t flags) const
Test flags.
Definition: XrdClXRootDResponses.hh:383