00001 //------------------------------------------------------------------------------ 00002 // Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN) 00003 // Author: Lukasz Janyst <ljanyst@cern.ch> 00004 //----------------------------------------------------------------------------- 00005 // This file is part of the XRootD software suite. 00006 // 00007 // XRootD is free software: you can redistribute it and/or modify 00008 // it under the terms of the GNU Lesser General Public License as published by 00009 // the Free Software Foundation, either version 3 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // XRootD is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Lesser General Public License 00018 // along with XRootD. If not, see <http://www.gnu.org/licenses/>. 00019 // 00020 // In applying this licence, CERN does not waive the privileges and immunities 00021 // granted to it by virtue of its status as an Intergovernmental Organization 00022 // or submit itself to any jurisdiction. 00023 //------------------------------------------------------------------------------ 00024 00025 #ifndef __XRD_CL_COPY_JOB_HH__ 00026 #define __XRD_CL_COPY_JOB_HH__ 00027 00028 #include "XrdCl/XrdClPropertyList.hh" 00029 00030 namespace XrdCl 00031 { 00032 //---------------------------------------------------------------------------- 00034 //---------------------------------------------------------------------------- 00035 class CopyJob 00036 { 00037 public: 00038 //------------------------------------------------------------------------ 00040 //------------------------------------------------------------------------ 00041 CopyJob( uint16_t jobId, 00042 PropertyList *jobProperties, 00043 PropertyList *jobResults ): 00044 pProperties( jobProperties ), 00045 pResults( jobResults ), 00046 pJobId( jobId ) 00047 { 00048 pProperties->Get( "source", pSource ); 00049 pProperties->Get( "target", pTarget ); 00050 } 00051 00052 //------------------------------------------------------------------------ 00054 //------------------------------------------------------------------------ 00055 virtual ~CopyJob() 00056 { 00057 } 00058 00059 //------------------------------------------------------------------------ 00064 //------------------------------------------------------------------------ 00065 virtual XRootDStatus Run( CopyProgressHandler *progress = 0 ) = 0; 00066 00067 //------------------------------------------------------------------------ 00069 //------------------------------------------------------------------------ 00070 PropertyList *GetProperties() 00071 { 00072 return pProperties; 00073 } 00074 00075 //------------------------------------------------------------------------ 00077 //------------------------------------------------------------------------ 00078 PropertyList *GetResults() 00079 { 00080 return pResults; 00081 } 00082 00083 //------------------------------------------------------------------------ 00085 //------------------------------------------------------------------------ 00086 const URL &GetSource() const 00087 { 00088 return pSource; 00089 } 00090 00091 //------------------------------------------------------------------------ 00093 //------------------------------------------------------------------------ 00094 const URL &GetTarget() const 00095 { 00096 return pTarget; 00097 } 00098 00099 protected: 00100 PropertyList *pProperties; 00101 PropertyList *pResults; 00102 URL pSource; 00103 URL pTarget; 00104 uint16_t pJobId; 00105 }; 00106 } 00107 00108 #endif // __XRD_CL_COPY_JOB_HH__