Table of Contents

Class CacheValidator

Namespace
Cuemon.Data.Integrity
Assembly
Cuemon.Data.Integrity.dll

Provides a way to represent cacheable data-centric content that can be validated by cache-aware applications.

public class CacheValidator : ChecksumBuilder, IEquatable<ChecksumBuilder>, IEntityInfo, IEntityDataTimestamp, IEntityDataIntegrity, IDataIntegrity
Inheritance
Object
CacheValidator
Implements
IEquatable<ChecksumBuilder>
Inherited Members

Constructors

CacheValidator(EntityInfo, Func<Hash>, EntityDataIntegrityMethod)

Initializes a new instance of the CacheValidator class.

public CacheValidator(EntityInfo entity, Func<Hash> hashFactory, EntityDataIntegrityMethod method = EntityDataIntegrityMethod.Unaltered)

Parameters

entity EntityInfo

An EntityInfo object that representing the meta-data of an entity.

hashFactory Func<Hash>

The function delegate that is invoked to produce the HashResult.

method EntityDataIntegrityMethod

A EntityDataIntegrityMethod enumeration value that indicates how a checksum is manipulated. Default is Unaltered.

Exceptions

System.ComponentModel.InvalidEnumArgumentException

method

Properties

AssemblyReference

Gets or sets the System.Reflection.Assembly that will serve as the ideal candidate for a CacheValidator reference point. Default is System.Reflection.Assembly.GetEntryAssembly with a fallback to Cuemon.Core.dll.

public static Assembly AssemblyReference { get; set; }

Property Value

Assembly

The assembly to use as a CacheValidator reference point.

Exceptions

System.ArgumentNullException

value is null.

Created

Gets a System.DateTime value from when data this instance represents was first created, expressed as the Coordinated Universal Time (UTC).

public DateTime Created { get; }

Property Value

DateTime

A System.DateTime value from when data this instance represents was first created, expressed as the Coordinated Universal Time (UTC).

Default

Gets a CacheValidator object that is initialized to a default representation that should be considered invalid for usage beyond this check.

public static CacheValidator Default { get; }

Property Value

CacheValidator

A CacheValidator object that is initialized to a default representation.

Method

Gets an enumeration value of EntityDataIntegrityMethod indicating the usage method of this instance.

public EntityDataIntegrityMethod Method { get; }

Property Value

EntityDataIntegrityMethod

One of the enumeration values of EntityDataIntegrityMethod that indicates the usage method of this instance.

Modified

Gets a System.DateTime value from when data this instance represents was last modified, expressed as the Coordinated Universal Time (UTC).

public DateTime? Modified { get; }

Property Value

Nullable<DateTime>

A System.DateTime value from when data this instance represents was last modified, expressed as the Coordinated Universal Time (UTC).

ReferencePoint

Gets a CacheValidator object that represents an System.Reflection.Assembly reference point.

public static CacheValidator ReferencePoint { get; }

Property Value

CacheValidator

A CacheValidator object that represents an System.Reflection.Assembly reference point.

Validation

Gets an enumeration value of EntityDataIntegrityValidation indicating the strength of this instance.

public EntityDataIntegrityValidation Validation { get; }

Property Value

EntityDataIntegrityValidation

One of the enumeration values of EntityDataIntegrityValidation that specifies the strength of this instance.

Methods

Clone()

Creates a shallow copy of the current CacheValidator object.

public virtual CacheValidator Clone()

Returns

CacheValidator

A new CacheValidator that is a copy of this instance.

CombineWith(Byte[])

Combines the additionalChecksum to the representation of this instance.

public override ChecksumBuilder CombineWith(byte[] additionalChecksum)

Parameters

additionalChecksum Byte[]

A byte[] containing a checksum of the additional data this instance must represent.

Returns

ChecksumBuilder

A reference to this instance after the operation has completed.

GetMostSignificant()

Gets the most significant (largest) value of either Created or Modified.

public DateTime GetMostSignificant()

Returns

DateTime

The most significant (largest) value of either Created or Modified.

GetMostSignificant(CacheValidator[])

Gets the most significant CacheValidator object from the most significant (largest) value of either Created or Modified in the specified sequence.

public static CacheValidator GetMostSignificant(params CacheValidator[] sequence)

Parameters

sequence CacheValidator[]

A sequence of CacheValidator objects to parse for the most significant (largest) value of either Created or Modified.

Returns

CacheValidator

The most significant CacheValidator object from the specified sequence.