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
urlstringThe 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
urlstringThe URL of the REST endpoint.
usernamestringThe user name for authentication.
passwordstringThe password for authentication.
domainstringThe domain for authentication.
Properties
ConnectionTimeout
Gets or sets the connection timeout (in seconds) for REST requests.
public int ConnectionTimeout { get; set; }
Property Value
Headers
Gets the collection of HTTP headers that will be used for the REST request.
public HttpRequestHeaders Headers { get; }
Property Value
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
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
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
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
disposingbooltrueto release both managed and unmanaged resources;falseto 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
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
loggerILlLoggerThe logger to set.
overrideExistingboolSpecifies 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