Class ScraperResult
Information about a success or failure result, returned from scraper methods.
Inheritance
Inherited Members
Namespace: Subsembly.Scraper
Assembly: Subsembly.Scraper.dll
Syntax
public sealed class ScraperResult
Remarks
A scraper method that is declared to return an instance of ScraperResult
must never return null
. For convenience there are two static result instances
that indicate Subsembly.Scraper.ScraperResult.Success or Subsembly.Scraper.ScraperResult.Failure. The latter should rarely
be used, if at all. An implementation shall always try to return as much error
information as possible. As an additional convenience, the constructor
ScraperResult(Exception) can be used to easily convert runtime exceptions
to a ScraperResult.
Constructors
ScraperResult(ScraperResultChallengeType, String, Byte[])
Creates a ChallengeResponseNeeded result.
Declaration
public ScraperResult(ScraperResultChallengeType nChallengeType, string sDisplayText, byte[] vbChallengeData)
Parameters
Type | Name | Description |
---|---|---|
ScraperResultChallengeType | nChallengeType | |
System.String | sDisplayText | |
System.Byte[] | vbChallengeData |
ScraperResult(ScraperResultChallengeType, String, Byte[], String)
Creates a ChallengeResponseNeeded result.
Declaration
public ScraperResult(ScraperResultChallengeType nChallengeType, string sDisplayText, byte[] vbChallengeData, string sChallengeMimeType)
Parameters
Type | Name | Description |
---|---|---|
ScraperResultChallengeType | nChallengeType | |
System.String | sDisplayText | |
System.Byte[] | vbChallengeData | |
System.String | sChallengeMimeType |
ScraperResult(ScraperResultCode, String, String)
Declaration
public ScraperResult(ScraperResultCode nCode, string sDisplayText = null, string sDiagnosticTrace = null)
Parameters
Type | Name | Description |
---|---|---|
ScraperResultCode | nCode | Value for Code. |
System.String | sDisplayText | Value for DisplayText. |
System.String | sDiagnosticTrace | Value for DiagnosticTrace. |
ScraperResult(Exception)
Declaration
public ScraperResult(Exception x)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | x |
Fields
MIMETYPE_HHD13
Special value for ChallengeMimeType to indicate a ChipTAN challenge according to HHD 1.3.
Declaration
public const string MIMETYPE_HHD13 = "application/x-hhd13"
Field Value
Type | Description |
---|---|
System.String |
MIMETYPE_HHD14
Special value for ChallengeMimeType to indicate a ChipTAN challenge according to HHD 1.4.
Declaration
public const string MIMETYPE_HHD14 = "application/x-hhd14"
Field Value
Type | Description |
---|---|
System.String |
Properties
ChallengeAlternateLink
Declaration
public Uri ChallengeAlternateLink { get; }
Property Value
Type | Description |
---|---|
System.Uri |
ChallengeData
If the Code is ChallengeResponseNeeded, then this property provides the optional challenge data from the service.
Declaration
public byte[] ChallengeData { get; }
Property Value
Type | Description |
---|---|
System.Byte[] |
Remarks
The interpretation of this data blob depends on the actual
ChallengeType that is in effect. For some challenge/response methods
this might even be null
.
ChallengeMimeType
If the Code is ChallengeResponseNeeded, then this property indicates the MIME-type of the challenge data, if any, this might even be 'null'.
Declaration
public string ChallengeMimeType { get; }
Property Value
Type | Description |
---|---|
System.String |
ChallengeResponseLabel
The text input label that shall be used to collect the ChallengeResponse from the user.
Declaration
public string ChallengeResponseLabel { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
If this is not set by a particular implementation, then the default string "TAN"
is returned, so the returned string is never null
.
ChallengeType
If the Code is ChallengeResponseNeeded, then this property indicates the type of challenge/response mechanism that is used.
Declaration
public ScraperResultChallengeType ChallengeType { get; }
Property Value
Type | Description |
---|---|
ScraperResultChallengeType |
Code
Success or failure code.
Declaration
public ScraperResultCode Code { get; }
Property Value
Type | Description |
---|---|
ScraperResultCode |
DiagnosticTrace
Diagnostic trace output to be captured in a log file.
Declaration
public string DiagnosticTrace { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This should not be displayed to the user, but should be available for supporting problems.
DisplayText
Error text to display to the user. This should be brief and carefully worded.
Declaration
public string DisplayText { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Although this is optional and may be null
, it should always be set for
non-successful result. For a successful result it should be null
.
IsSuccess
Declaration
public bool IsSuccess { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
QueryChoices
Optional list of choices from which the user can pick.
Only set if Code is QueryResponseNeeded.
If this is null
, then the user should be able to enter arbitrary text.
Declaration
public ScraperResultQueryChoice[] QueryChoices { get; }
Property Value
Type | Description |
---|---|
ScraperResultQueryChoice[] |
QueryFieldName
The name of the credential field, that must be supplied from a query. Only set if Code is QueryResponseNeeded.
Declaration
public string QueryFieldName { get; }
Property Value
Type | Description |
---|---|
System.String |
QueryHeading
Short heading text for the query. Only set if Code is QueryResponseNeeded.
Declaration
public string QueryHeading { get; }
Property Value
Type | Description |
---|---|
System.String |
QueryLabel
Optional label for query text input field. This is not used, when QueryChoices are provided.
Declaration
public string QueryLabel { get; }
Property Value
Type | Description |
---|---|
System.String |
QueryPrompt
Long prompt text to be presented to the user for a query. Only set if Code is QueryResponseNeeded.
Declaration
public string QueryPrompt { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
SetQuery(String, String, String, String, ScraperResultQueryChoice[])
Declaration
public void SetQuery(string sQueryFieldName, string sQueryHeading, string sQueryPrompt, string sQueryLabel, ScraperResultQueryChoice[] vQueryChoices)
Parameters
Type | Name | Description |
---|---|---|
System.String | sQueryFieldName | |
System.String | sQueryHeading | |
System.String | sQueryPrompt | |
System.String | sQueryLabel | |
ScraperResultQueryChoice[] | vQueryChoices |