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
Inherited Members
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 |
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 |
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 |
|
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 |
|
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()