DriveConfig.hpp 3.84 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/******************************************************************************
 *
 * This file is part of the Castor project.
 * See http://castor.web.cern.ch/castor
 *
 * Copyright (C) 2003  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 2
 * 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 *
 *
21
 * @author Castor Dev team, castor-dev@cern.ch
22
23
24
25
 *****************************************************************************/

#pragma once

26
27
#include "castor/mediachanger/LibrarySlot.hpp"
#include "castor/mediachanger/LibrarySlotParser.hpp"
28

29
30
31
32
33
#include <list>
#include <string>

namespace castor {
namespace tape {
34
35
namespace tapeserver {
namespace daemon {
36
37

/**
38
39
 * Class representing the configuration of a tape drive as specified in the
 * TPCONFIG file.
40
 */
41
42
43
44
45
46
47
48
49
50
51
class DriveConfig {
public:
  /**
   * Constructor.
   */
  DriveConfig() throw();

  /**
   * Constructor.
   *
   * @param unitName The unit name of the tape drive.
52
   * @param logicalLibrary The logical Library of the tape drive as used by the vdqmd
53
54
55
56
57
58
59
60
   * and vmgrd daemons.
   * @param devFilename The device file of the tape drive, for example:
   * /dev/nst0.
   * @param librarySlot The library slot in which the tape drive is located,
   * for example: smc@localhost,0
   */
  DriveConfig(
    const std::string &unitName,
61
    const std::string &logicalLibrary,
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
    const std::string &devFilename,
    const std::string &librarySlot);

  /**
   * Copy constructor.
   *
   * @param obj The object to be copied.
   */
  DriveConfig(const DriveConfig &obj);

  /**
   * Destructor.
   */
  ~DriveConfig() throw();

  /**
   * Assignment operator.
   *
   * @param rhs The right-hand side of the operator.
   */
  DriveConfig &operator=(const DriveConfig &rhs);

  /**
   * Gets the unit name of the tape drive as used by the vdqmd daemon.
   *
   * @return The unit name of the tape drive as used by the vdqmd daemon.
   */
  const std::string &getUnitName() const throw();

  /**
92
   * Gets the logical Library name of the tape drive as used by the vdqmd and
93
94
   * vmgrd daemons.
   *
95
   * @return The logical Library name of the tape drive as used by the vdqmd and
96
97
   * vmgrd daemons.
   */
98
  const std::string &getLogicalLibrary() const throw();
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
  
  /**
   * Gets the device file of the tape drive, for example: /dev/nst0
   *
   * @return The device file of the tape drive, for example: /dev/nst0
   */
  const std::string &getDevFilename() const throw();

  /**
   * Gets the library slot in which the tape drive is located, for example:
   * smc@localhost,0
   *
   * @return The library slot in which the tape drive is located, for example:
   * smc@localhost,0
   */
  const mediachanger::LibrarySlot &getLibrarySlot() const;

private:
117

118
  /**
119
   * The unit name of the tape drive as used by the vdqmd daemon.
120
   */
121
  std::string m_unitName;
122
123

  /**
124
   * The logical Library of the tape drive as used by the vdqmd and vmgrd
125
   * daemons.
126
   */
127
  std::string m_logicalLibrary;
128
129
  
  /**
130
   * The device file of the tape drive, for example: /dev/nst0
131
   */
132
   std::string m_devFilename;
133
134

  /**
135
   * The library slot in which the tape drive is located, for example:
136
137
   * smc@localhost,0
   */
138
  mediachanger::LibrarySlot *m_librarySlot;
139
140
141

}; // class DriveConfig

142
143
} // namespace daemon
} // namespace tapeserver
144
145
} // namespace tape
} // namespace castor