Skip to content
Snippets Groups Projects
Commit 775eb6d2 authored by Steven Murray's avatar Steven Murray
Browse files

Created teh remotestorage directory

parent a6db7fd5
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,7 @@ add_subdirectory(cmdline)
add_subdirectory(common)
add_subdirectory(objectstore)
add_subdirectory(nameserver)
add_subdirectory(remotestorage)
add_subdirectory(scheduler)
add_subdirectory(tests)
add_subdirectory(xroot_plugins)
cmake_minimum_required (VERSION 2.6)
set (CTA_REMOTE_STORAGE_SRC_FILES
EosRemoteStorage.cpp
MockRemoteStorage.cpp
RemoteStorage.cpp)
add_library (ctaremotestorage SHARED
${CTA_REMOTE_STORAGE_SRC_FILES})
......@@ -16,9 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scheduler/EosRemoteStorage.hpp"
#include "common/exception/Exception.hpp"
using cta::exception::Exception;
#include "remotestorage/EosRemoteStorage.hpp"
//------------------------------------------------------------------------------
// destructor
......@@ -27,10 +26,18 @@ cta::EosRemoteStorage::~EosRemoteStorage() throw() {
}
//------------------------------------------------------------------------------
// fileExists
// regularFileExists
//------------------------------------------------------------------------------
bool cta::EosRemoteStorage::fileExists(const std::string &remoteFile) {
throw Exception("EosRemoteStorage::fileExists() not implemented");
bool cta::EosRemoteStorage::regularFileExists(const std::string &remoteFile)
const {
throw exception::Exception(std::string(__FUNCTION__) + " not implemented");
}
//------------------------------------------------------------------------------
// dirExists
//------------------------------------------------------------------------------
bool cta::EosRemoteStorage::dirExists(const std::string &remoteFile) const {
throw exception::Exception(std::string(__FUNCTION__) + " not implemented");
}
//------------------------------------------------------------------------------
......@@ -38,5 +45,5 @@ bool cta::EosRemoteStorage::fileExists(const std::string &remoteFile) {
//------------------------------------------------------------------------------
void cta::EosRemoteStorage::rename(const std::string &remoteFile,
const std::string &newRemoteFile) {
throw Exception("EosRemoteStorage::rename() not implemented");
throw exception::Exception(std::string(__FUNCTION__) + " not implemented");
}
......@@ -18,7 +18,7 @@
#pragma once
#include "scheduler/RemoteStorage.hpp"
#include "remotestorage/RemoteStorage.hpp"
namespace cta {
......@@ -34,12 +34,20 @@ public:
~EosRemoteStorage() throw();
/**
* Returns true if the specified remote file exists or false if not.
* Returns true if the specified regular file exists.
*
* @param remoteFile The URL of the remote file.
* @return true if the specified remote file exists or false if not.
* @param path The absolute path of the file.
* @return True if the specified directory exists.
*/
bool fileExists(const std::string &remoteFile);
bool regularFileExists(const std::string &path) const;
/**
* Returns true if the specified directory exists.
*
* @param path The absolute path of the file.
* @return True if the specified directory exists.
*/
bool dirExists(const std::string &path) const;
/**
* Renames the specified remote file to the specified new name.
......
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "common/exception/Exception.hpp"
#include "remotestorage/MockRemoteStorage.hpp"
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::MockRemoteStorage::~MockRemoteStorage() throw() {
}
//------------------------------------------------------------------------------
// regularFileExists
//------------------------------------------------------------------------------
bool cta::MockRemoteStorage::regularFileExists(const std::string &remoteFile)
const {
throw exception::Exception(std::string(__FUNCTION__) + " not implemented");
}
//------------------------------------------------------------------------------
// dirExists
//------------------------------------------------------------------------------
bool cta::MockRemoteStorage::dirExists(const std::string &remoteFile) const {
throw exception::Exception(std::string(__FUNCTION__) + " not implemented");
}
//------------------------------------------------------------------------------
// rename
//------------------------------------------------------------------------------
void cta::MockRemoteStorage::rename(const std::string &remoteFile,
const std::string &newRemoteFile) {
throw exception::Exception(std::string(__FUNCTION__) + " not implemented");
}
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "remotestorage/RemoteStorage.hpp"
namespace cta {
/**
* A mock proxy class for a remote storage system.
*/
class MockRemoteStorage: public RemoteStorage {
public:
/**
* Destructor.
*/
~MockRemoteStorage() throw();
/**
* Returns true if the specified regular file exists.
*
* @param path The absolute path of the file.
* @return True if the specified directory exists.
*/
bool regularFileExists(const std::string &path) const;
/**
* Returns true if the specified directory exists.
*
* @param path The absolute path of the file.
* @return True if the specified directory exists.
*/
bool dirExists(const std::string &path) const;
/**
* Renames the specified remote file to the specified new name.
*
* @param remoteFile The current URL of the remote file.
* @param newRemoteFile The new URL of the remote file.
*/
void rename(const std::string &remoteFile,
const std::string &newRemoteFile);
}; // class MockRemoteStorage
} // namespace cta
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scheduler/RemoteStorage.hpp"
#include "remotestorage/RemoteStorage.hpp"
//------------------------------------------------------------------------------
// destructor
......
......@@ -34,12 +34,20 @@ public:
virtual ~RemoteStorage() throw() = 0;
/**
* Returns true if the specified remote file exists or false if not.
* Returns true if the specified regular file exists.
*
* @param remoteFile The URL of the remote file.
* @return true if the specified remote file exists or false if not.
* @param path The absolute path of the file.
* @return True if the specified directory exists.
*/
virtual bool fileExists(const std::string &remoteFile) = 0;
virtual bool regularFileExists(const std::string &path) const = 0;
/**
* Returns true if the specified directory exists.
*
* @param path The absolute path of the file.
* @return True if the specified directory exists.
*/
virtual bool dirExists(const std::string &path) const = 0;
/**
* Renames the specified remote file to the specified new name.
......
......@@ -20,7 +20,6 @@ set (CTA_SCHEDULER_SRC_FILES
DirIterator.cpp
DiskException.cpp
DriveQuota.cpp
EosRemoteStorage.cpp
FileAttribute.cpp
FileSystemDirEntry.cpp
FileSystemNode.cpp
......@@ -32,7 +31,6 @@ set (CTA_SCHEDULER_SRC_FILES
MockSchedulerDatabaseFactory.cpp
Mount.cpp
MountCriteria.cpp
RemoteStorage.cpp
RetrievalFileTransfer.cpp
RetrievalMount.cpp
RetrieveRequest.cpp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment