Commit bb7ad95c authored by Daniele Kruse's avatar Daniele Kruse
Browse files

Removed the new mount and job classes

parent 6bddcf94
......@@ -28,7 +28,6 @@
#include "common/dataStructures/ArchiveFile.hpp"
#include "common/dataStructures/ArchiveFileSummary.hpp"
#include "common/dataStructures/ArchiveJob.hpp"
#include "common/dataStructures/ArchiveMount.hpp"
#include "common/dataStructures/ArchiveRequest.hpp"
#include "common/dataStructures/ArchiveRoute.hpp"
#include "common/dataStructures/CancelRetrieveRequest.hpp"
......@@ -46,13 +45,11 @@
#include "common/dataStructures/RepackType.hpp"
#include "common/dataStructures/Requester.hpp"
#include "common/dataStructures/RetrieveJob.hpp"
#include "common/dataStructures/RetrieveMount.hpp"
#include "common/dataStructures/RetrieveRequest.hpp"
#include "common/dataStructures/SecurityIdentity.hpp"
#include "common/dataStructures/StorageClass.hpp"
#include "common/dataStructures/TapeFileLocation.hpp"
#include "common/dataStructures/Tape.hpp"
#include "common/dataStructures/TapeMount.hpp"
#include "common/dataStructures/TapePool.hpp"
#include "common/dataStructures/UpdateFileInfoRequest.hpp"
#include "common/dataStructures/UserGroup.hpp"
......
......@@ -6,7 +6,6 @@ set (COMMON_LIB_SRC_FILES
dataStructures/ArchiveFile.cpp
dataStructures/ArchiveFileSummary.cpp
dataStructures/ArchiveJob.cpp
dataStructures/ArchiveMount.cpp
dataStructures/ArchiveRequest.cpp
dataStructures/ArchiveRoute.cpp
dataStructures/CancelRetrieveRequest.cpp
......@@ -24,13 +23,11 @@ set (COMMON_LIB_SRC_FILES
dataStructures/RepackType.cpp
dataStructures/Requester.cpp
dataStructures/RetrieveJob.cpp
dataStructures/RetrieveMount.cpp
dataStructures/RetrieveRequest.cpp
dataStructures/SecurityIdentity.cpp
dataStructures/StorageClass.cpp
dataStructures/Tape.cpp
dataStructures/TapeFileLocation.cpp
dataStructures/TapeMount.cpp
dataStructures/TapePool.cpp
dataStructures/TestSourceType.cpp
dataStructures/UpdateFileInfoRequest.cpp
......
/*
* 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/dataStructures/ArchiveMount.hpp"
#include "common/exception/Exception.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::ArchiveMount::ArchiveMount() {
m_lastFSeqSet = false;
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::common::dataStructures::ArchiveMount::~ArchiveMount() throw() {
}
//------------------------------------------------------------------------------
// getNextJob
//------------------------------------------------------------------------------
std::unique_ptr<cta::common::dataStructures::ArchiveJob> cta::common::dataStructures::ArchiveMount::getNextJob() {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the ArchiveMount have been set!");
}
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not implemented!");
return std::unique_ptr<cta::common::dataStructures::ArchiveJob>();
}
//------------------------------------------------------------------------------
// allFieldsSet
//------------------------------------------------------------------------------
bool cta::common::dataStructures::ArchiveMount::allFieldsSet() const {
return m_lastFSeqSet;
}
//------------------------------------------------------------------------------
// setLastFSeq
//------------------------------------------------------------------------------
void cta::common::dataStructures::ArchiveMount::setLastFSeq(const uint64_t lastFSeq) {
m_lastFSeq = lastFSeq;
m_lastFSeqSet = true;
}
//------------------------------------------------------------------------------
// getLastFSeq
//------------------------------------------------------------------------------
uint64_t cta::common::dataStructures::ArchiveMount::getLastFSeq() const {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the ArchiveMount have been set!");
}
return m_lastFSeq;
}
//------------------------------------------------------------------------------
// complete
//------------------------------------------------------------------------------
void cta::common::dataStructures::ArchiveMount::complete() {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the ArchiveMount have been set!");
}
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: 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 <list>
#include <map>
#include <memory>
#include <stdint.h>
#include <string>
#include "common/dataStructures/ArchiveJob.hpp"
#include "common/dataStructures/TapeMount.hpp"
namespace cta {
namespace common {
namespace dataStructures {
class ArchiveMount : public TapeMount {
public:
/**
* Constructor
*/
ArchiveMount();
/**
* Destructor
*/
~ArchiveMount() throw();
std::unique_ptr<cta::common::dataStructures::ArchiveJob> getNextJob();
void setLastFSeq(const uint64_t lastFSeq);
uint64_t getLastFSeq() const;
void complete();
private:
/**
* @return true if all fields have been set, false otherwise
*/
bool allFieldsSet() const;
uint64_t m_lastFSeq;
bool m_lastFSeqSet;
}; // class ArchiveMount
} // namespace dataStructures
} // namespace common
} // namespace cta
/*
* 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/dataStructures/RetrieveMount.hpp"
#include "common/exception/Exception.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::RetrieveMount::RetrieveMount() {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::common::dataStructures::RetrieveMount::~RetrieveMount() throw() {
}
//------------------------------------------------------------------------------
// allFieldsSet
//------------------------------------------------------------------------------
bool cta::common::dataStructures::RetrieveMount::allFieldsSet() const {
return true;
}
//------------------------------------------------------------------------------
// getNextJob
//------------------------------------------------------------------------------
std::unique_ptr<cta::common::dataStructures::RetrieveJob> cta::common::dataStructures::RetrieveMount::getNextJob() {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the RetrieveMount have been set!");
}
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not implemented!");
return std::unique_ptr<cta::common::dataStructures::RetrieveJob>();
}
//------------------------------------------------------------------------------
// diskComplete
//------------------------------------------------------------------------------
void cta::common::dataStructures::RetrieveMount::diskComplete() {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the RetrieveMount have been set!");
}
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not implemented!");
}
//------------------------------------------------------------------------------
// tapeComplete
//------------------------------------------------------------------------------
void cta::common::dataStructures::RetrieveMount::tapeComplete() {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the RetrieveMount have been set!");
}
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: 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 <list>
#include <map>
#include <memory>
#include <stdint.h>
#include <string>
#include "common/dataStructures/RetrieveJob.hpp"
#include "common/dataStructures/TapeMount.hpp"
namespace cta {
namespace common {
namespace dataStructures {
class RetrieveMount : public TapeMount {
public:
/**
* Constructor
*/
RetrieveMount();
/**
* Destructor
*/
~RetrieveMount() throw();
std::unique_ptr<cta::common::dataStructures::RetrieveJob> getNextJob();
void diskComplete();
void tapeComplete();
private:
/**
* @return true if all fields have been set, false otherwise
*/
bool allFieldsSet() const;
}; // class RetrieveMount
} // namespace dataStructures
} // namespace common
} // namespace cta
/*
* 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/dataStructures/TapeMount.hpp"
#include "common/exception/Exception.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::TapeMount::TapeMount() {
m_idSet = false;
m_mountTypeSet = false;
m_vidSet = false;
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::common::dataStructures::TapeMount::~TapeMount() throw() {
}
//------------------------------------------------------------------------------
// allFieldsSet
//------------------------------------------------------------------------------
bool cta::common::dataStructures::TapeMount::allFieldsSet() const {
return m_idSet
&& m_mountTypeSet
&& m_vidSet;
}
//------------------------------------------------------------------------------
// setId
//------------------------------------------------------------------------------
void cta::common::dataStructures::TapeMount::setId(const uint64_t id) {
m_id = id;
m_idSet = true;
}
//------------------------------------------------------------------------------
// getId
//------------------------------------------------------------------------------
uint64_t cta::common::dataStructures::TapeMount::getId() const {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the TapeMount have been set!");
}
return m_id;
}
//------------------------------------------------------------------------------
// setMountType
//------------------------------------------------------------------------------
void cta::common::dataStructures::TapeMount::setMountType(const cta::common::dataStructures::MountType &mountType) {
m_mountType = mountType;
m_mountTypeSet = true;
}
//------------------------------------------------------------------------------
// getMountType
//------------------------------------------------------------------------------
cta::common::dataStructures::MountType cta::common::dataStructures::TapeMount::getMountType() const {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the TapeMount have been set!");
}
return m_mountType;
}
//------------------------------------------------------------------------------
// setVid
//------------------------------------------------------------------------------
void cta::common::dataStructures::TapeMount::setVid(const std::string &vid) {
m_vid = vid;
m_vidSet = true;
}
//------------------------------------------------------------------------------
// getVid
//------------------------------------------------------------------------------
std::string cta::common::dataStructures::TapeMount::getVid() const {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the TapeMount have been set!");
}
return m_vid;
}
//------------------------------------------------------------------------------
// abort
//------------------------------------------------------------------------------
void cta::common::dataStructures::TapeMount::abort() {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the TapeMount have been set!");
}
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: 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 <list>
#include <map>
#include <stdint.h>
#include <string>
#include "common/dataStructures/MountType.hpp"
namespace cta {
namespace common {
namespace dataStructures {
class TapeMount {
public:
/**
* Constructor
*/
TapeMount();
/**
* Destructor
*/
virtual ~TapeMount() throw();
virtual void setId(const uint64_t id);
virtual uint64_t getId() const;
virtual void setMountType(const cta::common::dataStructures::MountType &mountType);
virtual cta::common::dataStructures::MountType getMountType() const;
virtual void setVid(const std::string &vid);
virtual std::string getVid() const;
virtual void abort();
protected:
/**
* @return true if all fields have been set, false otherwise
*/
virtual bool allFieldsSet() const;
uint64_t m_id;
bool m_idSet;
cta::common::dataStructures::MountType m_mountType;
bool m_mountTypeSet;
std::string m_vid;
bool m_vidSet;
}; // class TapeMount
} // namespace dataStructures
} // namespace common
} // namespace cta
......@@ -729,8 +729,8 @@ std::list<cta::common::dataStructures::DriveState> cta::Scheduler::getDriveState
//------------------------------------------------------------------------------
// getNextMount
//------------------------------------------------------------------------------
std::unique_ptr<cta::common::dataStructures::TapeMount> cta::Scheduler::getNextMount(const std::string &logicalLibraryName, const std::string &driveName) {
return std::unique_ptr<cta::common::dataStructures::TapeMount>();
std::unique_ptr<cta::TapeMount> cta::Scheduler::getNextMount(const std::string &logicalLibraryName, const std::string &driveName) {
return std::unique_ptr<TapeMount>();
}
//------------------------------------------------------------------------------
......
......@@ -25,7 +25,6 @@
#include "common/dataStructures/ArchiveFile.hpp"
#include "common/dataStructures/ArchiveFileSummary.hpp"
#include "common/dataStructures/ArchiveJob.hpp"
#include "common/dataStructures/ArchiveMount.hpp"
#include "common/dataStructures/ArchiveRequest.hpp"
#include "common/dataStructures/ArchiveRoute.hpp"
#include "common/dataStructures/CancelRetrieveRequest.hpp"
......@@ -43,13 +42,11 @@
#include "common/dataStructures/RepackType.hpp"
#include "common/dataStructures/Requester.hpp"
#include "common/dataStructures/RetrieveJob.hpp"
#include "common/dataStructures/RetrieveMount.hpp"
#include "common/dataStructures/RetrieveRequest.hpp"
#include "common/dataStructures/SecurityIdentity.hpp"
#include "common/dataStructures/StorageClass.hpp"
#include "common/dataStructures/TapeFileLocation.hpp"
#include "common/dataStructures/Tape.hpp"
#include "common/dataStructures/TapeMount.hpp"
#include "common/dataStructures/TapePool.hpp"
#include "common/dataStructures/TestSourceType.hpp"
#include "common/dataStructures/UpdateFileInfoRequest.hpp"
......@@ -223,7 +220,7 @@ public:
virtual std::list<cta::common::dataStructures::DriveState> getDriveStates(const cta::common::dataStructures::SecurityIdentity &requester) const;
virtual std::unique_ptr<cta::common::dataStructures::TapeMount> getNextMount(const std::string &logicalLibraryName, const std::string &driveName);
virtual std::unique_ptr<TapeMount> getNextMount(const std::string &logicalLibraryName, const std::string &driveName);
virtual std::unique_ptr<TapeMount> _old_getNextMount(const std::string &logicalLibraryName, const std::string & driveName);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment