xrootd
XrdClXRootDResponses.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN)
3 // Author: Lukasz Janyst <ljanyst@cern.ch>
4 //------------------------------------------------------------------------------
5 // XRootD is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // XRootD is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with XRootD. If not, see <http://www.gnu.org/licenses/>.
17 //------------------------------------------------------------------------------
18 
19 #ifndef __XRD_CL_XROOTD_RESPONSES_HH__
20 #define __XRD_CL_XROOTD_RESPONSES_HH__
21 
22 #include "XrdCl/XrdClBuffer.hh"
23 #include "XrdCl/XrdClStatus.hh"
24 #include "XrdCl/XrdClURL.hh"
25 #include "XrdCl/XrdClAnyObject.hh"
26 #include "XProtocol/XProtocol.hh"
27 #include <string>
28 #include <vector>
29 #include <list>
30 #include <ctime>
31 
32 namespace XrdCl
33 {
34  //----------------------------------------------------------------------------
36  //----------------------------------------------------------------------------
38  {
39  public:
40  //------------------------------------------------------------------------
42  //------------------------------------------------------------------------
44  {
49  };
50 
51  //------------------------------------------------------------------------
53  //------------------------------------------------------------------------
55  {
56  Read,
58  };
59 
60  //------------------------------------------------------------------------
62  //------------------------------------------------------------------------
63  class Location
64  {
65  public:
66 
67  //--------------------------------------------------------------------
69  //--------------------------------------------------------------------
70  Location( const std::string &address,
71  LocationType type,
72  AccessType access ):
73  pAddress( address ),
74  pType( type ),
75  pAccess( access ) {}
76 
77  //--------------------------------------------------------------------
79  //--------------------------------------------------------------------
80  const std::string &GetAddress() const
81  {
82  return pAddress;
83  }
84 
85  //--------------------------------------------------------------------
87  //--------------------------------------------------------------------
89  {
90  return pType;
91  }
92 
93  //--------------------------------------------------------------------
95  //--------------------------------------------------------------------
97  {
98  return pAccess;
99  }
100 
101  //--------------------------------------------------------------------
103  //--------------------------------------------------------------------
104  bool IsServer() const
105  {
106  return pType == ServerOnline || pType == ServerPending;
107  }
108 
109  //--------------------------------------------------------------------
111  //--------------------------------------------------------------------
112  bool IsManager() const
113  {
114  return pType == ManagerOnline || pType == ManagerPending;
115  }
116 
117  private:
118  std::string pAddress;
121  };
122 
123  //------------------------------------------------------------------------
125  //------------------------------------------------------------------------
126  typedef std::vector<Location> LocationList;
127 
128  //------------------------------------------------------------------------
130  //------------------------------------------------------------------------
131  typedef LocationList::iterator Iterator;
132 
133  //------------------------------------------------------------------------
135  //------------------------------------------------------------------------
136  typedef LocationList::const_iterator ConstIterator;
137 
138  //------------------------------------------------------------------------
140  //------------------------------------------------------------------------
141  LocationInfo( const char *data = 0 );
142 
143  //------------------------------------------------------------------------
145  //------------------------------------------------------------------------
146  uint32_t GetSize() const
147  {
148  return pLocations.size();
149  }
150 
151  //------------------------------------------------------------------------
153  //------------------------------------------------------------------------
154  Location &At( uint32_t index )
155  {
156  return pLocations[index];
157  }
158 
159  //------------------------------------------------------------------------
161  //------------------------------------------------------------------------
163  {
164  return pLocations.begin();
165  }
166 
167  //------------------------------------------------------------------------
169  //------------------------------------------------------------------------
171  {
172  return pLocations.begin();
173  }
174 
175  //------------------------------------------------------------------------
177  //------------------------------------------------------------------------
179  {
180  return pLocations.end();
181  }
182 
183  //------------------------------------------------------------------------
185  //------------------------------------------------------------------------
187  {
188  return pLocations.end();
189  }
190 
191  //------------------------------------------------------------------------
193  //------------------------------------------------------------------------
194  void Add( const Location &location )
195  {
196  pLocations.push_back( location );
197  }
198 
199  private:
200  void ParseServerResponse( const char *data );
201  void ProcessLocation( std::string &location );
203  };
204 
205  //----------------------------------------------------------------------------
207  //----------------------------------------------------------------------------
208  class XRootDStatus: public Status
209  {
210  public:
211  //------------------------------------------------------------------------
213  //------------------------------------------------------------------------
214  XRootDStatus( uint16_t st = 0,
215  uint16_t cod = 0,
216  uint32_t errN = 0,
217  const std::string &message = "" ):
218  Status( st, cod, errN ),
219  pMessage( message ) {}
220 
221  //------------------------------------------------------------------------
223  //------------------------------------------------------------------------
224  XRootDStatus( const Status &st,
225  const std::string &message = "" ):
226  Status( st ),
227  pMessage( message ) {}
228 
229  //------------------------------------------------------------------------
231  //------------------------------------------------------------------------
232  const std::string &GetErrorMessage() const
233  {
234  return pMessage;
235  }
236 
237  //------------------------------------------------------------------------
239  //------------------------------------------------------------------------
240  void SetErrorMessage( const std::string &message )
241  {
242  pMessage = message;
243  }
244 
245  //------------------------------------------------------------------------
247  //------------------------------------------------------------------------
248  std::string ToStr() const
249  {
250 
251  if( code == errErrorResponse )
252  {
253  std::ostringstream o;
254  o << "[ERROR] Server responded with an error: [" << errNo << "] ";
255  o << pMessage << std::endl;
256  return o.str();
257  }
258  return ToString();
259  }
260 
261  private:
262  std::string pMessage;
263  };
264 
265  //----------------------------------------------------------------------------
267  //----------------------------------------------------------------------------
269 
270  //----------------------------------------------------------------------------
272  //----------------------------------------------------------------------------
274  {
275  public:
276  //------------------------------------------------------------------------
278  //------------------------------------------------------------------------
280  {
286  };
287 
288  //------------------------------------------------------------------------
290  //------------------------------------------------------------------------
291  ProtocolInfo( uint32_t version, uint32_t hostInfo ):
292  pVersion( version ), pHostInfo( hostInfo ) {}
293 
294  //------------------------------------------------------------------------
296  //------------------------------------------------------------------------
297  uint32_t GetVersion() const
298  {
299  return pVersion;
300  }
301 
302  //------------------------------------------------------------------------
304  //------------------------------------------------------------------------
305  uint32_t GetHostInfo() const
306  {
307  return pHostInfo;
308  }
309 
310  //------------------------------------------------------------------------
312  //------------------------------------------------------------------------
313  bool TestHostInfo( uint32_t flags )
314  {
315  return pHostInfo & flags;
316  }
317 
318  private:
319  uint32_t pVersion;
320  uint32_t pHostInfo;
321  };
322 
323  //----------------------------------------------------------------------------
325  //----------------------------------------------------------------------------
326  class StatInfo
327  {
328  public:
329  //------------------------------------------------------------------------
331  //------------------------------------------------------------------------
332  enum Flags
333  {
342  };
343 
344  //------------------------------------------------------------------------
346  //------------------------------------------------------------------------
347  StatInfo( const char *data );
348 
349  //------------------------------------------------------------------------
351  //------------------------------------------------------------------------
352  const std::string GetId() const
353  {
354  return pId;
355  }
356 
357  //------------------------------------------------------------------------
359  //------------------------------------------------------------------------
360  uint64_t GetSize() const
361  {
362  return pSize;
363  }
364 
365  //------------------------------------------------------------------------
367  //------------------------------------------------------------------------
368  uint32_t GetFlags() const
369  {
370  return pFlags;
371  }
372 
373  //------------------------------------------------------------------------
375  //------------------------------------------------------------------------
376  bool TestFlags( uint32_t flags ) const
377  {
378  return pFlags & flags;
379  }
380 
381  //------------------------------------------------------------------------
383  //------------------------------------------------------------------------
384  uint64_t GetModTime() const
385  {
386  return pModTime;
387  }
388 
389  //------------------------------------------------------------------------
391  //------------------------------------------------------------------------
392  std::string GetModTimeAsString() const
393  {
394  char ts[256];
395  time_t modTime = pModTime;
396  tm *t = gmtime( &modTime );
397  strftime( ts, 255, "%F %T", t );
398  return ts;
399  }
400 
401 
402  private:
403 
404  //------------------------------------------------------------------------
405  // Parse the stat info returned by the server
406  //------------------------------------------------------------------------
407  void ParseServerResponse( const char *data );
408 
409  //------------------------------------------------------------------------
410  // Normal stat
411  //------------------------------------------------------------------------
412  std::string pId;
413  uint64_t pSize;
414  uint32_t pFlags;
415  uint64_t pModTime;
416  };
417 
418  //----------------------------------------------------------------------------
420  //----------------------------------------------------------------------------
422  {
423  public:
424  //------------------------------------------------------------------------
426  //------------------------------------------------------------------------
427  StatInfoVFS( const char *data );
428 
429  //------------------------------------------------------------------------
431  //------------------------------------------------------------------------
432  uint64_t GetNodesRW() const
433  {
434  return pNodesRW;
435  }
436 
437  //------------------------------------------------------------------------
439  //------------------------------------------------------------------------
440  uint64_t GetFreeRW() const
441  {
442  return pFreeRW;
443  }
444 
445  //------------------------------------------------------------------------
447  //------------------------------------------------------------------------
448  uint8_t GetUtilizationRW() const
449  {
450  return pUtilizationRW;
451  }
452 
453  //------------------------------------------------------------------------
455  //------------------------------------------------------------------------
456  uint64_t GetNodesStaging() const
457  {
458  return pNodesStaging;
459  }
460 
461  //------------------------------------------------------------------------
463  //------------------------------------------------------------------------
464  uint64_t GetFreeStaging() const
465  {
466  return pFreeStaging;
467  }
468 
469  //------------------------------------------------------------------------
471  //------------------------------------------------------------------------
472  uint8_t GetUtilizationStaging() const
473  {
474  return pUtilizationStaging;
475  }
476 
477  private:
478 
479  //------------------------------------------------------------------------
480  // Parse the stat info returned by the server
481  //------------------------------------------------------------------------
482  void ParseServerResponse( const char *data );
483 
484  //------------------------------------------------------------------------
485  // kXR_vfs stat
486  //------------------------------------------------------------------------
487  uint64_t pNodesRW;
488  uint64_t pFreeRW;
489  uint32_t pUtilizationRW;
490  uint64_t pNodesStaging;
491  uint64_t pFreeStaging;
493  };
494 
495  //----------------------------------------------------------------------------
497  //----------------------------------------------------------------------------
499  {
500  public:
501  //------------------------------------------------------------------------
503  //------------------------------------------------------------------------
504  class ListEntry
505  {
506  public:
507  //--------------------------------------------------------------------
509  //--------------------------------------------------------------------
510  ListEntry( const std::string &hostAddress,
511  const std::string &name,
512  StatInfo *statInfo = 0):
513  pHostAddress( hostAddress ),
514  pName( name ),
515  pStatInfo( statInfo )
516  {}
517 
518  //--------------------------------------------------------------------
520  //--------------------------------------------------------------------
522  {
523  delete pStatInfo;
524  }
525 
526  //--------------------------------------------------------------------
528  //--------------------------------------------------------------------
529  const std::string &GetHostAddress() const
530  {
531  return pHostAddress;
532  }
533 
534  //--------------------------------------------------------------------
536  //--------------------------------------------------------------------
537  const std::string &GetName() const
538  {
539  return pName;
540  }
541 
542  //--------------------------------------------------------------------
544  //--------------------------------------------------------------------
546  {
547  return pStatInfo;
548  }
549 
550  //--------------------------------------------------------------------
552  //--------------------------------------------------------------------
553  const StatInfo *GetStatInfo() const
554  {
555  return pStatInfo;
556  }
557 
558  //--------------------------------------------------------------------
560  //--------------------------------------------------------------------
561  void SetStatInfo( StatInfo *info )
562  {
563  pStatInfo = info;
564  }
565 
566  private:
567  std::string pHostAddress;
568  std::string pName;
570  };
571 
572  //------------------------------------------------------------------------
574  //------------------------------------------------------------------------
575  DirectoryList( const std::string &hostID,
576  const std::string &parent,
577  const char *data );
578 
579  //------------------------------------------------------------------------
581  //------------------------------------------------------------------------
582  ~DirectoryList();
583 
584  //------------------------------------------------------------------------
586  //------------------------------------------------------------------------
587  typedef std::vector<ListEntry*> DirList;
588 
589  //------------------------------------------------------------------------
591  //------------------------------------------------------------------------
592  typedef DirList::iterator Iterator;
593 
594  //------------------------------------------------------------------------
596  //------------------------------------------------------------------------
597  typedef DirList::const_iterator ConstIterator;
598 
599  //------------------------------------------------------------------------
601  //------------------------------------------------------------------------
602  void Add( ListEntry *entry )
603  {
604  pDirList.push_back( entry );
605  }
606 
607  //------------------------------------------------------------------------
609  //------------------------------------------------------------------------
610  ListEntry *At( uint32_t index )
611  {
612  return pDirList[index];
613  }
614 
615  //------------------------------------------------------------------------
617  //------------------------------------------------------------------------
619  {
620  return pDirList.begin();
621  }
622 
623  //------------------------------------------------------------------------
625  //------------------------------------------------------------------------
627  {
628  return pDirList.begin();
629  }
630 
631  //------------------------------------------------------------------------
633  //------------------------------------------------------------------------
635  {
636  return pDirList.end();
637  }
638 
639  //------------------------------------------------------------------------
641  //------------------------------------------------------------------------
643  {
644  return pDirList.end();
645  }
646 
647  //------------------------------------------------------------------------
649  //------------------------------------------------------------------------
650  uint32_t GetSize() const
651  {
652  return pDirList.size();
653  }
654 
655  //------------------------------------------------------------------------
657  //------------------------------------------------------------------------
658  const std::string &GetParentName() const
659  {
660  return pParent;
661  }
662 
663  private:
664  void ParseServerResponse( const std::string &hostId, const char *data );
666  std::string pParent;
667  };
668 
669  //----------------------------------------------------------------------------
671  //----------------------------------------------------------------------------
672  class OpenInfo
673  {
674  public:
675  //------------------------------------------------------------------------
677  //------------------------------------------------------------------------
678  OpenInfo( const uint8_t *fileHandle,
679  uint64_t sessionId,
680  StatInfo *statInfo = 0 ):
681  pSessionId(sessionId), pStatInfo( statInfo )
682  {
683  memcpy( pFileHandle, fileHandle, 4 );
684  }
685 
686  //------------------------------------------------------------------------
688  //------------------------------------------------------------------------
690  {
691  delete pStatInfo;
692  }
693 
694  //------------------------------------------------------------------------
696  //------------------------------------------------------------------------
697  void GetFileHandle( uint8_t *fileHandle ) const
698  {
699  memcpy( fileHandle, pFileHandle, 4 );
700  }
701 
702  //------------------------------------------------------------------------
704  //------------------------------------------------------------------------
705  const StatInfo *GetStatInfo() const
706  {
707  return pStatInfo;
708  }
709 
710  //------------------------------------------------------------------------
711  // Get session ID
712  //------------------------------------------------------------------------
713  uint64_t GetSessionId() const
714  {
715  return pSessionId;
716  }
717 
718  private:
719  uint8_t pFileHandle[4];
720  uint64_t pSessionId;
722  };
723 
724  //----------------------------------------------------------------------------
726  //----------------------------------------------------------------------------
727  struct ChunkInfo
728  {
729  //--------------------------------------------------------------------------
731  //--------------------------------------------------------------------------
732  ChunkInfo( uint64_t off = 0, uint32_t len = 0, void *buff = 0 ):
733  offset( off ), length( len ), buffer(buff) {}
734 
735  uint64_t offset;
736  uint32_t length;
737  void *buffer;
738  };
739 
740  //----------------------------------------------------------------------------
742  //----------------------------------------------------------------------------
743  typedef std::vector<ChunkInfo> ChunkList;
744 
745  //----------------------------------------------------------------------------
747  //----------------------------------------------------------------------------
749  {
750  public:
751  //------------------------------------------------------------------------
753  //------------------------------------------------------------------------
755 
756  //------------------------------------------------------------------------
758  //------------------------------------------------------------------------
759  uint32_t GetSize() const
760  {
761  return pSize;
762  }
763 
764  //------------------------------------------------------------------------
766  //------------------------------------------------------------------------
767  void SetSize( uint32_t size )
768  {
769  pSize = size;
770  }
771 
772  //------------------------------------------------------------------------
774  //------------------------------------------------------------------------
776  {
777  return pChunks;
778  }
779 
780  //------------------------------------------------------------------------
782  //------------------------------------------------------------------------
783  const ChunkList &GetChunks() const
784  {
785  return pChunks;
786  }
787 
788  private:
790  uint32_t pSize;
791  };
792 
793  //----------------------------------------------------------------------------
794  // List of URLs
795  //----------------------------------------------------------------------------
796  struct HostInfo
797  {
799  flags(0), protocol(0), loadBalancer(false) {}
800  HostInfo( const URL &u, bool lb = false ):
801  flags(0), protocol(0), loadBalancer(lb), url(u) {}
802  uint32_t flags;
803  uint32_t protocol;
806  };
807 
808  typedef std::vector<HostInfo> HostList;
809 
810  //----------------------------------------------------------------------------
812  //----------------------------------------------------------------------------
814  {
815  //--------------------------------------------------------------------------
817  //--------------------------------------------------------------------------
818  RedirectInfo( const std::string &h,
819  uint16_t p,
820  const std::string &c ):
821  protocol("xroot"), host(h), port(p), path(""), cgi(c), token("") {};
822  std::string protocol;
823  std::string host;
824  uint16_t port;
825  std::string path;
826  std::string cgi;
827  std::string token;
828  };
829 
830  //----------------------------------------------------------------------------
832  //----------------------------------------------------------------------------
834  {
835  public:
836  virtual ~ResponseHandler() {}
837 
838  //------------------------------------------------------------------------
846  //------------------------------------------------------------------------
847  virtual void HandleResponseWithHosts( XRootDStatus *status,
848  AnyObject *response,
849  HostList *hostList )
850  {
851  delete hostList;
852  HandleResponse( status, response );
853  }
854 
855  //------------------------------------------------------------------------
862  //------------------------------------------------------------------------
863  virtual void HandleResponse( XRootDStatus *status,
864  AnyObject *response )
865  {
866  (void)status;
867  (void)response;
868  }
869  };
870 }
871 
872 #endif // __XRD_CL_XROOTD_RESPONSES_HH__
Write access is allowed.
Definition: XrdClXRootDResponses.hh:341
uint32_t pUtilizationStaging
Definition: XrdClXRootDResponses.hh:492
ListEntry(const std::string &hostAddress, const std::string &name, StatInfo *statInfo=0)
Constructor.
Definition: XrdClXRootDResponses.hh:510
Definition: XProtocol.hh:162
virtual ~ResponseHandler()
Definition: XrdClXRootDResponses.hh:836
#define kXR_isServer
Definition: XProtocol.hh:62
Definition: XrdClAnyObject.hh:32
uint8_t GetUtilizationStaging() const
Get percentage of the partition utilization represented by FreeStaging.
Definition: XrdClXRootDResponses.hh:472
const StatInfo * GetStatInfo() const
Get the stat info.
Definition: XrdClXRootDResponses.hh:705
AccessType
Describes the allowed access type for the file at given location.
Definition: XrdClXRootDResponses.hh:54
const std::string & GetAddress() const
Get address.
Definition: XrdClXRootDResponses.hh:80
#define kXR_attrProxy
Definition: XProtocol.hh:64
const std::string & GetParentName() const
Get parent directory name.
Definition: XrdClXRootDResponses.hh:658
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:743
uint64_t pNodesStaging
Definition: XrdClXRootDResponses.hh:490
uint64_t GetFreeStaging() const
Get size of the largest contiguous area of free staging space (in MB)
Definition: XrdClXRootDResponses.hh:464
StatInfo * pStatInfo
Definition: XrdClXRootDResponses.hh:569
StatInfo(const char *data)
Constructor.
uint8_t GetUtilizationRW() const
Get percentage of the partition utilization represented by FreeRW.
Definition: XrdClXRootDResponses.hh:448
Definition: XProtocol.hh:164
Directory list.
Definition: XrdClXRootDResponses.hh:498
uint64_t pFreeStaging
Definition: XrdClXRootDResponses.hh:491
Meta attribute.
Definition: XrdClXRootDResponses.hh:283
uint64_t pFreeRW
Definition: XrdClXRootDResponses.hh:488
Object stat info.
Definition: XrdClXRootDResponses.hh:326
Definition: XrdClXRootDResponses.hh:338
const uint16_t errErrorResponse
Definition: XrdClStatus.hh:99
uint32_t GetSize() const
Get the size of the listing.
Definition: XrdClXRootDResponses.hh:650
uint32_t pUtilizationRW
Definition: XrdClXRootDResponses.hh:489
bool TestFlags(uint32_t flags) const
Test flags.
Definition: XrdClXRootDResponses.hh:376
#define kXR_attrMeta
Definition: XProtocol.hh:63
bool IsManager() const
Check whether the location is a manager.
Definition: XrdClXRootDResponses.hh:112
HostInfo()
Definition: XrdClXRootDResponses.hh:798
server node where the file is pending to be online
Definition: XrdClXRootDResponses.hh:48
Manager.
Definition: XrdClXRootDResponses.hh:281
ConstIterator End() const
Get the location end iterator.
Definition: XrdClXRootDResponses.hh:186
Definition: XProtocol.hh:161
uint64_t GetSessionId() const
Definition: XrdClXRootDResponses.hh:713
void Add(ListEntry *entry)
Add an entry to the list - takes ownership.
Definition: XrdClXRootDResponses.hh:602
XRootDStatus(const Status &st, const std::string &message="")
Constructor.
Definition: XrdClXRootDResponses.hh:224
std::string pId
Definition: XrdClXRootDResponses.hh:412
std::string pMessage
Definition: XrdClXRootDResponses.hh:262
Path location info.
Definition: XrdClXRootDResponses.hh:37
const std::string & GetHostAddress() const
Get host address.
Definition: XrdClXRootDResponses.hh:529
uint16_t code
Error type, or additional hints on what to do.
Definition: XrdClStatus.hh:132
uint64_t pModTime
Definition: XrdClXRootDResponses.hh:415
XRootDStatus(uint16_t st=0, uint16_t cod=0, uint32_t errN=0, const std::string &message="")
Constructor.
Definition: XrdClXRootDResponses.hh:214
uint64_t GetNodesRW() const
Get number of nodes that can provide read/write space.
Definition: XrdClXRootDResponses.hh:432
void SetErrorMessage(const std::string &message)
Set the error message.
Definition: XrdClXRootDResponses.hh:240
std::vector< Location > LocationList
List of locations.
Definition: XrdClXRootDResponses.hh:126
Location.
Definition: XrdClXRootDResponses.hh:63
uint8_t pFileHandle[4]
Definition: XrdClXRootDResponses.hh:719
Iterator Begin()
Get the begin iterator.
Definition: XrdClXRootDResponses.hh:618
LocationType pType
Definition: XrdClXRootDResponses.hh:119
Procedure execution status.
Definition: XrdClStatus.hh:104
const std::string & GetName() const
Get file name.
Definition: XrdClXRootDResponses.hh:537
ChunkList & GetChunks()
Get chunks.
Definition: XrdClXRootDResponses.hh:775
LocationType GetType() const
Get location type.
Definition: XrdClXRootDResponses.hh:88
StatInfo * GetStatInfo()
Get the stat info object.
Definition: XrdClXRootDResponses.hh:545
StatInfoVFS(const char *data)
Constructor.
Definition: XProtocol.hh:163
Information returned by file open operation.
Definition: XrdClXRootDResponses.hh:672
#define kXR_isManager
Definition: XProtocol.hh:61
~OpenInfo()
Destructor.
Definition: XrdClXRootDResponses.hh:689
Definition: XProtocol.hh:159
uint32_t GetHostInfo() const
Get host info.
Definition: XrdClXRootDResponses.hh:305
Iterator End()
Get the location end iterator.
Definition: XrdClXRootDResponses.hh:178
void * buffer
length of the chunk
Definition: XrdClXRootDResponses.hh:737
Protocol response.
Definition: XrdClXRootDResponses.hh:273
read access is allowed
Definition: XrdClXRootDResponses.hh:56
ConstIterator Begin() const
Get the begin iterator.
Definition: XrdClXRootDResponses.hh:626
std::string cgi
the cgi that should be appended to the request
Definition: XrdClXRootDResponses.hh:826
uint64_t pSessionId
Definition: XrdClXRootDResponses.hh:720
ConstIterator Begin() const
Get the location begin iterator.
Definition: XrdClXRootDResponses.hh:170
uint32_t GetFlags() const
Get flags.
Definition: XrdClXRootDResponses.hh:368
std::string token
additional token info
Definition: XrdClXRootDResponses.hh:827
ListEntry * At(uint32_t index)
Get an entry at given index.
Definition: XrdClXRootDResponses.hh:610
bool IsServer() const
Check whether the location is a server.
Definition: XrdClXRootDResponses.hh:104
void ParseServerResponse(const char *data)
Definition: XrdClXRootDResponses.hh:796
Definition: XProtocol.hh:158
DirectoryList(const std::string &hostID, const std::string &parent, const char *data)
Constructor.
OpenInfo(const uint8_t *fileHandle, uint64_t sessionId, StatInfo *statInfo=0)
Constructor.
Definition: XrdClXRootDResponses.hh:678
RedirectInfo(const std::string &h, uint16_t p, const std::string &c)
Constructor.
Definition: XrdClXRootDResponses.hh:818
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:808
DirList::iterator Iterator
Directory listing iterator.
Definition: XrdClXRootDResponses.hh:592
DirList pDirList
Definition: XrdClXRootDResponses.hh:665
LocationList pLocations
Definition: XrdClXRootDResponses.hh:202
uint32_t flags
Host type.
Definition: XrdClXRootDResponses.hh:802
void ParseServerResponse(const char *data)
bool TestHostInfo(uint32_t flags)
Test host info flags.
Definition: XrdClXRootDResponses.hh:313
HostTypes
Types of XRootD servers.
Definition: XrdClXRootDResponses.hh:279
ChunkInfo(uint64_t off=0, uint32_t len=0, void *buff=0)
Constructor.
Definition: XrdClXRootDResponses.hh:732
void ParseServerResponse(const std::string &hostId, const char *data)
uint32_t length
offset in the file
Definition: XrdClXRootDResponses.hh:736
LocationList::iterator Iterator
Iterator over locations.
Definition: XrdClXRootDResponses.hh:131
manager node where the file is online
Definition: XrdClXRootDResponses.hh:45
std::string ToString() const
Create a string representation.
Describe a data chunk for vector read.
Definition: XrdClXRootDResponses.hh:727
Request status.
Definition: XrdClXRootDResponses.hh:208
std::string pHostAddress
Definition: XrdClXRootDResponses.hh:567
void ProcessLocation(std::string &location)
void SetStatInfo(StatInfo *info)
Set the stat info object (and transfer the ownership)
Definition: XrdClXRootDResponses.hh:561
ProtocolInfo(uint32_t version, uint32_t hostInfo)
Constructor.
Definition: XrdClXRootDResponses.hh:291
uint32_t pFlags
Definition: XrdClXRootDResponses.hh:414
server node where the file is online
Definition: XrdClXRootDResponses.hh:47
uint32_t pSize
Definition: XrdClXRootDResponses.hh:790
uint32_t protocol
Version of the protocol the host is speaking.
Definition: XrdClXRootDResponses.hh:803
Supervisor attribute.
Definition: XrdClXRootDResponses.hh:285
VFS stat info.
Definition: XrdClXRootDResponses.hh:421
ChunkList pChunks
Definition: XrdClXRootDResponses.hh:789
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:805
const StatInfo * GetStatInfo() const
Get the stat info object.
Definition: XrdClXRootDResponses.hh:553
std::string GetModTimeAsString() const
Get modification time.
Definition: XrdClXRootDResponses.hh:392
~DirectoryList()
Destructor.
std::string pAddress
Definition: XrdClXRootDResponses.hh:118
Iterator End()
Get the end iterator.
Definition: XrdClXRootDResponses.hh:634
Describe the redirection information.
Definition: XrdClXRootDResponses.hh:813
void SetSize(uint32_t size)
Set size.
Definition: XrdClXRootDResponses.hh:767
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
std::string path
path
Definition: XrdClXRootDResponses.hh:825
Flags
Flags.
Definition: XrdClXRootDResponses.hh:332
std::string ToStr() const
Convert to string.
Definition: XrdClXRootDResponses.hh:248
uint64_t GetNodesStaging() const
Get number of nodes that can provide staging space.
Definition: XrdClXRootDResponses.hh:456
#define kXR_attrSuper
Definition: XProtocol.hh:65
Vector read info.
Definition: XrdClXRootDResponses.hh:748
HostInfo(const URL &u, bool lb=false)
Definition: XrdClXRootDResponses.hh:800
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:735
StatInfo * pStatInfo
Definition: XrdClXRootDResponses.hh:721
AccessType pAccess
Definition: XrdClXRootDResponses.hh:120
ConstIterator End() const
Get the end iterator.
Definition: XrdClXRootDResponses.hh:642
std::string pParent
Definition: XrdClXRootDResponses.hh:666
virtual void HandleResponse(XRootDStatus *status, AnyObject *response)
Definition: XrdClXRootDResponses.hh:863
Neither a file nor a directory.
Definition: XrdClXRootDResponses.hh:336
uint64_t pNodesRW
Definition: XrdClXRootDResponses.hh:487
URL representation.
Definition: XrdClURL.hh:30
virtual void HandleResponseWithHosts(XRootDStatus *status, AnyObject *response, HostList *hostList)
Definition: XrdClXRootDResponses.hh:847
uint32_t errNo
Errno, if any.
Definition: XrdClStatus.hh:133
This is a directory.
Definition: XrdClXRootDResponses.hh:335
Read access is allowed.
Definition: XrdClXRootDResponses.hh:340
Buffer BinaryDataInfo
Binary buffer.
Definition: XrdClXRootDResponses.hh:268
std::string host
host the request has been redirected to
Definition: XrdClXRootDResponses.hh:823
Proxy attribute.
Definition: XrdClXRootDResponses.hh:284
uint32_t GetSize() const
Get Size.
Definition: XrdClXRootDResponses.hh:759
Data server.
Definition: XrdClXRootDResponses.hh:282
write access is allowed
Definition: XrdClXRootDResponses.hh:57
uint16_t port
host port
Definition: XrdClXRootDResponses.hh:824
uint32_t pVersion
Definition: XrdClXRootDResponses.hh:319
uint32_t pHostInfo
Definition: XrdClXRootDResponses.hh:320
std::string pName
Definition: XrdClXRootDResponses.hh:568
void ParseServerResponse(const char *data)
LocationType
Describes the node type and file status for a given location.
Definition: XrdClXRootDResponses.hh:43
~ListEntry()
Destructor.
Definition: XrdClXRootDResponses.hh:521
const std::string & GetErrorMessage() const
Get error message.
Definition: XrdClXRootDResponses.hh:232
LocationInfo(const char *data=0)
Constructor.
uint64_t GetFreeRW() const
Get size of the largest contiguous area of free r/w space (in MB)
Definition: XrdClXRootDResponses.hh:440
uint64_t GetSize() const
Get size (in bytes)
Definition: XrdClXRootDResponses.hh:360
uint64_t pSize
Definition: XrdClXRootDResponses.hh:413
DirList::const_iterator ConstIterator
Directory listing const iterator.
Definition: XrdClXRootDResponses.hh:597
uint32_t GetSize() const
Get number of locations.
Definition: XrdClXRootDResponses.hh:146
std::string protocol
protocol
Definition: XrdClXRootDResponses.hh:821
uint64_t GetModTime() const
Get modification time (in seconds since epoch)
Definition: XrdClXRootDResponses.hh:384
void Add(const Location &location)
Add a location.
Definition: XrdClXRootDResponses.hh:194
Executable/searchable bit set.
Definition: XrdClXRootDResponses.hh:334
uint32_t GetVersion() const
Get version info.
Definition: XrdClXRootDResponses.hh:297
VectorReadInfo()
Constructor.
Definition: XrdClXRootDResponses.hh:754
bool loadBalancer
Was the host used as a load balancer.
Definition: XrdClXRootDResponses.hh:804
std::vector< ListEntry * > DirList
Directory listing.
Definition: XrdClXRootDResponses.hh:587
AccessType GetAccessType() const
Get access type.
Definition: XrdClXRootDResponses.hh:96
File is not online (ie. on disk)
Definition: XrdClXRootDResponses.hh:337
const std::string GetId() const
Get id.
Definition: XrdClXRootDResponses.hh:352
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:504
Definition: XProtocol.hh:160
const ChunkList & GetChunks() const
Get chunks.
Definition: XrdClXRootDResponses.hh:783
void GetFileHandle(uint8_t *fileHandle) const
Get the file handle (4bytes)
Definition: XrdClXRootDResponses.hh:697