Catalogue.hpp 23.8 KB
Newer Older
1
/*
2
3
 * The CERN Tape Archive(CTA) project
 * Copyright(C) 2015  CERN
4
5
6
7
 *
 * 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
8
 *(at your option) any later version.
9
10
11
12
13
14
15
16
17
18
19
20
 *
 * 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

21
22
23
24
#include "catalogue/ArchiveFileItor.hpp"
#include "catalogue/ArchiveFileSearchCriteria.hpp"
#include "catalogue/TapeFileWritten.hpp"
#include "catalogue/TapeForWriting.hpp"
25
#include "catalogue/TapeSearchCriteria.hpp"
26
27
28
#include "common/dataStructures/AdminHost.hpp"
#include "common/dataStructures/AdminUser.hpp"
#include "common/dataStructures/ArchiveFile.hpp"
Steven Murray's avatar
Steven Murray committed
29
#include "common/dataStructures/ArchiveFileQueueCriteria.hpp"
30
#include "common/dataStructures/ArchiveFileSummary.hpp"
31
32
33
34
#include "common/dataStructures/ArchiveJob.hpp"
#include "common/dataStructures/ArchiveRoute.hpp"
#include "common/dataStructures/CancelRetrieveRequest.hpp"
#include "common/dataStructures/Dedication.hpp"
35
#include "common/dataStructures/DedicationType.hpp"
36
#include "common/dataStructures/DiskFileInfo.hpp"
Daniele Kruse's avatar
Daniele Kruse committed
37
#include "common/dataStructures/DriveState.hpp"
38
39
40
41
#include "common/dataStructures/EntryLog.hpp"
#include "common/dataStructures/ListStorageClassRequest.hpp"
#include "common/dataStructures/LogicalLibrary.hpp"
#include "common/dataStructures/MountType.hpp"
42
#include "common/dataStructures/MountPolicy.hpp"
43
44
45
#include "common/dataStructures/ReadTestResult.hpp"
#include "common/dataStructures/RepackInfo.hpp"
#include "common/dataStructures/RepackType.hpp"
46
47
#include "common/dataStructures/RequesterGroupMountRule.hpp"
#include "common/dataStructures/RequesterMountRule.hpp"
48
#include "common/dataStructures/RetrieveFileQueueCriteria.hpp"
49
50
51
52
53
#include "common/dataStructures/RetrieveJob.hpp"
#include "common/dataStructures/RetrieveRequest.hpp"
#include "common/dataStructures/SecurityIdentity.hpp"
#include "common/dataStructures/StorageClass.hpp"
#include "common/dataStructures/Tape.hpp"
54
#include "common/dataStructures/TapeCopyToPoolMap.hpp"
55
#include "common/dataStructures/TapeFile.hpp"
56
57
58
59
#include "common/dataStructures/TapePool.hpp"
#include "common/dataStructures/UpdateFileInfoRequest.hpp"
#include "common/dataStructures/UserIdentity.hpp"
#include "common/dataStructures/VerifyInfo.hpp"
60
#include "common/dataStructures/VidToTapeMap.hpp"
61
#include "common/dataStructures/WriteTestResult.hpp"
62
63
64
65

#include <list>
#include <map>
#include <memory>
66
67
68
#include <set>
#include <stdint.h>
#include <string>
69

70
namespace cta {
71
72
73

namespace catalogue {

74
75
76
77
78
79
80
81
/**
 * Abstract class defining the interface to the CTA catalogue responsible for
 * storing crticial information about archive files, tapes and tape files.
 */
class Catalogue {
public:

  /**
82
83
 * Destructor.
 */
84
  virtual ~Catalogue() = 0;
85
  
86
87
88
  virtual void createBootstrapAdminAndHostNoAuth(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &username, const std::string &hostName, const std::string &comment) = 0;
  virtual void createAdminUser(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &username, const std::string &comment) = 0;
  virtual void deleteAdminUser(const std::string &username) = 0;
89
  virtual std::list<common::dataStructures::AdminUser> getAdminUsers() const = 0;
90
  virtual void modifyAdminUserComment(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &username, const std::string &comment) = 0;
91

92
  virtual void createAdminHost(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &hostName, const std::string &comment) = 0;
93
  virtual void deleteAdminHost(const std::string &hostName) = 0;
94
95
  virtual std::list<common::dataStructures::AdminHost> getAdminHosts() const = 0;
  virtual void modifyAdminHostComment(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &hostName, const std::string &comment) = 0;
96

97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
  /**
   * Creates the specified storage class.
   *
   * @param cliIdentity The identity of the command-line interface.
   * @param storageClass The storage class.
   */
  virtual void createStorageClass(
    const common::dataStructures::SecurityIdentity &cliIdentity,
    const common::dataStructures::StorageClass &storageClass) = 0;

  /**
   * Deletes the specified storage class.
   *
   * @param diskInstanceName The name of the disk instance to which the
   * storage class belongs.
   * @param stoargeClassName The name of the storage class which is only
   * guaranteed to be unique within its disk isntance.
   */
  virtual void deleteStorageClass(const std::string &diskInstanceName, const std::string &storageClassName) = 0;

117
  virtual std::list<common::dataStructures::StorageClass> getStorageClasses() const = 0;
118
119
  virtual void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &instanceName, const std::string &name, const uint64_t nbCopies) = 0;
  virtual void modifyStorageClassComment(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &instanceName, const std::string &name, const std::string &comment) = 0;
120

121
  virtual void createTapePool(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t nbPartialTapes, const bool encryptionValue, const std::string &comment) = 0;
122
  virtual void deleteTapePool(const std::string &name) = 0;
123
124
125
126
  virtual std::list<common::dataStructures::TapePool> getTapePools() const = 0;
  virtual void modifyTapePoolNbPartialTapes(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t nbPartialTapes) = 0;
  virtual void modifyTapePoolComment(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const std::string &comment) = 0;
  virtual void setTapePoolEncryption(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const bool encryptionValue) = 0;
127

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
  virtual void createArchiveRoute(
    const common::dataStructures::SecurityIdentity &cliIdentity,
    const std::string &diskInstanceName,
    const std::string &storageClassName,
    const uint64_t copyNb,
    const std::string &tapePoolName,
    const std::string &comment) = 0;

  /**
   * Deletes the specified archive route.
   *
   * @param diskInstanceName The name of the disk instance to which the storage
   * class belongs.
   * @param storageClassName The name of the storage class which is only
   * guaranteed to be unique within its disk instance.
   * @param copyNb The copy number of the tape file.
   */
  virtual void deleteArchiveRoute(
    const std::string &diskInstanceName,
    const std::string &storageClassName,
    const uint64_t copyNb) = 0;

150
  virtual std::list<common::dataStructures::ArchiveRoute> getArchiveRoutes() const = 0;
151
152
  virtual void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &instanceName, const std::string &storageClassName, const uint64_t copyNb, const std::string &tapePoolName) = 0;
  virtual void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &instanceName, const std::string &storageClassName, const uint64_t copyNb, const std::string &comment) = 0;
153

154
  virtual void createLogicalLibrary(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const std::string &comment) = 0;
155
  virtual void deleteLogicalLibrary(const std::string &name) = 0;
156
157
  virtual std::list<common::dataStructures::LogicalLibrary> getLogicalLibraries() const = 0;
  virtual void modifyLogicalLibraryComment(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const std::string &comment) = 0;
158

159
  /**
160
161
   * Creates a tape which is assumed to have logical block protection (LBP)
   * enabled.
162
163
164
165
   *
   * @param encryptionKey The optional identifier of the encrption key.  This
   * optional parameter should either have a non-empty string value or no value
   * at all.  Empty strings are prohibited.
166
   */
167
168
169
170
171
  virtual void createTape(
    const common::dataStructures::SecurityIdentity &cliIdentity,
    const std::string &vid,
    const std::string &logicalLibraryName,
    const std::string &tapePoolName,
172
    const optional<std::string> &encryptionKey,
173
174
175
176
    const uint64_t capacityInBytes,
    const bool disabled,
    const bool full,
    const std::string &comment) = 0;
177
  virtual void deleteTape(const std::string &vid) = 0;
178
179
180
181
182
183
184
185
186
187

  /**
   * Returns the list of tapes that meet the specified search criteria.
   *
   * @param searchCriteria The search criteria.
   * @return The list of tapes.
   */
  virtual std::list<common::dataStructures::Tape> getTapes(
    const TapeSearchCriteria &searchCriteria = TapeSearchCriteria()) const = 0;

188
189
190
191
192
193
194
195
196
197
198
  /**
   * Returns the tapes with the specified volume identifiers.
   *
   * This method will throw an exception if it cannot find ALL of the specified
   * tapes.
   *
   * @param vids The tape volume identifiers (VIDs).
   * @return Map from tape volume identifier to tape.
   */
  virtual common::dataStructures::VidToTapeMap getTapesByVid(const std::set<std::string> &vids) const = 0;

199
200
201
202
203
  virtual void reclaimTape(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &vid) = 0;
  virtual void modifyTapeLogicalLibraryName(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &vid, const std::string &logicalLibraryName) = 0;
  virtual void modifyTapeTapePoolName(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &vid, const std::string &tapePoolName) = 0;
  virtual void modifyTapeCapacityInBytes(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &vid, const uint64_t capacityInBytes) = 0;
  virtual void modifyTapeEncryptionKey(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &vid, const std::string &encryptionKey) = 0;
204
205
206
  virtual void modifyTapeLabelLog(const std::string &vid, const std::string &drive) = 0; // internal function (noCLI)
  virtual void modifyTapeLastWrittenLog(const std::string &vid, const std::string &drive) = 0; // internal function (noCLI)
  virtual void modifyTapeLastReadLog(const std::string &vid, const std::string &drive) = 0; // internal function (noCLI)
207
208
  virtual void setTapeFull(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &vid, const bool fullValue) = 0;
  virtual void setTapeDisabled(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &vid, const bool disabledValue) = 0;
209
  virtual void setTapeLbp(const std::string &vid, const bool lbpValue) = 0; // internal function (noCLI)
210
  virtual void modifyTapeComment(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &vid, const std::string &comment) = 0;
211

212
213
214
215
  virtual void modifyRequesterMountPolicy(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &instanceName, const std::string &requesterName, const std::string &mountPolicy) = 0;
  virtual void modifyRequesterComment(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &instanceName, const std::string &requesterName, const std::string &comment) = 0;
  virtual void modifyRequesterGroupMountPolicy(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &instanceName, const std::string &requesterGroupName, const std::string &mountPolicy) = 0;
  virtual void modifyRequesterGroupComment(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &instanceName, const std::string &requesterGroupName, const std::string &comment) = 0;
216

217
   virtual void createMountPolicy(
218
    const common::dataStructures::SecurityIdentity &cliIdentity,
219
220
221
222
223
224
225
226
    const std::string &name, 
    const uint64_t archivePriority, 
    const uint64_t minArchiveRequestAge, 
    const uint64_t retrievePriority, 
    const uint64_t minRetrieveRequestAge, 
    const uint64_t maxDrivesAllowed, 
    const std::string &comment) = 0;

227
  /**
228
   * Returns the list of all existing mount policies.
229
   *
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
   * @return the list of all existing mount policies.
   */
  virtual std::list<common::dataStructures::MountPolicy> getMountPolicies() const = 0;

  /**
   * Deletes the specified mount policy.
   *
   * @param name The name of the mount policy.
   */
  virtual void deleteMountPolicy(const std::string &name) = 0;

  /**
   * Creates the rule that the specified mount policy will be used for the
   * specified requester.
   *
   * Please note that requester mount-rules overrule requester-group
   * mount-rules.
247
248
249
   *
   * @param cliIdentity The user of the command-line tool.
   * @param mountPolicyName The name of the mount policy.
250
251
252
253
   * @param diskInstance The name of the disk instance to which the requester
   * belongs.
   * @param requesterName The name of the requester which is only guarantted to
   * be unique within its disk instance.
254
255
   * @param comment Comment.
   */
256
  virtual void createRequesterMountRule(
257
258
    const common::dataStructures::SecurityIdentity &cliIdentity,
    const std::string &mountPolicyName,
259
    const std::string &diskInstance,
260
261
262
263
    const std::string &requesterName,
    const std::string &comment) = 0;

  /**
264
265
266
267
268
269
270
271
272
273
274
   * Returns the rules that specify which mount policy is be used for which
   * requester.
   *
   * @return the rules that specify which mount policy is be used for which
   * requester.
   */
  virtual std::list<common::dataStructures::RequesterMountRule> getRequesterMountRules() const = 0;

  /**
   * Deletes the specified mount rule.
   *
275
276
277
278
   * @param diskInstanceName The name of the disk instance to which the
   * requester belongs.
   * @param requesterName The name of the requester which is only guaranteed to
   * be unique within its disk instance.
279
   */
280
  virtual void deleteRequesterMountRule(const std::string &diskInstanceName, const std::string &requesterName) = 0;
281

282
  /**   
283
284
   * Creates the rule that the specified mount policy will be used for the
   * specified requester group.
285
   *
286
287
   * Please note that requester mount-rules overrule requester-group
   * mount-rules.
288
   *
289
   * @param cliIdentity The user of the command-line tool.
290
   * @param mountPolicyName The name of the mount policy.
291
292
293
294
   * @param diskInstanceName The name of the disk instance to which the
   * requester group belongs.
   * @param requesterGroupName The name of the requester group which is only
   * guarantted to be unique within its disk instance.
295
   * @param comment Comment.
296
   */
297
298
299
  virtual void createRequesterGroupMountRule(
    const common::dataStructures::SecurityIdentity &cliIdentity,
    const std::string &mountPolicyName,
300
    const std::string &diskInstanceName,
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
    const std::string &requesterGroupName,
    const std::string &comment) = 0;

  /**
   * Returns the rules that specify which mount policy is be used for which
   * requester group.
   *
   * @return the rules that specify which mount policy is be used for which
   * requester group.
   */
  virtual std::list<common::dataStructures::RequesterGroupMountRule> getRequesterGroupMountRules() const = 0;

  /**
   * Deletes the specified mount rule.
   *
316
317
318
319
   * @param diskInstanceName The name of the disk instance to which the
   * requester group belongs.
   * @param requesterGroupName The name of the requester group which is only
   * guaranteed to be unique within its disk instance.
320
   */
321
322
323
  virtual void deleteRequesterGroupMountRule(
    const std::string &diskInstanceName,
    const std::string &requesterGroupName) = 0;
324

325
326
327
328
329
330
331
332
333
334
335
336
  virtual void modifyMountPolicyArchivePriority(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t archivePriority) = 0;
  virtual void modifyMountPolicyArchiveMinFilesQueued(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minArchiveFilesQueued) = 0;
  virtual void modifyMountPolicyArchiveMinBytesQueued(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t archiveMinBytesQueued) = 0;
  virtual void modifyMountPolicyArchiveMinRequestAge(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minArchiveRequestAge) = 0;
  virtual void modifyMountPolicyRetrievePriority(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t retrievePriority) = 0;
  virtual void modifyMountPolicyRetrieveMinFilesQueued(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minRetrieveFilesQueued) = 0;
  virtual void modifyMountPolicyRetrieveMinBytesQueued(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t retrieveMinBytesQueued) = 0;
  virtual void modifyMountPolicyRetrieveMinRequestAge(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minRetrieveRequestAge) = 0;
  virtual void modifyMountPolicyMaxDrivesAllowed(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t maxDrivesAllowed) = 0;
  virtual void modifyMountPolicyComment(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const std::string &comment) = 0;

  virtual void createDedication(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const common::dataStructures::DedicationType dedicationType,
337
 const optional<std::string> &tag, const optional<std::string> &vid, const uint64_t fromTimestamp, const uint64_t untilTimestamp,const std::string &comment) = 0;
338
  virtual void deleteDedication(const std::string &drivename) = 0;
339
340
  virtual std::list<common::dataStructures::Dedication> getDedications() const = 0;
  virtual void modifyDedicationType(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const common::dataStructures::DedicationType dedicationType) = 0;
341
342
  virtual void modifyDedicationTag(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const optional<std::string> &tag) = 0;
  virtual void modifyDedicationVid(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const optional<std::string> &vid) = 0;
343
344
345
346
  virtual void modifyDedicationFrom(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const uint64_t fromTimestamp) = 0;
  virtual void modifyDedicationUntil(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const uint64_t untilTimestamp) = 0;
  virtual void modifyDedicationComment(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const std::string &comment) = 0;

347
348
  /**
   * Returns an iterator over the list of archive files that meet the specified
349
350
351
352
353
354
355
   * search criteria.
   *
   * Please note that the list is ordered by archive file ID.
   *
   * Please note that this method will throw an exception if the
   * nbArchiveFilesToPrefetch parameter is set to 0.  The parameter must be set
   * to a value greater than or equal to 1.
356
357
358
   *
   * @param searchCriteria The search criteria.
   * @param nbArchiveFilesToPrefetch The number of archive files to prefetch.
359
   * This parameter must be set to a value equal to or greater than 1.
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
   * @return An iterator over the list of archive files.
   */
  virtual std::unique_ptr<ArchiveFileItor> getArchiveFileItor(
    const ArchiveFileSearchCriteria &searchCriteria = ArchiveFileSearchCriteria(),
    const uint64_t nbArchiveFilesToPrefetch = 1000) const = 0;

  /**
   * Returns a summary of the archive files that meet the specified search
   * criteria.
   *
   * @param searchCriteria The search criteria.
   * @return The summary.
   */
  virtual common::dataStructures::ArchiveFileSummary getArchiveFileSummary(
    const ArchiveFileSearchCriteria &searchCriteria = ArchiveFileSearchCriteria()) const = 0;
375
376
377
378
379
380
381
382
383
384
385

  /**
   * Returns the archive file with the specified unique identifier.
   *
   * This method assumes that the archive file being requested exists and will
   * therefore throw an exception if it does not.
   *
   * @param id The unique identifier of the archive file.
   * @return The archive file.
   */
  virtual common::dataStructures::ArchiveFile getArchiveFileById(const uint64_t id) = 0;
386

387
388
389
390
  /**
   * Prepares the catalogue for a new archive file and returns the information
   * required to queue the associated archive request.
   *
391
392
393
394
395
396
   * @param diskInstanceName The name of the disk instance to which the
   * storage class belongs.
   * @param storageClassName The name of the storage class of the file to be
   * archived.  The storage class name is only guaranteed to be unique within
   * its disk instance.  The storage class name will be used by the Catalogue
   * to determine the destination tape pool for each tape copy.
397
   * @param user The user for whom the file is to be archived.  This will be
398
399
   * used by the Catalogue to determine the mount policy to be used when
   * archiving the file.
Steven Murray's avatar
Steven Murray committed
400
   * @return The information required to queue the associated archive request.
401
   */
402
  virtual common::dataStructures::ArchiveFileQueueCriteria prepareForNewFile(
403
404
    const std::string &diskInstanceName,
    const std::string &storageClassName,
405
    const common::dataStructures::UserIdentity &user) = 0;
406

407
408
409
  /**
   * Notifies the catalogue that a file has been written to tape.
   *
410
   * @param event The tape file written event.
411
   */
412
413
  virtual void fileWrittenToTape(const TapeFileWritten &event) = 0;

414
415
416
417
  /**
   * Deletes the specified archive file and its associated tape copies from the
   * catalogue.
   *
418
   * @param instanceName The name of the instance from where the deletion request originated
419
420
421
422
   * @param archiveFileId The unique identifier of the archive file.
   * @return The metadata of the deleted archive file including the metadata of
   * the associated and also deleted tape copies.
   */
423
424
  virtual common::dataStructures::ArchiveFile deleteArchiveFile(const std::string &instanceName, 
    const uint64_t archiveFileId) = 0;
425

426
427
428
429
  /**
   * Prepares for a file retrieval by returning the information required to
   * queue the associated retrieve request(s).
   *
430
   * @param instanceName The name of the instance from where the retrieval request originated
431
432
433
434
435
436
437
438
439
   * @param archiveFileId The unique identifier of the archived file that is
   * to be retrieved.
   * @param user The user for whom the file is to be retrieved.  This will be
   * used by the Catalogue to determine the mount policy to be used when
   * retrieving the file.
   *
   * @return The information required to queue the associated retrieve request(s).
   */
  virtual common::dataStructures::RetrieveFileQueueCriteria prepareToRetrieveFile(
440
    const std::string &instanceName,
441
    const uint64_t archiveFileId,
442
    const common::dataStructures::UserIdentity &user) = 0;
443

444
445
446
447
448
449
450
451
452
  /**
   * Returns true if the specified user running the CTA command-line tool on
   * the specified host has administrator privileges.
   *
   * @param cliIdentity The name of the user and the host on which they are
   * running the CTA command-line tool.
   * @return True if the specified user running the CTA command-line tool on
   * the specified host has administrator privileges.
   */
453
  virtual bool isAdmin(const common::dataStructures::SecurityIdentity &cliIdentity) const = 0;
454

455
  /**
456
457
458
   * Returns the list of tapes that can be written to by a tape drive in the
   * specified logical library, in other words tapes that are not disabled, not
   * full and are in the specified logical library.
459
460
461
462
463
   *
   * @param logicalLibraryName The name of the logical library.
   */
  virtual std::list<TapeForWriting> getTapesForWriting(const std::string &logicalLibraryName) const = 0;

464
465
}; // class Catalogue

466
} // namespace catalogue
467
} // namespace cta