Table of Contents

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

Dictionary<Guid, FiscalClient>

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

companyIdentification CompanyIdentification
storeNumber string
terminalNumber string

Returns

bool

True if the given client exists; otherwise false.

Exceptions

ArgumentNullException

Thrown if the parameter companyIdentification is set to null.

ArgumentNullException

Thrown if the parameter storeNumber is set to null or string.Empty.

ArgumentNullException

Thrown if the parameter terminalNumber is 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

clientId Guid

The client id to search.

Returns

bool

True if the given client exists; otherwise false.

Exceptions

ArgumentNullException

Thrown if parameter clientId is 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

licenseConsumerId Guid
storeNumber string
terminalNumber string

Returns

bool

True if the given client exists; otherwise false.

Exceptions

ArgumentNullException

Thrown if the parameter licenseConsumerId is set to Empty.

ArgumentNullException

Thrown if the parameter storeNumber is set to null or string.Empty.

ArgumentNullException

Thrown if the parameter terminalNumber is 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

client FiscalClient

The new client.

DeleteClient(Guid)

This method deletes the client from the configuration (and stores the configuration).

public override void DeleteClient(Guid clientId)

Parameters

clientId Guid

The id of the client to delete.

Exceptions

ArgumentNullException

Thrown if parameter clientId is 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

clientId Guid

The id (Guid) of the requested client configuration.

Returns

FiscalClient

The client configuration for the requested id.

Exceptions

ArgumentOutOfRangeException

Thrown if the client with the given parameter clientId does 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

clientId Guid

The id (Guid) of the requested client configuration.

fiscalClient FiscalClient

The 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

client FiscalClient

The client to update.

Exceptions

ArgumentNullException

Thrown if parameter client is set to null.

KeyNotFoundException

Thrown if client is not found in the store to update.