26 #ifndef __XRD_CL_FILE_SYSTEM_OPERATIONS_HH__
27 #define __XRD_CL_FILE_SYSTEM_OPERATIONS_HH__
44 template<
template<
bool>
class Derived,
bool HasHndl,
typename Response,
typename ... Args>
58 false, Response, Args...>( std::move(
args )... ),
filesystem( std::move( fs ) )
93 template<
bool HasHndl>
108 enum { PathArg, FlagsArg };
129 std::string &path = std::get<PathArg>( this->args ).Get();
131 uint16_t timeout = pipelineTimeout < this->timeout ?
132 pipelineTimeout : this->timeout;
133 return this->filesystem->Locate( path, flags, handler, timeout );
141 template<
bool HasHndl>
143 Resp<LocationInfo>, Arg<std::string>, Arg<OpenFlags::Flags>>
177 std::string &path = std::get<PathArg>( this->
args ).Get();
179 uint16_t
timeout = pipelineTimeout < this->timeout ?
180 pipelineTimeout : this->
timeout;
189 template<
bool HasHndl>
225 std::string &source = std::get<SourceArg>( this->
args ).Get();
226 std::string &dest = std::get<DestArg>( this->
args ).Get();
227 uint16_t
timeout = pipelineTimeout < this->timeout ?
228 pipelineTimeout : this->
timeout;
237 template<
bool HasHndl>
239 Arg<QueryCode::Code>, Arg<Buffer>>
274 const Buffer &buffer( std::get<BufferArg>( this->
args ).Get() );
275 uint16_t
timeout = pipelineTimeout < this->timeout ?
276 pipelineTimeout : this->
timeout;
285 template<
bool HasHndl>
287 Arg<std::string>, Arg<uint64_t>>
321 std::string &path = std::get<PathArg>( this->
args ).Get();
322 uint64_t size = std::get<SizeArg>( this->
args ).Get();
323 uint16_t
timeout = pipelineTimeout < this->timeout ?
324 pipelineTimeout : this->
timeout;
338 template<
bool HasHndl>
372 std::string &path = std::get<PathArg>( this->
args ).Get();
373 uint16_t
timeout = pipelineTimeout < this->timeout ?
374 pipelineTimeout : this->
timeout;
383 template<
bool HasHndl>
385 Arg<std::string>, Arg<MkDirFlags::Flags>, Arg<Access::Mode>>
419 std::string &path = std::get<PathArg>( this->
args ).Get();
422 uint16_t
timeout = pipelineTimeout < this->timeout ?
423 pipelineTimeout : this->
timeout;
432 template<
bool HasHndl>
467 std::string &path = std::get<PathArg>( this->
args ).Get();
468 uint16_t
timeout = pipelineTimeout < this->timeout ?
469 pipelineTimeout : this->
timeout;
478 template<
bool HasHndl>
480 Arg<std::string>, Arg<Access::Mode>>
514 std::string &path = std::get<PathArg>( this->
args ).Get();
516 uint16_t
timeout = pipelineTimeout < this->timeout ?
517 pipelineTimeout : this->
timeout;
526 template<
bool HasHndl>
555 uint16_t
timeout = pipelineTimeout < this->timeout ?
556 pipelineTimeout : this->
timeout;
565 template<
bool HasHndl>
601 std::string &path = std::get<PathArg>( this->
args ).Get();
602 uint16_t
timeout = pipelineTimeout < this->timeout ?
603 pipelineTimeout : this->
timeout;
616 template<
bool HasHndl>
618 Resp<StatInfoVFS>, Arg<std::string>>
652 std::string &path = std::get<PathArg>( this->
args ).Get();
653 uint16_t
timeout = pipelineTimeout < this->timeout ?
654 pipelineTimeout : this->
timeout;
663 template<
bool HasHndl>
693 uint16_t
timeout = pipelineTimeout < this->timeout ?
694 pipelineTimeout : this->
timeout;
703 template<
bool HasHndl>
705 Arg<std::string>, Arg<DirListFlags::Flags>>
739 std::string &path = std::get<PathArg>( this->
args ).Get();
741 uint16_t
timeout = pipelineTimeout < this->timeout ?
742 pipelineTimeout : this->
timeout;
751 template<
bool HasHndl>
787 std::string &info = std::get<InfoArg>( this->
args ).Get();
788 uint16_t
timeout = pipelineTimeout < this->timeout ?
789 pipelineTimeout : this->
timeout;
798 template<
bool HasHndl>
800 Arg<std::vector<std::string>>, Arg<PrepareFlags::Flags>, Arg<uint8_t>>
834 std::vector<std::string> &fileList = std::get<FileListArg>( this->
args ).Get();
836 uint8_t priority = std::get<PriorityArg>( this->
args ).Get();
837 uint16_t
timeout = pipelineTimeout < this->timeout ?
838 pipelineTimeout : this->
timeout;
839 return this->
filesystem->Prepare( fileList, flags, priority,
848 template<
bool HasHndl>
850 Arg<std::string>, Arg<std::string>, Arg<std::string>>
870 return "SetXAttrFsImpl";
884 std::string &path = std::get<PathArg>( this->
args ).Get();
885 std::string &name = std::get<NameArg>( this->
args ).Get();
886 std::string &value = std::get<ValueArg>( this->
args ).Get();
888 std::vector<xattr_t> attrs;
889 attrs.push_back(
xattr_t( name, value ) );
892 uint16_t
timeout = pipelineTimeout < this->timeout ?
893 pipelineTimeout : this->
timeout;
895 if( !st.
IsOK() )
delete h;
908 std::move( value ) );
914 template<
bool HasHndl>
916 Resp<std::vector<XAttrStatus>>, Arg<std::string>, Arg<std::vector<xattr_t>>>
936 return "SetXAttrBulkImpl";
949 std::string &path = std::get<PathArg>( this->
args ).Get();
950 std::vector<xattr_t> &attrs = std::get<AttrsArg>( this->
args ).Get();
951 uint16_t
timeout = pipelineTimeout < this->timeout ?
952 pipelineTimeout : this->
timeout;
962 Arg<std::vector<xattr_t>> attrs )
970 template<
bool HasHndl>
972 Arg<std::string>, Arg<std::string>>
992 return "GetXAttrFsImpl";
1004 std::string &path = std::get<PathArg>( this->
args ).Get();
1005 std::string &name = std::get<NameArg>( this->
args ).Get();
1007 std::vector<std::string> attrs;
1008 attrs.push_back( name );
1011 uint16_t
timeout = pipelineTimeout < this->timeout ?
1012 pipelineTimeout : this->
timeout;
1014 if( !st.
IsOK() )
delete h;
1032 template<
bool HasHndl>
1034 Resp<std::vector<XAttr>>, Arg<std::string>, Arg<std::vector<std::string>>>
1054 return "GetXAttrFsBulkImpl";
1067 std::string &path = std::get<PathArg>( this->
args ).Get();
1068 std::vector<std::string> &attrs = std::get<NamesArg>( this->
args ).Get();
1069 uint16_t
timeout = pipelineTimeout < this->timeout ?
1070 pipelineTimeout : this->
timeout;
1080 Arg<std::vector<std::string>> attrs )
1088 template<
bool HasHndl>
1090 Arg<std::string>, Arg<std::string>>
1110 return "DelXAttrFsImpl";
1124 std::string &path = std::get<PathArg>( this->
args ).Get();
1125 std::string &name = std::get<NameArg>( this->
args ).Get();
1127 std::vector<std::string> attrs;
1128 attrs.push_back( name );
1131 uint16_t
timeout = pipelineTimeout < this->timeout ?
1132 pipelineTimeout : this->
timeout;
1134 if( !st.
IsOK() )
delete h;
1152 template<
bool HasHndl>
1154 Resp<std::vector<XAttrStatus>>, Arg<std::string>, Arg<std::vector<std::string>>>
1174 return "DelXAttrBulkImpl";
1189 std::string &path = std::get<PathArg>( this->
args ).Get();
1190 std::vector<std::string> &attrs = std::get<NamesArg>( this->
args ).Get();
1191 uint16_t
timeout = pipelineTimeout < this->timeout ?
1192 pipelineTimeout : this->
timeout;
1202 Arg<std::vector<std::string>> attrs )
1210 template<
bool HasHndl>
1212 Resp<std::vector<XAttr>>, Arg<std::string>>
1232 return "ListXAttrFsImpl";
1246 std::string &path = std::get<PathArg>( this->
args ).Get();
1247 uint16_t
timeout = pipelineTimeout < this->timeout ?
1248 pipelineTimeout : this->
timeout;
Binary blob representation.
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
std::tuple< Args... > args
Operation arguments.
uint16_t timeout
Operation timeout.
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
DelXAttr bulk operation (.
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
Ctx< FileSystem > filesystem
The file system object itself.
virtual ~FileSystemOperation()
Destructor.
FileSystemOperation(FileSystemOperation< Derived, from, Response, Args... > &&op)
FileSystemOperation(Ctx< FileSystem > fs, Args... args)
friend class FileSystemOperation
GetXAttr bulk operation (.
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
ListXAttr bulk operation (.
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
std::unique_ptr< PipelineHandler > handler
Operation handler.
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
SetXAttr bulk operation (.
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
XRootDStatus RunImpl(PipelineHandler *handler, uint16_t pipelineTimeout)
Helper class for unpacking single XAttrStatus from bulk response.
Helper class for unpacking single XAttr from bulk response.
DelXAttrImpl< false > DelXAttr(Ctx< File > file, Arg< std::string > name)
SendInfoImpl< false > SendInfo
StatImpl< false > Stat(Ctx< File > file, Arg< bool > force, uint16_t timeout=0)
SetXAttrImpl< false > SetXAttr(Ctx< File > file, Arg< std::string > name, Arg< std::string > value)
LocateImpl< false > Locate
GetXAttrImpl< false > GetXAttr(Ctx< File > file, Arg< std::string > name)
DeepLocateImpl< false > DeepLocate
ProtocolImpl< false > Protocol
std::tuple< std::string, std::string > xattr_t
Extended attribute key - value pair.
PrepareImpl< false > Prepare
StatVFSImpl< false > StatVFS
TruncateImpl< false > Truncate(Ctx< File > file, Arg< uint64_t > size, uint16_t timeout)
ListXAttrImpl< false > ListXAttr(Ctx< File > file)
DirListImpl< false > DirList
Utility class for storing a pointer to operation context.
Flags
Open flags, may be or'd when appropriate.
Code
XRootD query request codes.
bool IsOK() const
We're fine.