//------------------------------------------------------------------------------ //! @file RainFilePlugin.hh //! @author Elvin Sindrilaru //------------------------------------------------------------------------------ /************************************************************************ * EOS - the CERN Disk Storage System * * Copyright (C) 2014 CERN/Switzerland * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see .* ************************************************************************/ #ifndef __EOSFST_XRDCLPLUGINS_RAINFILEPLUGIN_HH__ #define __EOSFST_XRDCLPLUGINS_RAINFILEPLUGIN_HH__ /*----------------------------------------------------------------------------*/ #include "fst/Namespace.hh" #include "common/Logging.hh" #include "XrdCl/XrdClPlugInInterface.hh" /*----------------------------------------------------------------------------*/ using namespace XrdCl; // Forward declaration namespace eos { namespace fst { class RainMetaLayout; } } EOSFSTNAMESPACE_BEGIN //---------------------------------------------------------------------------- //! RAIN file plugin //---------------------------------------------------------------------------- class RainFile: public XrdCl::FilePlugIn, eos::common::LogId { public: //---------------------------------------------------------------------------- //! Constructor //---------------------------------------------------------------------------- RainFile(); //---------------------------------------------------------------------------- //! Destructor //---------------------------------------------------------------------------- virtual ~RainFile(); //---------------------------------------------------------------------------- //! Open //---------------------------------------------------------------------------- virtual XRootDStatus Open(const std::string& url, OpenFlags::Flags flags, Access::Mode mode, ResponseHandler* handler, uint16_t timeout); //---------------------------------------------------------------------------- //! Close //---------------------------------------------------------------------------- virtual XRootDStatus Close(ResponseHandler* handler, uint16_t timeout); //---------------------------------------------------------------------------- //! Stat //---------------------------------------------------------------------------- virtual XRootDStatus Stat(bool force, ResponseHandler* handler, uint16_t timeout); //---------------------------------------------------------------------------- //! Read //---------------------------------------------------------------------------- virtual XRootDStatus Read(uint64_t offset, uint32_t size, void* buffer, ResponseHandler* handler, uint16_t timeout); //---------------------------------------------------------------------------- //! Write //---------------------------------------------------------------------------- virtual XRootDStatus Write(uint64_t offset, uint32_t size, const void* buffer, ResponseHandler* handler, uint16_t timeout); //---------------------------------------------------------------------------- //! Sync //---------------------------------------------------------------------------- virtual XRootDStatus Sync(ResponseHandler* handler, uint16_t timeout); //---------------------------------------------------------------------------- //! Truncate //---------------------------------------------------------------------------- virtual XRootDStatus Truncate(uint64_t size, ResponseHandler* handler, uint16_t timeout); //---------------------------------------------------------------------------- //! VectorRead //---------------------------------------------------------------------------- virtual XRootDStatus VectorRead(const ChunkList& chunks, void* buffer, ResponseHandler* handler, uint16_t timeout); //------------------------------------------------------------------------ //! Fcntl //------------------------------------------------------------------------ virtual XRootDStatus Fcntl(const Buffer& arg, ResponseHandler* handler, uint16_t timeout); //---------------------------------------------------------------------------- //! Visa //---------------------------------------------------------------------------- virtual XRootDStatus Visa(ResponseHandler* handler, uint16_t timeout); //---------------------------------------------------------------------------- //! IsOpen //---------------------------------------------------------------------------- virtual bool IsOpen() const; //---------------------------------------------------------------------------- //! @see XrdCl::File::SetProperty //---------------------------------------------------------------------------- virtual bool SetProperty(const std::string& name, const std::string& value); //---------------------------------------------------------------------------- //! @see XrdCl::File::GetProperty //---------------------------------------------------------------------------- virtual bool GetProperty(const std::string& name, std::string& value) const; //---------------------------------------------------------------------------- //! @see XrdCl::File::GetDataServer //---------------------------------------------------------------------------- virtual std::string GetDataServer() const; //---------------------------------------------------------------------------- //! @see XrdCl::File::GetLastURL //---------------------------------------------------------------------------- virtual URL GetLastURL() const; private: bool mIsOpen; XrdCl::File* pFile; eos::fst::RainMetaLayout* pRainFile; }; EOSFSTNAMESPACE_END #endif // __EOSFST_XRDCLPLUGINS_RAINFILEPLUGIN_HH__