Skip to content

CloudClient

Namespace: ThinkGeo.Core

A base class that handles the underlying authentication and communication with the GIS Server.

public abstract class CloudClient : System.IDisposable

Inheritance ObjectCloudClient
Implements IDisposable

Remarks:

A base class that handles the underlying authentication and communication with the GIS Server.

Properties

TimeoutInSeconds

The request timeout, default 100 seconds

public int TimeoutInSeconds { get; set; }

Property Value

Int32

WebProxy

The proxy used for requesting a Web Response.

public IWebProxy WebProxy { get; set; }

Property Value

IWebProxy

ClientId

A GIS Server NativeConfidential client ID.

public string ClientId { get; set; }

Property Value

String

ClientSecret

A GIS Server NativeConfidential client secret.

public string ClientSecret { get; set; }

Property Value

String

BaseUris

Candidate Gis Server Uris. This collection must have one uri at least before sending any request.

public Collection<Uri> BaseUris { get; }

Property Value

Collection<Uri>

Methods

AuthenticateWebRequest(WebRequest)

Apply token to header of the webRequest

protected void AuthenticateWebRequest(WebRequest webRequest)

Parameters

webRequest WebRequest
The webRequest which need to apply token to header

AuthenticateWebRequestAsync(WebRequest)

Apply token to header of the webRequest

protected Task AuthenticateWebRequestAsync(WebRequest webRequest)

Parameters

webRequest WebRequest
The webRequest which need to apply token to header

Returns

Task

GetToken()

Get an AccessToken from server.

protected string GetToken()

Returns

String
The AccessToken from server. if the request is canceled by user, return null

GetTokenAsync()

Get an AccessToken from server.

protected Task<string> GetTokenAsync()

Returns

Task<String>
The AccessToken from server. if the request is canceled by user, return null

GetTokenCoreAsync()

Get an AccessToken from server.

protected Task<string> GetTokenCoreAsync()

Returns

Task<String>
The AccessToken from server. if the request is canceled by user, return null

GetTokenCore()

protected string GetTokenCore()

Returns

String

SendWebRequest(WebRequest)

Send the web request, the access token will be added to web request header.

protected WebResponse SendWebRequest(WebRequest webRequest)

Parameters

webRequest WebRequest

Returns

WebResponse
The HTTP response.

SendWebRequestAsync(WebRequest)

Send the web request asynchronously, the access token will be added to web request header.

protected Task<WebResponse> SendWebRequestAsync(WebRequest webRequest)

Parameters

webRequest WebRequest

Returns

Task<WebResponse>
The HTTP response.

GetNextCandidateBaseUri()

Get a Gis Server uri in BaseUris by polling way

protected string GetNextCandidateBaseUri()

Returns

String
A Gis Server uri

GetNextCandidateBaseUriCore()

Get a Gis Server uri in BaseUris by polling method

protected string GetNextCandidateBaseUriCore()

Returns

String
A Gis Server uri

OnGettingAccessToken(GettingAccessTokenEventArgs)

Occurs before getting an AccessToken.

protected void OnGettingAccessToken(GettingAccessTokenEventArgs e)

Parameters

e GettingAccessTokenEventArgs
Event argument for GettingAccessToken event.

OnSendingWebRequest(SendingWebRequestEventArgs)

Occurs before sending a web request.

protected void OnSendingWebRequest(SendingWebRequestEventArgs e)

Parameters

e SendingWebRequestEventArgs
Event argument for SendingWebRequest event.

OnSentWebRequest(SentWebRequestEventArgs)

Occurs after the response of a web request is gotten.

protected void OnSentWebRequest(SentWebRequestEventArgs e)

Parameters

e SentWebRequestEventArgs
Event argument for SentWebRequest event.

Dispose()

Disposes BaseClient class.

public void Dispose()

Events

GettingAccessToken

Occurs before getting an AccessToken.

public event EventHandler<GettingAccessTokenEventArgs> GettingAccessToken;

SendingWebRequest

Occurs before sending a web request.

public event EventHandler<SendingWebRequestEventArgs> SendingWebRequest;

SentWebRequest

Occurs after the response of a web request is gotten.

public event EventHandler<SentWebRequestEventArgs> SentWebRequest;