XRootD
Loading...
Searching...
No Matches
XrdClThirdPartyCopyPlugIn.cc
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// Copyright (c) 2026 by European Organization for Nuclear Research (CERN)
3//------------------------------------------------------------------------------
4// This file is part of the XRootD software suite.
5//
6// XRootD is free software: you can redistribute it and/or modify
7// it under the terms of the GNU Lesser General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10//
11// XRootD is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU Lesser General Public License
17// along with XRootD. If not, see <http://www.gnu.org/licenses/>.
18//
19// In applying this licence, CERN does not waive the privileges and immunities
20// granted to it by virtue of its status as an Intergovernmental Organization
21// or submit itself to any jurisdiction.
22//------------------------------------------------------------------------------
23
25
29#include "XrdCl/XrdClURL.hh"
30
31#include <memory>
32
33namespace XrdCl
34{
35 //----------------------------------------------------------------------------
36 // Destructor anchors the vtable and typeinfo in libXrdCl so that the
37 // dynamic_cast below works on plug-in objects from dlopened libraries.
38 //----------------------------------------------------------------------------
40
42
43 //----------------------------------------------------------------------------
44 // Run a third party copy through the plug-in registered for the source URL
45 //----------------------------------------------------------------------------
47 const URL &dest,
48 const PropertyList *properties,
49 ProgressHandler *progress_handler,
50 time_t timeout )
51 {
53 if( !fact )
55
56 std::unique_ptr<FileSystemPlugIn> fs( fact->CreateFileSystem( source.GetURL() ) );
57 auto *tpc = dynamic_cast<ThirdPartyCopyPlugIn*>( fs.get() );
58 if( !tpc )
60
61 return tpc->ThirdPartyCopy( source.GetURL(), dest.GetURL(), properties,
62 progress_handler, timeout );
63 }
64}
static PlugInManager * GetPlugInManager()
Get plug-in manager.
virtual FileSystemPlugIn * CreateFileSystem(const std::string &url)=0
Create a file system plug-in for the given URL.
PlugInFactory * GetFactory(const std::string url)
Handle the progress of an asynchronous operation.
A key-value pair map storing both keys and values as strings.
URL representation.
Definition XrdClURL.hh:31
std::string GetURL() const
Get the URL.
Definition XrdClURL.hh:86
XRootDStatus(uint16_t st=0, uint16_t code=0, uint32_t errN=0, const std::string &message="")
Constructor.
const uint16_t stError
An error occurred that could potentially be retried.
XRootDStatus ThirdPartyCopy(const URL &source, const URL &dest, const PropertyList *properties, ProgressHandler *progress_handler, time_t timeout)
const uint16_t errNotSupported