xrootd
Loading...
Searching...
No Matches
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 Init();
49 }
50
51 //------------------------------------------------------------------------
53 //------------------------------------------------------------------------
54 virtual ~CopyJob()
55 {
56 }
57
58 //------------------------------------------------------------------------
59 // Initialize members
60 //------------------------------------------------------------------------
61 inline void Init()
62 {
63 pProperties->Get( "source", pSource );
64 pProperties->Get( "target", pTarget );
65 }
66
67 //------------------------------------------------------------------------
72 //------------------------------------------------------------------------
73 virtual XRootDStatus Run( CopyProgressHandler *progress = 0 ) = 0;
74
75 //------------------------------------------------------------------------
77 //------------------------------------------------------------------------
79 {
80 return pProperties;
81 }
82
83 //------------------------------------------------------------------------
85 //------------------------------------------------------------------------
87 {
88 return pResults;
89 }
90
91 //------------------------------------------------------------------------
93 //------------------------------------------------------------------------
94 const URL &GetSource() const
95 {
96 return pSource;
97 }
98
99 //------------------------------------------------------------------------
101 //------------------------------------------------------------------------
102 const URL &GetTarget() const
103 {
104 return pTarget;
105 }
106
107 protected:
112 uint16_t pJobId;
113 };
114}
115
116#endif // __XRD_CL_COPY_JOB_HH__
Copy job.
Definition XrdClCopyJob.hh:36
virtual ~CopyJob()
Virtual destructor.
Definition XrdClCopyJob.hh:54
PropertyList * pResults
Definition XrdClCopyJob.hh:109
PropertyList * GetResults()
Get the job results.
Definition XrdClCopyJob.hh:86
virtual XRootDStatus Run(CopyProgressHandler *progress=0)=0
URL pSource
Definition XrdClCopyJob.hh:110
uint16_t pJobId
Definition XrdClCopyJob.hh:112
PropertyList * GetProperties()
Get the job properties.
Definition XrdClCopyJob.hh:78
URL pTarget
Definition XrdClCopyJob.hh:111
const URL & GetSource() const
Get source.
Definition XrdClCopyJob.hh:94
void Init()
Definition XrdClCopyJob.hh:61
CopyJob(uint16_t jobId, PropertyList *jobProperties, PropertyList *jobResults)
Constructor.
Definition XrdClCopyJob.hh:41
const URL & GetTarget() const
Get target.
Definition XrdClCopyJob.hh:102
PropertyList * pProperties
Definition XrdClCopyJob.hh:108
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:219
Definition XrdClAction.hh:34