Table of Contents

Class StorageRecord

Namespace
RetailForce.Fiscalisation.Storage
Assembly
RetailForce.Fiscalisation.Model.dll

Storage record for storage streams.

public abstract class StorageRecord : IEquatable<StorageRecord>
Inheritance
StorageRecord
Implements
Derived
Inherited Members

Remarks

Storage format: [{base64-algorithm}.]{base64-data}[.{base64-signature}]

Properties

Data

The plain data in utf8 encoding.

[JsonIgnore]
public string Data { get; protected set; }

Property Value

string

Remarks

The data will be base64- or base64-url-encoded (depending on DataStorage<TData>.UrlEncode).

RecordDateTime

The datetime for this storage record.

public DateTime RecordDateTime { get; set; }

Property Value

DateTime

Signature

The signature for the data (base64 encoded or base64 url encoded (DataStorage<TData>.UrlEncode).

[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string Signature { get; set; }

Property Value

string

Methods

Algorithm()

Returns a possible algorithm for the storage record. Empty string can be returned.

public virtual string Algorithm()

Returns

string

A possible algorithm for the storage record. Empty string can be returned.

Equals(StorageRecord)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(StorageRecord other)

Parameters

other StorageRecord

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetData()

Method to get data property. Override in inherited class to get data in string notation.

protected abstract string GetData()

Returns

string

ResolveDataStorageRecord<TData>(string, bool, bool, bool)

Resolves a storage record stored in format yyyymmddhhmmssnnn.algorithm.data.signature

public static TData ResolveDataStorageRecord<TData>(string data, bool algorithmMandatory, bool signatureMandatory, bool urlEncode) where TData : StorageRecord, new()

Parameters

data string

The data to

algorithmMandatory bool

True if the algorithm must exist.

signatureMandatory bool

True if the signature must exist.

urlEncode bool

True if the data is url-encoded.

Returns

TData

The StorageRecord of type TData.

Type Parameters

TData

The type which should be returned.

SetData(string)

Method to set data property. Override in inherited class to parse data if necessary.

protected abstract void SetData(string data)

Parameters

data string

The data to set.

Exceptions

ArgumentNullException

Thrown if parameter data is set to null or Empty.