/* * @project The CERN Tape Archive (CTA) * @copyright Copyright © 2022 CERN * @license This program is free software, distributed under the terms of the GNU General Public * Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can * redistribute it and/or modify it under the terms of the GPL Version 3, 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. * * In applying this licence, CERN does not waive the privileges and immunities * granted to it by virtue of its status as an Intergovernmental Organization or * submit itself to any jurisdiction. */ #pragma once #include "common/exception/Exception.hpp" namespace cta::catalogue { class SchemaVersion; CTA_GENERATE_EXCEPTION_CLASS(WrongSchemaVersionException); class SchemaCatalogue { public: virtual ~SchemaCatalogue() = default; /** * Returns the SchemaVersion object corresponding to the catalogue schema version: * - SCHEMA_VERSION_MAJOR * - SCHEMA_VERSION_MINOR * - SCHEMA_VERSION_MAJOR_NEXT (future major version number of the schema in case of upgrade) * - SCHEMA_VERSION_MINOR_NEXT (future minor version number of the schema in case of upgrade) * - STATUS (UPGRADING or PRODUCTION) * * @return The SchemaVersion object corresponding to the catalogue schema version */ virtual SchemaVersion getSchemaVersion() const = 0; /** * Checks that the online database schema MAJOR version number matches * the schema MAJOR version number defined in version.h */ virtual void verifySchemaVersion() = 0; /** * Checks that the most trivial query goes through. Throws an exception if not. */ virtual void ping() = 0; }; } // namespace cta::catalogue