Class CachedConfigurationProviderBase
- Namespace
- RetailForce.Fiscalisation.Configuration
- Assembly
- RetailForce.Fiscalisation.Model.dll
Abstract configuration provider to load the configuration into cache memory for the fiscal system.
public abstract class CachedConfigurationProviderBase : ConfigurationProviderBase
- Inheritance
-
CachedConfigurationProviderBase
- Derived
- Inherited Members
Fields
Clients
The list of all clients stored at this provider.
protected Dictionary<Guid, FiscalClient> Clients
Field Value
Methods
ClientExists(CompanyIdentification, string, string)
Returns whether the given client exists in the client dictionary.
public override bool ClientExists(CompanyIdentification companyIdentification, string storeNumber, string terminalNumber)
Parameters
companyIdentificationCompanyIdentificationstoreNumberstringterminalNumberstring
Returns
- bool
True if the given client exists; otherwise false.
Exceptions
- ArgumentNullException
Thrown if the parameter
companyIdentificationis set to null.- ArgumentNullException
Thrown if the parameter
storeNumberis set to null or string.Empty.- ArgumentNullException
Thrown if the parameter
terminalNumberis set to null or string.Empty.
ClientExists(Guid)
Returns whether the given client exists in the client dictionary.
public override bool ClientExists(Guid clientId)
Parameters
clientIdGuidThe client id to search.
Returns
- bool
True if the given client exists; otherwise false.
Exceptions
- ArgumentNullException
Thrown if parameter
clientIdis set to Empty.
ClientExists(Guid, string, string)
Returns whether the given client exists in the client dictionary.
public override bool ClientExists(Guid licenseConsumerId, string storeNumber, string terminalNumber)
Parameters
Returns
- bool
True if the given client exists; otherwise false.
Exceptions
- ArgumentNullException
Thrown if the parameter
licenseConsumerIdis set to Empty.- ArgumentNullException
Thrown if the parameter
storeNumberis set to null or string.Empty.- ArgumentNullException
Thrown if the parameter
terminalNumberis set to null or string.Empty.
CreateClient(FiscalClient)
Creates a new client and stores it to the store.
public override void CreateClient(FiscalClient client)
Parameters
clientFiscalClientThe new client.
DeleteClient(Guid)
This method deletes the client from the configuration (and stores the configuration).
public override void DeleteClient(Guid clientId)
Parameters
clientIdGuidThe id of the client to delete.
Exceptions
- ArgumentNullException
Thrown if parameter
clientIdis set to Empty.- KeyNotFoundException
Thrown if given client was not found in the configuration.
GetClientConfiguration(Guid)
Returns the client configuration for the requested id.
public override FiscalClient GetClientConfiguration(Guid clientId)
Parameters
Returns
- FiscalClient
The client configuration for the requested id.
Exceptions
- ArgumentOutOfRangeException
Thrown if the client with the given parameter
clientIddoes not exist.
GetClients()
Gets a list of all available clients stored at the system.
public override Guid[] GetClients()
Returns
- Guid[]
A list of all available unique client id's.
GetFiscalClients()
Gets a list of all available clients stored at the system.
public override FiscalClient[] GetFiscalClients()
Returns
- FiscalClient[]
A list of all available unique client id's.
LoadConfiguration()
Loads the configuration into memory from the appropriate store.
protected abstract void LoadConfiguration()
StoreConfiguration()
Stores the configuration from memory into the appropriate store.
protected abstract void StoreConfiguration()
TryGetClientConfiguration(Guid, out FiscalClient)
Tries to return the client configuration (return value = true); otherwise false.
public override bool TryGetClientConfiguration(Guid clientId, out FiscalClient fiscalClient)
Parameters
clientIdGuidThe id (Guid) of the requested client configuration.
fiscalClientFiscalClientThe client configuration for the requested id (if found).
Returns
- bool
True if the client configuration was found; otherwise false.
UpdateClient(FiscalClient)
Updates a client and stores the configuration.
public override void UpdateClient(FiscalClient client)
Parameters
clientFiscalClientThe client to update.
Exceptions
- ArgumentNullException
Thrown if parameter
clientis set to null.- KeyNotFoundException
Thrown if client is not found in the store to update.