In file /home/eternity/Source/Common/ACManager/H/acManager.h:

class ACManager : public Debugable

ACManager

Inheritance:

ACManager < Debugable


Public Methods

Err ACManager::ACCount (Int *count)
Get count of certificates
ACManager::ACManager (const Char *aType, Char* aTableName, const Int minACCountP, const Int maxACCountP, LogFile *aLogFile, const RelTime *countTestP, const RelTime *gotCertifTestP)
Access certificate manger constructor
TableFieldQueue* ACManager::CreateDefinition ()
Creates a definition of Table
GMessage* ACManager::GetACByACID (ACID acID)
Finds and returns the AC according to its ACID
Queue* ACManager::GetACs (const Int count, Queue *notIn)
Get access certificates
Err ACManager::InsertAC (GMessage* ac)
Insert Access certificate
ESTime ACManager::NextTimeOut ()
Returns time of next timeout
Err ACManager::TestACCount (Int *countOfMissingACs)
Finds out how many certificates are missing
ACManager::~ACManager ()
Access certificates manager destructor

Public

methods
ACManager (const Char *aType, Char* aTableName, const Int minACCountP = 1, const Int maxACCountP = 1, LogFile *aLogFile = NULL, const RelTime *countTestP = NULL, const RelTime *gotCertifTestP = NULL)
Constructor
virtual ~ACManager ()
destructor
Err InsertAC (GMessage* ac)
inserts AC into the table
Queue* GetACs (const Int count = 1, Queue *notIn = NULL)
returns queue of [count] GMessages (ACs), that are not in [notIn] queue if there are less then count
GMessage* GetACByACID (ACID acID)
finds the AC according to its ACID
ESTime NextTimeOut ()
tells the Scheduler to set the timeout
Err TestACCount (Int *countOfMissingACs)
controlling of count of ACs at timeout returns a GMessage for MIX, if it is necessary to get new ACs or NULL if number of ACs is between minACCount and maxACCount

Protected

attributes
methods
TableFieldQueue* CreateDefinition ()
creates definition of acTable - used only in constructor
Err ACCount (Int *count)
returns count of not expired ACs, deletes expired ACs

Inherited from Debugable:

Public Methods

string* Debugable::CreateString(char *firstStr, int firstInt, int secondInt)
Debugable::Debugable(LogFile * debugLogFile)
int Debugable::SetDebugOptions(int newLogOptions)
void Debugable::SetLogFile(LogFile *aLogFile)
void Debugable::WriteString(LogLevel debugLevel, char * format, ...)
Debugable::~Debugable()

Documentation

ACManager. encapsulates the table of Access certificates
attributes

methods

TableFieldQueue* CreateDefinition()
creates definition of acTable - used only in constructor

Err ACCount(Int *count)
returns count of not expired ACs, deletes expired ACs

methods

ACManager(const Char *aType, Char* aTableName, const Int minACCountP = 1, const Int maxACCountP = 1, LogFile *aLogFile = NULL, const RelTime *countTestP = NULL, const RelTime *gotCertifTestP = NULL)
Constructor

virtual ~ACManager()
destructor

Err InsertAC(GMessage* ac)
inserts AC into the table

Queue* GetACs(const Int count = 1, Queue *notIn = NULL)
returns queue of [count] GMessages (ACs), that are not in [notIn] queue if there are less then count

GMessage* GetACByACID(ACID acID)
finds the AC according to its ACID

ESTime NextTimeOut()
tells the Scheduler to set the timeout

Err TestACCount(Int *countOfMissingACs)
controlling of count of ACs at timeout returns a GMessage for MIX, if it is necessary to get new ACs or NULL if number of ACs is between minACCount and maxACCount

Err ACManager::ACCount(Int *count)
Get count of certificates. Returns the current count of certificates in the manager - used to keep the number in the range specified on creation of AC manager.
Returns:
Error code
Parameters:
count - out parameter that gets filled with the count of certificates currently in AC manager.
Author:
marek
See Also:
ACManager()

ACManager::ACManager(const Char *aType, Char* aTableName, const Int minACCountP, const Int maxACCountP, LogFile *aLogFile, const RelTime *countTestP, const RelTime *gotCertifTestP)
Access certificate manger constructor. Takes care of certificates of certain type. Keeps the number between specified ranges and downloads new certificates if necessary.
Parameters:
aType - Type of certificates to store.
aTableName - Table where to store the certificates.
minACCountP - Minimum number of certificates to keep.
maxACCountP - Maximum number of certificates to keep.
aLogFile - Log file for debug messages.
countTestP - Time to wait before checking if we have enough certificates
gotCertifTestP - Time to wait before checking if certificates arrived
Author:
marek
See Also:
Six

TableFieldQueue* ACManager::CreateDefinition()
Creates a definition of Table. This table is then used for storage of access certificates of type specified in constructor.
Returns:
Array of fields that will be in the queue.
Author:
marek
See Also:
ACManager(), Table

GMessage* ACManager::GetACByACID(ACID acID)
Finds and returns the AC according to its ACID. Searches the internal table of certificates for an access certificate with the specified access certificate ID.
Returns:
Access certificate that matches the query.
Parameters:
acID -
Author:
marek
See Also:
Six

Queue* ACManager::GetACs(const Int count, Queue *notIn)
Get access certificates. Gets count ACs, that are not in notIn Queue if there are less then count of such of them, returns less.
Returns:
List of certificates that matchthe query.
Parameters:
count - Number of certificates to return.
notIn - List of forbidden certificates.
Author:
marek
See Also:
Six

Err ACManager::InsertAC(GMessage* ac)
Insert Access certificate. Inserts a GMessage into the table (or rewrites old record with same ACID)
Returns:
Error code
Parameters:
ac - Access certificate that should be inserted.
Author:
marek

ESTime ACManager::NextTimeOut()
Returns time of next timeout. Works around scheduler for now - finds out the time of next timeout.
Returns:
Time when the timeout should occur.
Author:
marek
See Also:
Scheduler

Err ACManager::TestACCount(Int *countOfMissingACs)
Finds out how many certificates are missing. Controlling the count of ACs at timeout returns a GMessage for mix, if necessary to get certificates.
Returns:
Error code
Parameters:
countOfMissingACs - out parametr taht is filled with number of necessary access certificates.
Author:
marek
See Also:
Tests if the access certificates count is in the range specified.

ACManager::~ACManager()
Access certificates manager destructor. Deletes all certificates from memory.
Author:
marek
See Also:
ACManager(), Table


This class has no child classes.
Author:
Marek
See Also:

alphabetic index hierarchy of classes


generated by doc++