blob: 2fbe486d66a5ee45cd62f738193c6c1edc94cdfd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
// --------------------------------------------------------------------------
//
// File
// Name: BackupStoreDaemon.h
// Purpose: Backup store daemon
// Created: 2003/08/20
//
// --------------------------------------------------------------------------
#ifndef BACKUPSTOREDAEMON__H
#define BACKUPSTOREDAEMON__H
#include "ServerTLS.h"
#include "BoxPortsAndFiles.h"
#include "BackupConstants.h"
#include "IOStreamGetLine.h"
class BackupStoreAccounts;
class BackupStoreAccountDatabase;
class HousekeepStoreAccount;
// --------------------------------------------------------------------------
//
// Class
// Name: BackupStoreDaemon
// Purpose: Backup store daemon implementation
// Created: 2003/08/20
//
// --------------------------------------------------------------------------
class BackupStoreDaemon : public ServerTLS<BOX_PORT_BBSTORED>
{
friend class HousekeepStoreAccount;
public:
BackupStoreDaemon();
~BackupStoreDaemon();
private:
BackupStoreDaemon(const BackupStoreDaemon &rToCopy);
public:
// For BackupContext to comminicate with housekeeping process
void SendMessageToHousekeepingProcess(const void *Msg, int MsgLen)
{
mInterProcessCommsSocket.Write(Msg, MsgLen);
}
protected:
virtual void SetupInInitialProcess();
virtual void Run();
void Connection(SocketStreamTLS &rStream);
virtual const char *DaemonName() const;
virtual const char *DaemonBanner() const;
const ConfigurationVerify *GetConfigVerify() const;
// Housekeeping functions
void HousekeepingProcess();
bool CheckForInterProcessMsg(int AccountNum = 0, int MaximumWaitTime = 0);
void LogConnectionStats(const char *commonName, const SocketStreamTLS &s);
private:
BackupStoreAccountDatabase *mpAccountDatabase;
BackupStoreAccounts *mpAccounts;
bool mExtendedLogging;
bool mHaveForkedHousekeeping;
bool mIsHousekeepingProcess;
SocketStream mInterProcessCommsSocket;
IOStreamGetLine mInterProcessComms;
};
#endif // BACKUPSTOREDAEMON__H
|