xrootd
XrdClCopyProcess.hh
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// Copyright (c) 2011-2014 by European Organization for Nuclear Research (CERN)
3// Author: Lukasz Janyst <ljanyst@cern.ch>
4//------------------------------------------------------------------------------
5// This file is part of the XRootD software suite.
6//
7// XRootD is free software: you can redistribute it and/or modify
8// it under the terms of the GNU Lesser General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// XRootD is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU Lesser General Public License
18// along with XRootD. If not, see <http://www.gnu.org/licenses/>.
19//
20// In applying this licence, CERN does not waive the privileges and immunities
21// granted to it by virtue of its status as an Intergovernmental Organization
22// or submit itself to any jurisdiction.
23//------------------------------------------------------------------------------
24
25#ifndef __XRD_CL_COPY_PROCESS_HH__
26#define __XRD_CL_COPY_PROCESS_HH__
27
28#include "XrdCl/XrdClURL.hh"
31#include <stdint.h>
32#include <vector>
33
34namespace XrdCl
35{
36 class CopyJob;
37
38 //----------------------------------------------------------------------------
40 //----------------------------------------------------------------------------
42 {
43 public:
45
46 //------------------------------------------------------------------------
53 //------------------------------------------------------------------------
54 virtual void BeginJob( uint16_t jobNum,
55 uint16_t jobTotal,
56 const URL *source,
57 const URL *destination )
58 {
59 (void)jobNum; (void)jobTotal; (void)source; (void)destination;
60 };
61
62 //------------------------------------------------------------------------
67 //------------------------------------------------------------------------
68 virtual void EndJob( uint16_t jobNum,
69 const PropertyList *result )
70 {
71 (void)jobNum; (void)result;
72 };
73
74 //------------------------------------------------------------------------
81 //------------------------------------------------------------------------
82 virtual void JobProgress( uint16_t jobNum,
83 uint64_t bytesProcessed,
84 uint64_t bytesTotal )
85 {
86 (void)jobNum; (void)bytesProcessed; (void)bytesTotal;
87 };
88
89 //------------------------------------------------------------------------
91 //------------------------------------------------------------------------
92 virtual bool ShouldCancel( uint16_t jobNum )
93 {
94 (void)jobNum;
95 return false;
96 }
97 };
98
99 //----------------------------------------------------------------------------
101 //----------------------------------------------------------------------------
103 {
104 public:
105 //------------------------------------------------------------------------
107 //------------------------------------------------------------------------
109
110 //------------------------------------------------------------------------
112 //------------------------------------------------------------------------
113 virtual ~CopyProcess();
114
115 //------------------------------------------------------------------------
161 //------------------------------------------------------------------------
162 XRootDStatus AddJob( const PropertyList &properties,
163 PropertyList *results );
164
165 //------------------------------------------------------------------------
166 // Prepare the copy jobs
167 //------------------------------------------------------------------------
169
170 //------------------------------------------------------------------------
172 //------------------------------------------------------------------------
174
175 private:
177 std::vector<PropertyList> pJobProperties;
178 std::vector<PropertyList*> pJobResults;
179 std::vector<CopyJob*> pJobs;
180 };
181}
182
183#endif // __XRD_CL_COPY_PROCESS_HH__
Copy the data from one point to another.
Definition: XrdClCopyProcess.hh:103
CopyProcess()
Constructor.
Definition: XrdClCopyProcess.hh:108
std::vector< CopyJob * > pJobs
Definition: XrdClCopyProcess.hh:179
XRootDStatus Run(CopyProgressHandler *handler)
Run the copy jobs.
std::vector< PropertyList * > pJobResults
Definition: XrdClCopyProcess.hh:178
virtual ~CopyProcess()
Destructor.
XRootDStatus Prepare()
std::vector< PropertyList > pJobProperties
Definition: XrdClCopyProcess.hh:177
XRootDStatus AddJob(const PropertyList &properties, PropertyList *results)
Interface for copy progress notification.
Definition: XrdClCopyProcess.hh:42
virtual ~CopyProgressHandler()
Definition: XrdClCopyProcess.hh:44
virtual void JobProgress(uint16_t jobNum, uint64_t bytesProcessed, uint64_t bytesTotal)
Definition: XrdClCopyProcess.hh:82
virtual bool ShouldCancel(uint16_t jobNum)
Determine whether the job should be canceled.
Definition: XrdClCopyProcess.hh:92
virtual void BeginJob(uint16_t jobNum, uint16_t jobTotal, const URL *source, const URL *destination)
Definition: XrdClCopyProcess.hh:54
virtual void EndJob(uint16_t jobNum, const PropertyList *result)
Definition: XrdClCopyProcess.hh:68
A key-value pair map storing both keys and values as strings.
Definition: XrdClPropertyList.hh:41
URL representation.
Definition: XrdClURL.hh:31
Request status.
Definition: XrdClXRootDResponses.hh:213
Definition: XrdClAnyObject.hh:26