Show / Hide Table of Contents

Class DatabaseIDCache

The database ID cache stores IDs in a database.

The database ID cache is suitable for applications deployed to a web farm.

Inheritance
System.Object
DatabaseIDCache
Implements
IIDCache
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: ComponentSpace.SAML2.Data
Assembly: ComponentSpace.Saml2.dll
Syntax
public class DatabaseIDCache : IIDCache, IDisposable

Constructors

DatabaseIDCache()

Constructs a DatabaseIDCache.

The default database connection string name is assumed to be configured in web.config.

Declaration
public DatabaseIDCache()

DatabaseIDCache(String)

Constructs a DatabaseIDCache.

Declaration
public DatabaseIDCache(string connectionStringName)
Parameters
Type Name Description
System.String connectionStringName

The database connection string name configured in web.config.

DatabaseIDCache(String, String)

Constructs a DatabaseIDCache.

Declaration
public DatabaseIDCache(string connectionStringName, string tableName)
Parameters
Type Name Description
System.String connectionStringName

The database connection string name configured in web.config.

System.String tableName

The database table name or null to use the default name.

DatabaseIDCache(String, String, String)

Constructs a DatabaseIDCache.

Declaration
public DatabaseIDCache(string providerName, string connectionString, string tableName)
Parameters
Type Name Description
System.String providerName

The database provider name.

System.String connectionString

The database connection string.

System.String tableName

The database table name or null to use the default name.

Properties

DeleteExpiredPriorToAdd

Gets or sets the flag indicating whether expired entries should be deleted prior to adding an entry. The default is true.

Declaration
public bool DeleteExpiredPriorToAdd { get; set; }
Property Value
Type Description
System.Boolean

The flag indicating whether expired entries should be deleted prior to adding an entry.

ExpirationDateTimeColumnName

Gets or sets the name of the expiration date/time column. The default name is ExpirationDateTime.

Declaration
public string ExpirationDateTimeColumnName { get; set; }
Property Value
Type Description
System.String

The name of the expiration date/time column.

IDColumnName

Gets or sets the name of the ID column. The default name is ID.

Declaration
public string IDColumnName { get; set; }
Property Value
Type Description
System.String

The name of the ID column.

Methods

Add(String, DateTime)

Adds the ID with an associated expiration time to the cache.

Declaration
public virtual bool Add(string id, DateTime expirationDateTime)
Parameters
Type Name Description
System.String id

The ID.

System.DateTime expirationDateTime

The expiration time.

Returns
Type Description
System.Boolean

true if the ID doesn't already exist in the cache; otherwise false.

DeleteExpired()

Deletes any expired IDs from the cache.

Declaration
public virtual int DeleteExpired()
Returns
Type Description
System.Int32

The number of expired IDs deleted from the cache.

Dispose()

Dispose of the database ID cache.

Declaration
public void Dispose()

Dispose(Boolean)

Dispose of the database ID cache.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

true if called by user code; false if called by the runtime from within the finalizer

StartDeletingExpired(TimeSpan, TimeSpan)

Schedules the deletion of expired IDs starting at the due time and repeating periodically.

Declaration
public virtual void StartDeletingExpired(TimeSpan dueTime, TimeSpan period)
Parameters
Type Name Description
System.TimeSpan dueTime

The due time to start deleting expired IDs.

System.TimeSpan period

The period to wait before next deleting expired IDs.

StopDeletingExpired()

Stops any scheduled deletion of expired IDs.

Declaration
public virtual void StopDeletingExpired()

Implements

IIDCache
System.IDisposable
In This Article
Back to top Copyright © ComponentSpace Pty Ltd 2004-2022. All rights reserved.