Commit 4dd8f776 authored by Steven Murray's avatar Steven Murray
Browse files

cta::catalogue::Catalogue now provides access to the MEDIA_TYPE table.

parent f4c6932b
......@@ -72,9 +72,11 @@ set (CATALOGUE_LIB_SRC_FILES
UserSpecifiedAnEmptyStringFileRegexp.cpp
UserSpecifiedAnEmptyStringFreeSpaceQueryURL.cpp
UserSpecifiedAZeroRefreshInterval.cpp
UserSpecifiedAnEmptyStringCartridge.cpp
UserSpecifiedAZeroTargetedFreeSpace.cpp
UserSpecifiedAnEmptyStringLogicalLibraryName.cpp
UserSpecifiedAnEmptyStringMediaType.cpp
UserSpecifiedAnEmptyStringMediaTypeName.cpp
UserSpecifiedAnEmptyStringStorageClassName.cpp
UserSpecifiedAnEmptyStringSupply.cpp
UserSpecifiedAnEmptyStringTapePoolName.cpp
......@@ -83,6 +85,7 @@ set (CATALOGUE_LIB_SRC_FILES
UserSpecifiedAnEmptyStringVid.cpp
UserSpecifiedAnEmptyStringVo.cpp
UserSpecifiedAnEmptyTapePool.cpp
UserSpecifiedMediaTypeUsedByTapes.cpp
UserSpecifiedStorageClassUsedByArchiveFiles.cpp
UserSpecifiedStorageClassUsedByArchiveRoutes.cpp
UserSpecifiedAZeroCapacity.cpp
......
......@@ -19,6 +19,8 @@
#pragma once
#include "catalogue/ArchiveFileItor.hpp"
#include "catalogue/MediaType.hpp"
#include "catalogue/MediaTypeWithLogs.hpp"
#include "catalogue/TapeFileSearchCriteria.hpp"
#include "catalogue/TapeItemWrittenPointer.hpp"
#include "catalogue/TapeFileWritten.hpp"
......@@ -293,6 +295,109 @@ public:
*/
virtual void modifyStorageClassName(const common::dataStructures::SecurityIdentity &admin, const std::string &currentName, const std::string &newName) = 0;
/**
* Creates a tape media type.
*
* @param admin The administrator.
* @param mediaType The tape media type.
*/
virtual void createMediaType(const common::dataStructures::SecurityIdentity &admin, const MediaType &mediaType) = 0;
/**
* Deletes the specified tape media type.
*
* @param name The name of the tape media type.
*/
virtual void deleteMediaType(const std::string &name) = 0;
/**
* Returns all tape media types.
*
* @return All tape media types.
*/
virtual std::list<MediaTypeWithLogs> getMediaTypes() const = 0;
/**
* Modifies the name of the specified tape media type.
*
* @param admin The administrator.
* @param currentName The current name of the tape media type.
* @param newName The new name of the tape media type.
*/
virtual void modifyMediaTypeName(const common::dataStructures::SecurityIdentity &admin, const std::string &currentName, const std::string &newName) = 0;
/**
* Modifies the cartidge of the specified tape media type.
*
* @param admin The administrator.
* @param name The name of the tape media type.
* @param cartridge The new cartidge.
*/
virtual void modifyMediaTypeCartridge(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &cartridge) = 0;
/**
* Modify the capacity in bytes of a tape media type.
*
* @param admin The administrator.
* @param name The name of the tape media type.
* @param capacityInBytes The new capacity in bytes.
*/
virtual void modifyMediaTypeCapacityInBytes(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t capacityInBytes) = 0;
/**
* Modify the SCSI primary density code of a tape media type.
*
* @param admin The administrator.
* @param name The name of the tape media type.
* @param primaryDensityCode The new SCSI primary density code.
*/
virtual void modifyMediaTypePrimaryDensityCode(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint8_t primaryDensityCode) = 0;
/**
* Modify the SCSI secondary density code of a tape media type.
*
* @param admin The administrator.
* @param name The name of the tape media type.
* @param secondaryDensityCode The new SCSI secondary density code.
*/
virtual void modifyMediaTypeSecondaryDensityCode(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint8_t secondaryDensityCode) = 0;
/**
* Modify the number of tape wraps of a tape media type.
*
* @param admin The administrator.
* @param name The name of the tape media type.
* @param nbWraps The new number of tape wraps.
*/
virtual void modifyMediaTypeNbWraps(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const cta::optional<std::uint32_t> &nbWraps) = 0;
/**
* Modify the minimum longitudinal tape position of a tape media type.
*
* @param admin The administrator.
* @param name The name of the tape media type.
* @param minLPos The new minimum longitudinal tape position.
*/
virtual void modifyMediaTypeMinLPos(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const cta::optional<std::uint64_t> &minLPos) = 0;
/**
* Modify the maximum longitudinal tape position of a tape media type.
*
* @param admin The administrator.
* @param name The name of the tape media type.
* @param maxLPos The new maximum longitudinal tape position.
*/
virtual void modifyMediaTypeMaxLPos(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const cta::optional<std::uint64_t> &maxLPos) = 0;
/**
* Modify the comment of a tape media type.
*
* @param admin The administrator.
* @param name The name of the tape media type.
* @param comment The new comment.
*/
virtual void modifyMediaTypeComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) = 0;
virtual void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, const cta::optional<std::string> &supply, const std::string &comment) = 0;
virtual void deleteTapePool(const std::string &name) = 0;
virtual std::list<TapePool> getTapePools() const = 0;
......
......@@ -164,6 +164,54 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyStorageClassVo(admin, name, vo);}, m_maxTriesToConnect);
}
void createMediaType(const common::dataStructures::SecurityIdentity &admin, const MediaType &mediaType) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->createMediaType(admin, mediaType);}, m_maxTriesToConnect);
}
void deleteMediaType(const std::string &name) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->deleteMediaType(name);}, m_maxTriesToConnect);
}
std::list<MediaTypeWithLogs> getMediaTypes() const override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->getMediaTypes();}, m_maxTriesToConnect);
}
void modifyMediaTypeName(const common::dataStructures::SecurityIdentity &admin, const std::string &currentName, const std::string &newName) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyMediaTypeName(admin, currentName, newName);}, m_maxTriesToConnect);
}
void modifyMediaTypeCartridge(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &cartridge) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyMediaTypeCartridge(admin, name, cartridge);}, m_maxTriesToConnect);
}
void modifyMediaTypeCapacityInBytes(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t capacityInBytes) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyMediaTypeCapacityInBytes(admin, name, capacityInBytes);}, m_maxTriesToConnect);
}
void modifyMediaTypePrimaryDensityCode(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint8_t primaryDensityCode) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyMediaTypePrimaryDensityCode(admin, name, primaryDensityCode);}, m_maxTriesToConnect);
}
void modifyMediaTypeSecondaryDensityCode(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint8_t secondaryDensityCode) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyMediaTypeSecondaryDensityCode(admin, name, secondaryDensityCode);}, m_maxTriesToConnect);
}
void modifyMediaTypeNbWraps(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const cta::optional<std::uint32_t> &nbWraps) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyMediaTypeNbWraps(admin, name, nbWraps);}, m_maxTriesToConnect);
}
void modifyMediaTypeMinLPos(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const cta::optional<std::uint64_t> &minLPos) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyMediaTypeMinLPos(admin, name, minLPos);}, m_maxTriesToConnect);
}
void modifyMediaTypeMaxLPos(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const cta::optional<std::uint64_t> &maxLPos) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyMediaTypeMaxLPos(admin, name, maxLPos);}, m_maxTriesToConnect);
}
void modifyMediaTypeComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyMediaTypeComment(admin, name, comment);}, m_maxTriesToConnect);
}
void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, const cta::optional<std::string> &supply, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->createTapePool(admin, name, vo, nbPartialTapes, encryptionValue, supply, comment);}, m_maxTriesToConnect);
}
......
This diff is collapsed.
......@@ -86,6 +86,16 @@ protected:
std::map<std::string, cta::common::dataStructures::AdminUser> adminUserListToMap(
const std::list<cta::common::dataStructures::AdminUser> &listOfAdminUsers);
/**
* Creates a map from tape meida type name to tape media type from the
* specified list of tape media types.
*
* @param listOfMediaTypes The list of tape media types.
* @return Map from tape media type name to tape media type.
*/
std::map<std::string, cta::catalogue::MediaTypeWithLogs> mediaTypeWithLogsListToMap(
const std::list<cta::catalogue::MediaTypeWithLogs> &listOfMediaTypes);
/**
* Creates a map from tape pool name to tape pool from the specified list of
* tape pools.
......
......@@ -43,6 +43,18 @@ public:
void createRequesterMountRule(const common::dataStructures::SecurityIdentity& admin, const std::string& mountPolicyName, const std::string& diskInstance, const std::string& requesterName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createStorageClass(const common::dataStructures::SecurityIdentity& admin, const common::dataStructures::StorageClass& storageClass) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createTape(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const std::string &mediaType, const std::string &vendor, const std::string& logicalLibraryName, const std::string& tapePoolName, const uint64_t capacityInBytes, const bool disabled, const bool full, const bool readOnly, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createMediaType(const common::dataStructures::SecurityIdentity &admin, const MediaType &mediaType) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteMediaType(const std::string &name) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
std::list<MediaTypeWithLogs> getMediaTypes() const override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyMediaTypeName(const common::dataStructures::SecurityIdentity &admin, const std::string &currentName, const std::string &newName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyMediaTypeCartridge(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &cartridge) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyMediaTypeCapacityInBytes(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t capacityInBytes) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyMediaTypePrimaryDensityCode(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint8_t primaryDensityCode) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyMediaTypeSecondaryDensityCode(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint8_t secondaryDensityCode) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyMediaTypeNbWraps(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const cta::optional<std::uint32_t> &nbWraps) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyMediaTypeMinLPos(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const cta::optional<std::uint64_t> &minLPos) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyMediaTypeMaxLPos(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const cta::optional<std::uint64_t> &maxLPos) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyMediaTypeComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createTapePool(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const std::string & vo, const uint64_t nbPartialTapes, const bool encryptionValue, const cta::optional<std::string> &supply, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteActivitiesFairShareWeight(const common::dataStructures::SecurityIdentity& admin, const std::string& diskInstanceName, const std::string& acttivity) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteAdminUser(const std::string& username) override { throw exception::Exception(std::string("In ")+__PRETTY_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 "common/optional.hpp"
#include <cstdint>
#include <string>
namespace cta {
namespace catalogue {
/**
* Structure describing a tape media type.
*/
struct MediaType {
/**
* Constructor.
*
* Sets the value of all integer member-variables to zero. Optional integer
* member-variables are left as null.
*/
MediaType():
capacityInBytes(0),
primaryDensityCode(0),
secondaryDensityCode(0) {
}
/**
* The name of the media type.
*/
std::string name;
/**
* The cartridge.
*/
std::string cartridge;
/**
* The capacity in bytes.
*/
std::uint64_t capacityInBytes;
/**
* The primary SCSI density code.
*/
std::uint8_t primaryDensityCode;
/**
* The secondary SCSI density code.
*/
std::uint8_t secondaryDensityCode;
/**
* The number of tape wraps.
*/
cta::optional<std::uint32_t> nbWraps;
/**
* The minimum longitudinal tape position.
*/
cta::optional<std::uint64_t> minLPos;
/**
* The maximum longitudinal tape position.
*/
cta::optional<std::uint64_t> maxLPos;
/**
* The user comment.
*/
std::string comment;
}; // struct MediaType
} // namespace catalogue
} // 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/>.
*/
#pragma once
#include "catalogue/MediaType.hpp"
#include "common/dataStructures/EntryLog.hpp"
#include <cstdint>
#include <string>
namespace cta {
namespace catalogue {
/**
* Structure describing a tape media type together with cfeation and last
* modification logs.
*/
struct MediaTypeWithLogs: public MediaType {
/**
* The creation log.
*/
common::dataStructures::EntryLog creationLog;
/**
* The last modification log.
*/
common::dataStructures::EntryLog lastModificationLog;
}; // struct MediaType
} // namespace catalogue
} // namespace cta
......@@ -179,6 +179,44 @@ uint64_t MysqlCatalogue::getNextVirtualOrganizationId(rdbms::Conn& conn) {
}
}
//------------------------------------------------------------------------------
// getNextMediaTypeId
//------------------------------------------------------------------------------
uint64_t MysqlCatalogue::getNextMediaTypeId(rdbms::Conn &conn) {
try {
rdbms::AutoRollback autoRollback(conn);
conn.executeNonQuery("START TRANSACTION");
{
const char *const sql = "UPDATE MEDIA_TYPE_ID SET ID = LAST_INSERT_ID(ID + 1)";
auto stmt = conn.createStmt(sql);
stmt.executeNonQuery();
}
uint64_t id = 0;
{
const char *const sql = "SELECT LAST_INSERT_ID() AS ID ";
auto stmt = conn.createStmt(sql);
auto rset = stmt.executeQuery();
if(!rset.next()) {
throw exception::Exception("MEDIA_TYPE_ID table is empty");
}
id = rset.columnUint64("ID");
if(rset.next()) {
throw exception::Exception("Found more than one ID counter in the MEDIA_TYPE_ID table");
}
}
conn.commit();
return id;
} catch(exception::UserError &) {
throw;
} catch(exception::Exception &ex) {
ex.getMessage().str(std::string(__FUNCTION__) + ": " + ex.getMessage().str());
throw;
}
}
//------------------------------------------------------------------------------
// getNextStorageClassId
......
......@@ -99,6 +99,20 @@ protected:
*/
uint64_t getNextVirtualOrganizationId(rdbms::Conn &conn) override;
/**
* Returns a unique media type ID that can be used by a new media type within
* the catalogue.
*
* This method must be implemented by the sub-classes of RdbmsCatalogue
* because different database technologies propose different solution to the
* problem of generating ever increasing numeric identifiers.
*
* @param conn The database connection.
* @return a unique media type ID that can be used by a new media type
* within the catalogue.
*/
uint64_t getNextMediaTypeId(rdbms::Conn &conn) override;
/**
* Returns a unique storage class ID that can be used by a new storage class
* within the catalogue.
......
......@@ -226,6 +226,31 @@ uint64_t OracleCatalogue::getNextVirtualOrganizationId(rdbms::Conn &conn) {
}
}
//------------------------------------------------------------------------------
// getMediaTypeId
//------------------------------------------------------------------------------
uint64_t OracleCatalogue::getNextMediaTypeId(rdbms::Conn &conn) {
try {
const char *const sql =
"SELECT "
"MEDIA_TYPE_ID_SEQ.NEXTVAL AS MEDIA_TYPE_ID "
"FROM "
"DUAL";
auto stmt = conn.createStmt(sql);
auto rset = stmt.executeQuery();
if (!rset.next()) {
throw exception::Exception(std::string("Result set is unexpectedly empty"));
}
return rset.columnUint64("MEDIA_TYPE_ID");
} catch(exception::UserError &) {
throw;
} catch(exception::Exception &ex) {
ex.getMessage().str(std::string(__FUNCTION__) + ": " + ex.getMessage().str());
throw;
}
}
//------------------------------------------------------------------------------
// getNextStorageClassId
//------------------------------------------------------------------------------
......
......@@ -99,6 +99,20 @@ public:
*/
uint64_t getNextVirtualOrganizationId(rdbms::Conn &conn) override;
/**
* Returns a unique media type ID that can be used by a new media type within
* the catalogue.
*
* This method must be implemented by the sub-classes of RdbmsCatalogue
* because different database technologies propose different solution to the
* problem of generating ever increasing numeric identifiers.
*
* @param conn The database connection.
* @return a unique media type ID that can be used by a new media type
* within the catalogue.
*/
uint64_t getNextMediaTypeId(rdbms::Conn &conn) override;
/**
* Returns a unique storage class ID that can be used by a new storage class
* within the catalogue.
......
......@@ -211,6 +211,27 @@ uint64_t PostgresCatalogue::getNextVirtualOrganizationId(rdbms::Conn &conn) {
throw;
}
}
//------------------------------------------------------------------------------
// getNextMediaTypeId
//------------------------------------------------------------------------------
uint64_t PostgresCatalogue::getNextMediaTypeId(rdbms::Conn &conn) {
try {
const char *const sql = "select NEXTVAL('MEDIA_TYPE_ID_SEQ') AS MEDIA_TYPE_ID";
auto stmt = conn.createStmt(sql);
auto rset = stmt.executeQuery();
if(!rset.next()) {
throw exception::Exception("Result set is unexpectedly empty");
}
return rset.columnUint64("MEDIA_TYPE_ID");
} catch(exception::UserError &) {
throw;
} catch(exception::Exception &ex) {
ex.getMessage().str(std::string(__FUNCTION__) + ": " + ex.getMessage().str());
throw;
}
}
//------------------------------------------------------------------------------
// getNextStorageClassId
//------------------------------------------------------------------------------
......
......@@ -124,6 +124,20 @@ public:
* within the catalogue.
*/
uint64_t getNextVirtualOrganizationId(rdbms::Conn &conn) override;
/**
* Returns a unique media type ID that can be used by a new media type within
* the catalogue.
*
* This method must be implemented by the sub-classes of RdbmsCatalogue
* because different database technologies propose different solution to the
* problem of generating ever increasing numeric identifiers.
*
* @param conn The database connection.
* @return a unique media type ID that can be used by a new media type
* within the catalogue.
*/
uint64_t getNextMediaTypeId(rdbms::Conn &conn) override;
/**
* Returns a unique storage class ID that can be used by a new storage class
......
This diff is collapsed.
......@@ -277,6 +277,107 @@ public:
*/
void modifyStorageClassName(const common::dataStructures::SecurityIdentity &admin, const std::string &currentName, const std::string &newName) override;
/**
* Creates a tape media type.
*
* @param mediaType The tape media type.
*/
void createMediaType(const common::dataStructures::SecurityIdentity &admin, const MediaType &mediaType) override;
/**
* Deletes the specified tape media type.
*
* @param name The name of the tape media type.
*/
void deleteMediaType(const std::string &name) override;
/**
* Returns all tape media types.
*
* @return All tape media types.
*/
std::list<MediaTypeWithLogs> getMediaTypes() const override;
/**
* Modifies the name of the specified tape media type.
*
* @param currentName The current name of the tape media type.
* @param newName The new name of the tape media type.
*/
void modifyMediaTypeName(const common::dataStructures::SecurityIdentity &admin, const std::string &currentName, const std::string &newName) override;
/**
* Modifies the cartidge of the specified tape media type.
*
* @param admin The administrator.
* @param name The name of the tape media type.
* @param cartridge The new cartidge.
*/
void modifyMediaTypeCartridge(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std</