C# Class FiftyOne.Foundation.Mobile.Redirection.Azure.RequestHistory

Inheritance: IRequestHistory
ファイルを表示 Open project: 51Degrees/dotNET-Device-Detection

Public Methods

Method Description
IsPresent ( HttpRequest request ) : bool

Determines if the device making the request has been seen by the web site previously.

Remove ( HttpRequest request ) : void

Removes the device behind the request.

Set ( HttpRequest request ) : void

Sets the last active time for the device making the request.

Private Methods

Method Description
CheckIfServiceRequired ( ) : void

If the last time the devices file was serviced to remove old entries is older than 1 minute start a thread to service the devices file and remove old entries. If the redirect timeout is 0 indicating infinite then nothing should be purged.

GetEntityFromContext ( RequestRecord record ) : RequestEntity

Returns the entity if present from the current context.

GetEntityFromTable ( RequestRecord record ) : RequestEntity

Returns the entity if present from the table service. Should only be called after checking the entity is not already present in the context.

Remove ( RequestRecord record ) : void

Removes the request device details from the table, and then removes from memory once the table has been updated.

RequestHistory ( ) : System
ServiceRequestHistory ( object value ) : void

Removes old entries that are held within this context from the table store using a single save changes operation. This means the service happens using one HTTP request which saves a lot of money with Azure. Unfortunately it does mean that there is a possibility request data not known to this instance will not be removed.

Set ( RequestRecord record ) : void

Adds the record to the table storage service, or if it already exists updates the last active date and time.

Method Details

IsPresent() public method

Determines if the device making the request has been seen by the web site previously.
public IsPresent ( HttpRequest request ) : bool
request System.Web.HttpRequest The request from the device.
return bool

Remove() public method

Removes the device behind the request.
public Remove ( HttpRequest request ) : void
request System.Web.HttpRequest The request from the device.
return void

Set() public method

Sets the last active time for the device making the request.
public Set ( HttpRequest request ) : void
request System.Web.HttpRequest The request from the device.
return void