C# Class Microsoft.Synchronization.ClientServices.HttpCacheRequestHandler

A Http transport implementation for processing a CachedRequest.
Inheritance: Microsoft.Synchronization.ClientServices.CacheRequestHandler
Datei anzeigen Open project: rafek/SyncFx Class Usage Examples

Public Methods

Method Description
HttpCacheRequestHandler ( Uri serviceUri, Microsoft.Synchronization.ClientServices.CacheControllerBehavior behaviors, Microsoft.Synchronization.ClientServices.AsyncWorkerManager manager ) : System
ProcessCacheRequestAsync ( Microsoft.Synchronization.ClientServices.CacheRequest request, object state ) : void

Called by the CacheController when it wants this CacheRequest to be processed asynchronously.

Private Methods

Method Description
CacheRequestCompleted ( object state ) : void

Callback invoked when the cache request has been processed.

CheckEntityServiceMetadataAndTempIds ( AsyncArgsWrapper wrapper, IOfflineEntity entity, string tempId ) : void
FirePostResponseHandler ( AsyncArgsWrapper wrapper ) : void

Invokes the user's AfterReceivingResponse callback.

FirePreRequestHandler ( object state ) : void

Invokes the user BeforeSendingRequest callback. It also passes the resumption handler for the user to call when they are done with the customizations on the request.

GetWebResponse ( AsyncArgsWrapper wrapper ) : void

Issues the BeginGetResponse call for the HttpWebRequest

OnDownloadGetRequestStreamCompleted ( IAsyncResult asyncResult ) : void

Callback for the Download HttpWebRequest.beginGetRequestStream

OnDownloadGetResponseCompleted ( IAsyncResult asyncResult ) : void

Callback for the Download HttpWebRequest.beginGetRequestStream. Deserializes the response feed to retrieve the list of IOfflineEntity objects and constructs an ChangeSet for that.

OnUploadGetRequestStreamCompleted ( IAsyncResult asyncResult ) : void

Callback for the Upload HttpWebRequest.beginGetRequestStream

OnUploadGetResponseCompleted ( IAsyncResult asyncResult ) : void

Callback for the Upload HttpWebRequest.BeginGetResponse call

ProcessCacheRequestWorker ( Microsoft.Synchronization.ClientServices.AsyncWorkRequest worker, object inputParams ) : void

Actual worker performing the work

ProcessRequest ( AsyncArgsWrapper wrapper ) : void

Method that does the actual processing. 1. It first creates an HttpWebRequest 2. Fills in the required method type and parameters. 3. Attaches the user specified ICredentials. 4. Serializes the input params (Server blob for downloads and input feed for uploads) 5. If user has specified an BeforeSendingRequest callback then invokes it 6. Else proceeds to issue the request

ResumeRequestProcessing ( HttpWebRequest request ) : void

Handler that the user will call when they want the request to resume processing. It will check to ensure that the correct WebRequest is passed back to this resumption point. Else an error will be thrown.

Method Details

HttpCacheRequestHandler() public method

public HttpCacheRequestHandler ( Uri serviceUri, Microsoft.Synchronization.ClientServices.CacheControllerBehavior behaviors, Microsoft.Synchronization.ClientServices.AsyncWorkerManager manager ) : System
serviceUri System.Uri
behaviors Microsoft.Synchronization.ClientServices.CacheControllerBehavior
manager Microsoft.Synchronization.ClientServices.AsyncWorkerManager
return System

ProcessCacheRequestAsync() public method

Called by the CacheController when it wants this CacheRequest to be processed asynchronously.
public ProcessCacheRequestAsync ( Microsoft.Synchronization.ClientServices.CacheRequest request, object state ) : void
request Microsoft.Synchronization.ClientServices.CacheRequest CacheRequest to be processed
state object User state object
return void