Table of Contents

Class RestDataProvider

Namespace
combit.Reporting.DataProviders
Assembly
combit.ListLabel31.CrossPlatform.dll

Provides a data provider implementation that retrieves data via RESTful web services. The provider supports both OAuth 2.0 authentication and simple file-based access. It resolves the downloaded content to either an XML or JSON data provider.

public class RestDataProvider : IDataProvider, ISupportsLogger, IDisposable
Inheritance
RestDataProvider
Implements
Inherited Members

Constructors

RestDataProvider(string)

Initializes a new instance of the RestDataProvider class with the specified URL.

public RestDataProvider(string url)

Parameters

url string

The URL of the REST endpoint.

RestDataProvider(string, string, string, string)

Initializes a new instance of the RestDataProvider class with the specified URL and credentials.

public RestDataProvider(string url, string username, string password, string domain)

Parameters

url string

The URL of the REST endpoint.

username string

The user name for authentication.

password string

The password for authentication.

domain string

The domain for authentication.

Properties

ConnectionTimeout

Gets or sets the connection timeout (in seconds) for REST requests.

public int ConnectionTimeout { get; set; }

Property Value

int

Headers

Gets the collection of HTTP headers that will be used for the REST request.

public HttpRequestHeaders Headers { get; }

Property Value

HttpRequestHeaders

OAuth2Connection

Gets or sets the OAuth 2.0 connection details used for making authenticated web requests to the Url.

public OAuth2Connection OAuth2Connection { get; set; }

Property Value

OAuth2Connection

RootTableName

Gets or sets the root table name that should be used by the underlying JSON data provider, if it is not null or an empty string. Only applicable for JSON results.

public string RootTableName { get; set; }

Property Value

string

Url

Gets or sets the URL used for the REST request. When set, the provider resets its initialization state and marks all current tables as volatile.

public string Url { get; protected set; }

Property Value

string

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Releases the unmanaged resources used by the RestDataProvider and optionally releases the managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

ResolveDataProvider(string)

Resolves the downloaded content to a specific data provider instance. The base implementation detects XML or JSON content and returns an XmlDataProvider or JsonDataProvider accordingly.

protected virtual IDataProvider ResolveDataProvider(string content)

Parameters

content string

The downloaded plain text content from the specified Url.

Returns

IDataProvider

An instance of IDataProvider corresponding to the content.

SetLogger(ILlLogger, bool)

Sets the logger for the object.

public void SetLogger(ILlLogger logger, bool overrideExisting)

Parameters

logger ILlLogger

The logger to set.

overrideExisting bool

Specifies whether to override an existing logger.

Events

OAuth2TokenRefreshed

Occurs when OAuth 2.0 tokens are refreshed. Use this event to update the stored refresh token with the new value.

public event EventHandler<OAuth2TokenRefreshedEventArgs> OAuth2TokenRefreshed

Event Type

EventHandler<OAuth2TokenRefreshedEventArgs>