Skip to content

Commit

Permalink
Rename BackupStoreAccountsControl to BackupStoreAccountControl
Browse files Browse the repository at this point in the history
For consistency with the base class, BackupAccountControl, and grammatical
reasons.
  • Loading branch information
qris committed Jul 8, 2017
1 parent 0dca866 commit 2aae786
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
3 changes: 2 additions & 1 deletion bin/bbstoreaccounts/bbstoreaccounts.cpp
Expand Up @@ -21,6 +21,7 @@
#include <iostream>

#include "box_getopt.h"
#include "BackupAccountControl.h"
#include "BackupStoreAccounts.h"
#include "BackupStoreAccountDatabase.h"
#include "BackupStoreCheck.h"
Expand Down Expand Up @@ -175,7 +176,7 @@ int main(int argc, const char *argv[])
argc--;


BackupStoreAccountsControl control(*config, machineReadableOutput);
BackupStoreAccountControl control(*config, machineReadableOutput);

// Now do the command.
if(command == "create")
Expand Down
20 changes: 10 additions & 10 deletions lib/backupstore/BackupAccountControl.cpp
Expand Up @@ -144,7 +144,7 @@ int BackupAccountControl::PrintAccountInfo(const BackupStoreInfo& info,
return 0;
}

int BackupStoreAccountsControl::BlockSizeOfDiscSet(int discSetNum)
int BackupStoreAccountControl::BlockSizeOfDiscSet(int discSetNum)
{
// Get controller, check disc set number
RaidFileController &controller(RaidFileController::GetController());
Expand All @@ -158,7 +158,7 @@ int BackupStoreAccountsControl::BlockSizeOfDiscSet(int discSetNum)
return controller.GetDiscSet(discSetNum).GetBlockSize();
}

int BackupStoreAccountsControl::SetLimit(int32_t ID, const char *SoftLimitStr,
int BackupStoreAccountControl::SetLimit(int32_t ID, const char *SoftLimitStr,
const char *HardLimitStr)
{
std::string rootDir;
Expand Down Expand Up @@ -194,7 +194,7 @@ int BackupStoreAccountsControl::SetLimit(int32_t ID, const char *SoftLimitStr,
return 0;
}

int BackupStoreAccountsControl::SetAccountName(int32_t ID, const std::string& rNewAccountName)
int BackupStoreAccountControl::SetAccountName(int32_t ID, const std::string& rNewAccountName)
{
std::string rootDir;
int discSetNum;
Expand Down Expand Up @@ -223,7 +223,7 @@ int BackupStoreAccountsControl::SetAccountName(int32_t ID, const std::string& rN
return 0;
}

int BackupStoreAccountsControl::PrintAccountInfo(int32_t ID)
int BackupStoreAccountControl::PrintAccountInfo(int32_t ID)
{
std::string rootDir;
int discSetNum;
Expand All @@ -245,7 +245,7 @@ int BackupStoreAccountsControl::PrintAccountInfo(int32_t ID)
BlockSizeOfDiscSet(discSetNum));
}

int BackupStoreAccountsControl::SetAccountEnabled(int32_t ID, bool enabled)
int BackupStoreAccountControl::SetAccountEnabled(int32_t ID, bool enabled)
{
std::string rootDir;
int discSetNum;
Expand All @@ -267,7 +267,7 @@ int BackupStoreAccountsControl::SetAccountEnabled(int32_t ID, bool enabled)
return 0;
}

int BackupStoreAccountsControl::DeleteAccount(int32_t ID, bool AskForConfirmation)
int BackupStoreAccountControl::DeleteAccount(int32_t ID, bool AskForConfirmation)
{
std::string rootDir;
int discSetNum;
Expand Down Expand Up @@ -383,7 +383,7 @@ int BackupStoreAccountsControl::DeleteAccount(int32_t ID, bool AskForConfirmatio
return retcode;
}

bool BackupStoreAccountsControl::OpenAccount(int32_t ID, std::string &rRootDirOut,
bool BackupStoreAccountControl::OpenAccount(int32_t ID, std::string &rRootDirOut,
int &rDiscSetOut, std::auto_ptr<UnixUser> apUser, NamedLock* pLock)
{
// Load in the account database
Expand Down Expand Up @@ -431,7 +431,7 @@ bool BackupStoreAccountsControl::OpenAccount(int32_t ID, std::string &rRootDirOu
return true;
}

int BackupStoreAccountsControl::CheckAccount(int32_t ID, bool FixErrors, bool Quiet,
int BackupStoreAccountControl::CheckAccount(int32_t ID, bool FixErrors, bool Quiet,
bool ReturnNumErrorsFound)
{
std::string rootDir;
Expand Down Expand Up @@ -461,7 +461,7 @@ int BackupStoreAccountsControl::CheckAccount(int32_t ID, bool FixErrors, bool Qu
}
}

int BackupStoreAccountsControl::CreateAccount(int32_t ID, int32_t DiscNumber,
int BackupStoreAccountControl::CreateAccount(int32_t ID, int32_t DiscNumber,
int32_t SoftLimit, int32_t HardLimit)
{
// Load in the account database
Expand Down Expand Up @@ -496,7 +496,7 @@ int BackupStoreAccountsControl::CreateAccount(int32_t ID, int32_t DiscNumber,
return 0;
}

int BackupStoreAccountsControl::HousekeepAccountNow(int32_t ID)
int BackupStoreAccountControl::HousekeepAccountNow(int32_t ID)
{
std::string rootDir;
int discSetNum;
Expand Down
5 changes: 3 additions & 2 deletions lib/backupstore/BackupAccountControl.h
Expand Up @@ -41,10 +41,11 @@ class BackupAccountControl
int PrintAccountInfo(const BackupStoreInfo& info, int BlockSize);
};

class BackupStoreAccountsControl : public BackupAccountControl

class BackupStoreAccountControl : public BackupAccountControl
{
public:
BackupStoreAccountsControl(const Configuration& config,
BackupStoreAccountControl(const Configuration& config,
bool machineReadableOutput = false)
: BackupAccountControl(config, machineReadableOutput)
{ }
Expand Down
11 changes: 6 additions & 5 deletions lib/backupstore/StoreTestUtils.cpp
Expand Up @@ -13,12 +13,13 @@
#include <vector>

#include "autogen_BackupProtocol.h"
#include "BoxPortsAndFiles.h"
#include "BackupAccountControl.h"
#include "BackupStoreAccounts.h"
#include "BackupStoreAccountDatabase.h"
#include "BackupStoreConfigVerify.h"
#include "BackupStoreConstants.h"
#include "BackupStoreInfo.h"
#include "BoxPortsAndFiles.h"
#include "HousekeepStoreAccount.h"
#include "Logging.h"
#include "ServerControl.h"
Expand All @@ -33,7 +34,7 @@ bool create_account(int soft, int hard)
std::auto_ptr<Configuration> config(
Configuration::LoadAndVerify
("testfiles/bbstored.conf", &BackupConfigFileVerify, errs));
BackupStoreAccountsControl control(*config);
BackupStoreAccountControl control(*config);

Logger::LevelGuard guard(Logging::GetConsole(), Log::WARNING);
int result = control.CreateAccount(0x01234567, 0, soft, hard);
Expand All @@ -47,7 +48,7 @@ bool delete_account()
std::auto_ptr<Configuration> config(
Configuration::LoadAndVerify
("testfiles/bbstored.conf", &BackupConfigFileVerify, errs));
BackupStoreAccountsControl control(*config);
BackupStoreAccountControl control(*config);
Logger::LevelGuard guard(Logging::GetConsole(), Log::WARNING);
TEST_THAT_THROWONFAIL(control.DeleteAccount(0x01234567, false) == 0);
return true;
Expand Down Expand Up @@ -168,7 +169,7 @@ bool change_account_limits(const char* soft, const char* hard)
std::auto_ptr<Configuration> config(
Configuration::LoadAndVerify
("testfiles/bbstored.conf", &BackupConfigFileVerify, errs));
BackupStoreAccountsControl control(*config);
BackupStoreAccountControl control(*config);
int result = control.SetLimit(0x01234567, soft, hard);
TEST_EQUAL(0, result);
return (result == 0);
Expand All @@ -183,7 +184,7 @@ int check_account_for_errors(Log::Level log_level)
std::auto_ptr<Configuration> config(
Configuration::LoadAndVerify("testfiles/bbstored.conf",
&BackupConfigFileVerify, errs));
BackupStoreAccountsControl control(*config);
BackupStoreAccountControl control(*config);
int errors_fixed = control.CheckAccount(0x01234567,
true, // FixErrors
false, // Quiet
Expand Down

0 comments on commit 2aae786

Please sign in to comment.