xrootd
XrdClCopyJob.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// 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_JOB_HH__
26#define __XRD_CL_COPY_JOB_HH__
27
29
30namespace XrdCl
31{
32 //----------------------------------------------------------------------------
34 //----------------------------------------------------------------------------
35 class CopyJob
36 {
37 public:
38 //------------------------------------------------------------------------
40 //------------------------------------------------------------------------
41 CopyJob( uint16_t jobId,
42 PropertyList *jobProperties,
43 PropertyList *jobResults ):
44 pProperties( jobProperties ),
45 pResults( jobResults ),
46 pJobId( jobId )
47 {
48 pProperties->Get( "source", pSource );
49 pProperties->Get( "target", pTarget );
50 }
51
52 //------------------------------------------------------------------------
54 //------------------------------------------------------------------------
55 virtual ~CopyJob()
56 {
57 }
58
59 //------------------------------------------------------------------------
64 //------------------------------------------------------------------------
65 virtual XRootDStatus Run( CopyProgressHandler *progress = 0 ) = 0;
66
67 //------------------------------------------------------------------------
69 //------------------------------------------------------------------------
71 {
72 return pProperties;
73 }
74
75 //------------------------------------------------------------------------
77 //------------------------------------------------------------------------
79 {
80 return pResults;
81 }
82
83 //------------------------------------------------------------------------
85 //------------------------------------------------------------------------
86 const URL &GetSource() const
87 {
88 return pSource;
89 }
90
91 //------------------------------------------------------------------------
93 //------------------------------------------------------------------------
94 const URL &GetTarget() const
95 {
96 return pTarget;
97 }
98
99 protected:
104 uint16_t pJobId;
105 };
106}
107
108#endif // __XRD_CL_COPY_JOB_HH__
Copy job.
Definition: XrdClCopyJob.hh:36
virtual ~CopyJob()
Virtual destructor.
Definition: XrdClCopyJob.hh:55
PropertyList * pResults
Definition: XrdClCopyJob.hh:101
PropertyList * GetResults()
Get the job results.
Definition: XrdClCopyJob.hh:78
virtual XRootDStatus Run(CopyProgressHandler *progress=0)=0
URL pSource
Definition: XrdClCopyJob.hh:102
uint16_t pJobId
Definition: XrdClCopyJob.hh:104
PropertyList * GetProperties()
Get the job properties.
Definition: XrdClCopyJob.hh:70
URL pTarget
Definition: XrdClCopyJob.hh:103
const URL & GetSource() const
Get source.
Definition: XrdClCopyJob.hh:86
CopyJob(uint16_t jobId, PropertyList *jobProperties, PropertyList *jobResults)
Constructor.
Definition: XrdClCopyJob.hh:41
const URL & GetTarget() const
Get target.
Definition: XrdClCopyJob.hh:94
PropertyList * pProperties
Definition: XrdClCopyJob.hh:100
Interface for copy progress notification.
Definition: XrdClCopyProcess.hh:42
A key-value pair map storing both keys and values as strings.
Definition: XrdClPropertyList.hh:41
bool Get(const std::string &name, Item &item) const
Definition: XrdClPropertyList.hh:65
URL representation.
Definition: XrdClURL.hh:31
Request status.
Definition: XrdClXRootDResponses.hh:213
Definition: XrdClAnyObject.hh:26