| 1 | // -------------------------------------------------------------------------- |
|---|
| 2 | // |
|---|
| 3 | // File |
|---|
| 4 | // Name: BackupStoreAccounts.h |
|---|
| 5 | // Purpose: Account management for backup store server |
|---|
| 6 | // Created: 2003/08/21 |
|---|
| 7 | // |
|---|
| 8 | // -------------------------------------------------------------------------- |
|---|
| 9 | |
|---|
| 10 | #ifndef BACKUPSTOREACCOUNTS__H |
|---|
| 11 | #define BACKUPSTOREACCOUNTS__H |
|---|
| 12 | |
|---|
| 13 | #include <string> |
|---|
| 14 | |
|---|
| 15 | #include "BackupStoreAccountDatabase.h" |
|---|
| 16 | |
|---|
| 17 | // -------------------------------------------------------------------------- |
|---|
| 18 | // |
|---|
| 19 | // Class |
|---|
| 20 | // Name: BackupStoreAccounts |
|---|
| 21 | // Purpose: Account management for backup store server |
|---|
| 22 | // Created: 2003/08/21 |
|---|
| 23 | // |
|---|
| 24 | // -------------------------------------------------------------------------- |
|---|
| 25 | class BackupStoreAccounts |
|---|
| 26 | { |
|---|
| 27 | public: |
|---|
| 28 | BackupStoreAccounts(BackupStoreAccountDatabase &rDatabase); |
|---|
| 29 | ~BackupStoreAccounts(); |
|---|
| 30 | private: |
|---|
| 31 | BackupStoreAccounts(const BackupStoreAccounts &rToCopy); |
|---|
| 32 | |
|---|
| 33 | public: |
|---|
| 34 | void Create(int32_t ID, int DiscSet, int64_t SizeSoftLimit, int64_t SizeHardLimit, const std::string &rAsUsername); |
|---|
| 35 | |
|---|
| 36 | bool AccountExists(int32_t ID); |
|---|
| 37 | void GetAccountRoot(int32_t ID, std::string &rRootDirOut, int &rDiscSetOut) const; |
|---|
| 38 | static std::string GetAccountRoot(const |
|---|
| 39 | BackupStoreAccountDatabase::Entry &rEntry) |
|---|
| 40 | { |
|---|
| 41 | return MakeAccountRootDir(rEntry.GetID(), rEntry.GetDiscSet()); |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | private: |
|---|
| 45 | static std::string MakeAccountRootDir(int32_t ID, int DiscSet); |
|---|
| 46 | |
|---|
| 47 | private: |
|---|
| 48 | BackupStoreAccountDatabase &mrDatabase; |
|---|
| 49 | }; |
|---|
| 50 | |
|---|
| 51 | #endif // BACKUPSTOREACCOUNTS__H |
|---|
| 52 | |
|---|