Class ScraperService

Namespace
Subsembly.Scraper
Assembly
Subsembly.Scraper.dll

Global root where all scrapers are registered.

public static class ScraperService
Inheritance
ScraperService
Inherited Members

Remarks

Use this static class in order to find and get a scraper implementation. A scraper can be sought for its ability to scrape a particular account using FindScraper(JsonObject). This operation is expensive, therefore its should not be used repeatedly.

In order to enable access to account via FinTS you must add a reference to the Subsembly.Scraper.FinTS assembly and call ScraperFinTS.Register().

Properties

ApiVersion

Provides the version of the Subsembly XS2A API

public static Version ApiVersion { get; }

Property Value

Version

Methods

CreateContact(JsonObject)

Create a new scraper contact object for a given account.

public static IScraperContact CreateContact(JsonObject jsAcct)

Parameters

jsAcct JsonObject

Account details of the account that shall be scraped.

Returns

IScraperContact

If no matching scraper is available for the given account, then null is returned. If the account can be scraped, then a new IScraperContact implementing instance is created, initialized with data from the account and returned.

DownloadStatement(out SepaDocument, JsonObject, JsonObject, DateTime)

public static ScraperResult DownloadStatement(out SepaDocument aCamtDoc, JsonObject jsCred, JsonObject jsAcct, DateTime tFromDate)

Parameters

aCamtDoc SepaDocument
jsCred JsonObject
jsAcct JsonObject
tFromDate DateTime

Returns

ScraperResult

FindScraper(JsonObject)

Finds the first scraper that can handle the given account.

public static IScraper FindScraper(JsonObject jsAcct)

Parameters

jsAcct JsonObject

Returns

IScraper

If a registered scraper was found that can handle the given account, then the registered instance is returned. If none was found, then null is returned.

FindScraper(string)

Finds a registered scraper by its ClassName.

public static IScraper FindScraper(string sClassName)

Parameters

sClassName string

A name that uniquely identifies a scraper implementation. This is usually the actual class name of the implementation sans the Scraper prefix.

Returns

IScraper

If a registered scraper with the given class name was found, then the registered instance is returned. If none was found, then null is returned.

FindScrapers(JsonObject)

Returns a list of all scrapers, that can handle the given account.

public static ScraperProductInfo[] FindScrapers(JsonObject jsAcct)

Parameters

jsAcct JsonObject

Returns

ScraperProductInfo[]

List of ScraperProductInfo that support the given account. This might be an empty array, if there is no scraper, that is capable of handling the given account. This is never null.

GetAllScrapers(ScraperProductType)

public static ScraperProductInfo[] GetAllScrapers(ScraperProductType nProductType)

Parameters

nProductType ScraperProductType

Returns

ScraperProductInfo[]

GetProductInfo(JsonObject)

Tries to get the account product information for the given account.

public static ScraperProductInfo GetProductInfo(JsonObject jsAcct)

Parameters

jsAcct JsonObject

Returns

ScraperProductInfo

If no account product information could be determined for the given account, then null is returned. Otherwise information about the given account is returned.

LoadObject(JsonObject)

Creates and loads a scraper object that was previously saved by SaveObject(IScraperPersist).

public static IScraperPersist LoadObject(JsonObject jsState)

Parameters

jsState JsonObject

The persisted state from a previous call to SaveObject(IScraperPersist). Must not be null.

Returns

IScraperPersist

A new object instance initialized with the data from the given JSON object.

RegisterBuiltInScrapers()

Registers all built-in scrapers.

public static void RegisterBuiltInScrapers()

Remarks

It is not really necessary to call this method, as it is called automatically by FindScraper(JsonObject) or FindScraper(string) whenever the list of registered scrapers is empty.

By default the special ScraperFinTS, which uses FinTS to access bank accounts, is NOT included in the registered scrapers. If you want this to be included, the method ScraperFinTS.Register() must be called after this method.

RegisterDummyScraper()

Registers and installs the ScraperDummy as the first entry.

public static void RegisterDummyScraper()

RegisterScraper(IScraper)

public static void RegisterScraper(IScraper aScraper)

Parameters

aScraper IScraper

SaveObject(IScraperPersist)

Saves a scraper object with its class name, so that it can be loaded by LoadObject(JsonObject).

public static JsonObject SaveObject(IScraperPersist aScraperObject)

Parameters

aScraperObject IScraperPersist

THe scraper object that shall be persisted. Must not be null.

Returns

JsonObject

A JSON object that contains the persisted state of the object.