Class EbicsFileSpooler
The EbicsFileSpooler organizes semi-automatic uploads and downloads of EBICS files in EbicsFileSpoolerFolder.
Inheritance
Inherited Members
Namespace: Subsembly.EBICS
Assembly: Subsembly.EBICS.Core.dll
Syntax
public class EbicsFileSpooler
Constructors
EbicsFileSpooler(EbicsFileSpoolerFolder, IEbicsContactFolder, IEbicsTransport)
Declaration
public EbicsFileSpooler(EbicsFileSpoolerFolder aSpoolerFolder, IEbicsContactFolder aContactFolder = null, IEbicsTransport aTransport = null)
Parameters
Type | Name | Description |
---|---|---|
EbicsFileSpoolerFolder | aSpoolerFolder | The EbicsFileSpoolerFolder that shall be used by this instance to
store all files. Must not be |
IEbicsContactFolder | aContactFolder | The contact folder where the EBICS contacts are stored. This is only needed by
Execute() and may be |
IEbicsTransport | aTransport | Optional IEbicsTransport that shall be used. If |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter |
EbicsFileSpooler(String, EbicsFileSpoolerCredentials, IEbicsContactFolder, IEbicsTransport)
Declaration
public EbicsFileSpooler(string sSpoolerFolder, EbicsFileSpoolerCredentials aUserCredentials = null, IEbicsContactFolder aContactFolder = null, IEbicsTransport aTransport = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | sSpoolerFolder | Complete, rooted file path of the root spooler folder. This must not be
|
EbicsFileSpoolerCredentials | aUserCredentials | In a protected and encrypted environment the credentials of the user, that wants
access to the EbicsFileSpooler and its files, must be provided through
this parameter. If given, then its properties
UserName and
Password must not be |
IEbicsContactFolder | aContactFolder | The contact folder where the EBICS contacts are stored. This is only needed by
Execute() and may be |
IEbicsTransport | aTransport | Optional IEbicsTransport that shall be used. If |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter |
System.ArgumentException | The configured spooler folder does not exist. |
See Also
Fields
MAXHISTORYDAYS
By default the EBICS file spooler initially downloads data starting today minus MAXHISTORYDAYS.
Declaration
public const int MAXHISTORYDAYS = 30
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
SpoolerFolder
Declaration
public EbicsFileSpoolerFolder SpoolerFolder { get; }
Property Value
Type | Description |
---|---|
EbicsFileSpoolerFolder |
Methods
DownloadCamt052(EbicsContact, IEbicsSecurityMedium, String)
Download new CAMT 052 files for a given EbicsContact into the BOX_CAMT052 folder.
Declaration
public EbicsFileTransferResult DownloadCamt052(EbicsContact aContact, IEbicsSecurityMedium aSecurityMedium, string sOrderType = null)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact | |
IEbicsSecurityMedium | aSecurityMedium | A Authenticated security medium that will
be used for authenticating and decrypting the requests. This must not be
|
System.String | sOrderType | The order type that shall be used for downloading the CAMT 052 data.
If this is |
Returns
Type | Description |
---|---|
EbicsFileTransferResult | Returns the EbicsFileTransferResult from the download attempt. |
Exceptions
Type | Condition |
---|---|
EbicsFileSpoolerException | The folder is currently locked by another process. |
DownloadCamt053(EbicsContact, IEbicsSecurityMedium, String, DateTime)
Download new CAMT 053 files for a given EbicsContact into the BOX_CAMT053 folder.
Declaration
public EbicsFileTransferResult DownloadCamt053(EbicsContact aContact, IEbicsSecurityMedium aSecurityMedium, string sOrderType = null, DateTime tFirstDate = default(DateTime))
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact | |
IEbicsSecurityMedium | aSecurityMedium | A Authenticated security medium that will
be used for authenticating and decrypting the requests. This must not be
|
System.String | sOrderType | The order type that shall be used for downloading the CAMT 053 data.
If this is |
System.DateTime | tFirstDate | If this is the very first call to DownloadCamt053(EbicsContact, IEbicsSecurityMedium, String, DateTime) and the BOX_CAMT053 folder is empty, then this can be used to provide a desired starting date for the very first download. If this is DateTime.MinValue, then today minus MAXHISTORYDAYS is used as the very first download date. If there is already data in the BOX_CAMT053 folder, then this parameter is ignored and downloading just continues immediately following the most recent file. |
Returns
Type | Description |
---|---|
EbicsFileTransferResult | Returns the EbicsFileTransferResult from the download attempt. |
Exceptions
Type | Condition |
---|---|
EbicsFileSpoolerException | The folder is currently locked by another process. |
DownloadCamt054(EbicsContact, IEbicsSecurityMedium, String, DateTime)
Download new CAMT 054 files for a given EbicsContact into the BOX_CAMT054 folder.
Declaration
public EbicsFileTransferResult DownloadCamt054(EbicsContact aContact, IEbicsSecurityMedium aSecurityMedium, string sOrderType = null, DateTime tFirstDate = default(DateTime))
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact | |
IEbicsSecurityMedium | aSecurityMedium | A Authenticated security medium that will
be used for authenticating and decrypting the requests. This must not be
|
System.String | sOrderType | The order type that shall be used for downloading the CAMT 054 data.
If this is |
System.DateTime | tFirstDate | If this is the very first call to DownloadCamt054(EbicsContact, IEbicsSecurityMedium, String, DateTime) and the BOX_CAMT054 folder is empty, then this can be used to provide a desired starting date for the very first download. If this is DateTime.MinValue, then today minus MAXHISTORYDAYS is used as the very first download date. If there is already data in the BOX_CAMT054 folder, then this parameter is ignored and downloading just continues immediately following the most recent file. |
Returns
Type | Description |
---|---|
EbicsFileTransferResult | Returns the EbicsFileTransferResult from the download attempt. |
Exceptions
Type | Condition |
---|---|
EbicsFileSpoolerException | The folder is currently locked by another process. |
DownloadDocs(EbicsContact, IEbicsSecurityMedium, String, DateTime)
Download PDF document files for a given EbicsContact into the BOX_DOCS folder.
Declaration
public EbicsFileTransferResult DownloadDocs(EbicsContact aContact, IEbicsSecurityMedium aSecurityMedium, string sOrderType, DateTime tFirstDate = default(DateTime))
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact | |
IEbicsSecurityMedium | aSecurityMedium | A Authenticated security medium that will
be used for authenticating and decrypting the requests. This must not be
|
System.String | sOrderType | The order type that shall be used for downloading the PDF documents. This is
usually either "BKA" or "BKI". This must not be |
System.DateTime | tFirstDate | If this is the very first call to DownloadDocs(EbicsContact, IEbicsSecurityMedium, String, DateTime) for the given
|
Returns
Type | Description |
---|---|
EbicsFileTransferResult | Returns the EbicsFileTransferResult from the download attempt. |
Exceptions
Type | Condition |
---|---|
EbicsFileSpoolerException | The folder is currently locked by another process. |
DownloadProtocol(EbicsContact, IEbicsSecurityMedium, String, DateTime)
Declaration
public EbicsFileTransferResult DownloadProtocol(EbicsContact aContact, IEbicsSecurityMedium aSecurityMedium, string sOrderType = null, DateTime tFirstDate = default(DateTime))
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact | |
IEbicsSecurityMedium | aSecurityMedium | |
System.String | sOrderType | |
System.DateTime | tFirstDate |
Returns
Type | Description |
---|---|
EbicsFileTransferResult |
Exceptions
Type | Condition |
---|---|
EbicsFileSpoolerException | The folder is currently locked by another process. |
Execute()
Processes all EbicsContacts of the
Declaration
public EbicsFileSpoolerResult[] Execute()
Returns
Type | Description |
---|---|
EbicsFileSpoolerResult[] | For every EbicsContact that has some SpoolerActions activated, the EbicsFileSpoolerResult from executing these actions is returned. If no contacts have any SpoolerActions activated, then an empty array will be returned. |
Remarks
This method always processes all contacts with any SpoolerActions. When an error occurs while processing a contact, it continues with the next contact that has any activated SpoolerActions.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | No contact folder was provided to the constructor. |
ExecuteActions(EbicsContact, IEbicsSecurityMedium, EbicsFileSpoolerActions)
Execute the requested EbicsFileSpoolerActions for an EbicsContact.
Declaration
public EbicsFileSpoolerResult ExecuteActions(EbicsContact aContact, IEbicsSecurityMedium aSecurityMedium, EbicsFileSpoolerActions nActions)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact | |
IEbicsSecurityMedium | aSecurityMedium | A Authenticated security medium that will
be used for the requests. This must not be |
EbicsFileSpoolerActions | nActions | The EbicsFileSpoolerActions that shall be executed. If this is None, then the actions configured in SpoolerActions will be executed. |
Returns
Type | Description |
---|---|
EbicsFileSpoolerResult |
Remarks
Explicitly requested actions are executed regardless of the setting of the SpoolerActions property.
The requested actions are executed in the following order:
If any action produces an EBICS error, processing of further actions is aborted.Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter |
System.InvalidOperationException | The parameter |
ExecuteActions(EbicsContact, String, EbicsFileSpoolerActions)
Declaration
public EbicsFileSpoolerResult ExecuteActions(EbicsContact aContact, string sPassword = null, EbicsFileSpoolerActions nActions = EbicsFileSpoolerActions.None)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact | |
System.String | sPassword | Optional password for authentication. If this is |
EbicsFileSpoolerActions | nActions | The EbicsFileSpoolerActions that shall be executed. If this is None, then the actions configured in SpoolerActions will be executed. |
Returns
Type | Description |
---|---|
EbicsFileSpoolerResult |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter |
GetBoxFolder(EbicsContact, String, Boolean)
Gets the BOX folder with the given name.
Declaration
public EbicsFileFolder GetBoxFolder(EbicsContact aContact, string sBoxName, bool fCreate)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact | |
System.String | sBoxName | |
System.Boolean | fCreate |
Returns
Type | Description |
---|---|
EbicsFileFolder |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Either the parameter |
System.ArgumentException | The parameter |
GetCamt052Folder(EbicsContact)
Gets the BOX_CAMT052 folder.
Declaration
public EbicsFileFolder GetCamt052Folder(EbicsContact aContact)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact |
Returns
Type | Description |
---|---|
EbicsFileFolder |
Remarks
If the requested folder does not exist, yet, then it will be created.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter |
GetCamt053Folder(EbicsContact)
Gets the BOX_CAMT053 folder.
Declaration
public EbicsFileFolder GetCamt053Folder(EbicsContact aContact)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact |
Returns
Type | Description |
---|---|
EbicsFileFolder |
Remarks
If the requested folder does not exist, yet, then it will be created.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter |
GetCamt054Folder(EbicsContact)
Gets the BOX_CAMT054 folder.
Declaration
public EbicsFileFolder GetCamt054Folder(EbicsContact aContact)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact |
Returns
Type | Description |
---|---|
EbicsFileFolder |
Remarks
If the requested folder does not exist, yet, then it will be created.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter |
GetDocsFolder(EbicsContact)
Gets the BOX_DOCS folder.
Declaration
public EbicsFileFolder GetDocsFolder(EbicsContact aContact)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact |
Returns
Type | Description |
---|---|
EbicsFileFolder |
Remarks
If the requested folder does not exist, yet, then it will be created.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter |
GetOutboxFolder(EbicsContact)
Gets the BOX_OUTBOX folder.
Declaration
public EbicsFileFolder GetOutboxFolder(EbicsContact aContact)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact |
Returns
Type | Description |
---|---|
EbicsFileFolder |
Remarks
If the requested folder does not exist, yet, then it will be created.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter |
GetPassword(EbicsContact)
Declaration
public static string GetPassword(EbicsContact aContact)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact |
Returns
Type | Description |
---|---|
System.String |
GetPasswordPlaceholder(EbicsContact)
If the security media password is stored in the contact, then a suitable placeholder text is returned.
Declaration
public static string GetPasswordPlaceholder(EbicsContact aContact)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact | The contact that was used to store the encrypted password. The encrypted password
is stored in the SpoolerSecret property of the
EbicsContact. This must not be |
Returns
Type | Description |
---|---|
System.String | If nothing was stored, then |
Remarks
It is by no means possible to retrieve the password actually stored.
GetSpoolerFolder(EbicsFileSpoolerCredentials)
Obtains a EbicsFileSpoolerFolder instance for the configured spooler folder.
Declaration
public static EbicsFileSpoolerFolder GetSpoolerFolder(EbicsFileSpoolerCredentials aCredentials)
Parameters
Type | Name | Description |
---|---|---|
EbicsFileSpoolerCredentials | aCredentials | As an option the user credentials can be supplied. If this is |
Returns
Type | Description |
---|---|
EbicsFileSpoolerFolder | If there is no SpoolerFolderPath configured, then
|
StorePassword(EbicsContact, String)
Stores the security media password for automated use by the EbicsFileSpooler.
Declaration
public static void StorePassword(EbicsContact aContact, string sPassword)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact | The contact that is used to store the encrypted password. The encrypted password is
stored in the SpoolerSecret property of the
EbicsContact. This must not be |
System.String | sPassword | The security media password to be stored. If this is |
See Also
SubmitFileUpload(EbicsContact, String, String, String)
Copies a file into the BOX_OUTBOX folder for uploading by the spooler.
Declaration
public EbicsFileName SubmitFileUpload(EbicsContact aContact, string sSourceFilePath, string sOrderType, string sFileId = null)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact | |
System.String | sSourceFilePath | Full path to file that shall be uploaded to the server. This file must
exist outside of the spooler folder. It will be copied into the
BOX_OUTBOX with a new file name, generated from the
|
System.String | sOrderType | The EBICS OrderType that shall be used to upload the file. |
System.String | sFileId | Optional file ID that will be used to generate a unique file name. If this is
|
Returns
Type | Description |
---|---|
EbicsFileName | Returns the EbicsFileName of the order file that was created in the BOX_OUTBOX folder. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | One of the required parameters was |
SubmitSepaUpload(EbicsContact, SepaDocument)
Writes the given SEPA payment initiation document into the BOX_OUTBOX folder for uploading by the spooler.
Declaration
public EbicsFileName SubmitSepaUpload(EbicsContact aContact, SepaDocument aSepaDocument)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact | |
SepaDocument | aSepaDocument |
Returns
Type | Description |
---|---|
EbicsFileName | Returns the EbicsFileName of the order file that was created in the BOX_OUTBOX folder. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | One of the parameters was |
TryAuthenticateContact(EbicsContact, String, out IEbicsSecurityMedium, out String)
Attempt to create and authenticate the security medium for a contact.
Declaration
public EbicsFileSpoolerResultCode TryAuthenticateContact(EbicsContact aContact, string sPassword, out IEbicsSecurityMedium aSecurityMedium, out string sLastErrorText)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact | The contact to be authenticated. This must not be |
System.String | sPassword | Optional password for authentication. If this is |
IEbicsSecurityMedium | aSecurityMedium | If successful, then the authenticated IEbicsSecurityMedium is
returned through this parameter. This is |
System.String | sLastErrorText |
Returns
Type | Description |
---|---|
EbicsFileSpoolerResultCode |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter |
UploadOutbox(EbicsContact, IEbicsSecurityMedium)
Upload the entire pending content of the BOX_OUTBOX.
Declaration
public EbicsFileTransferResult[] UploadOutbox(EbicsContact aContact, IEbicsSecurityMedium aSecurityMedium)
Parameters
Type | Name | Description |
---|---|---|
EbicsContact | aContact | |
IEbicsSecurityMedium | aSecurityMedium | A Authenticated security medium that will
be used for signing and decrypting the requests. This must not be |
Returns
Type | Description |
---|---|
EbicsFileTransferResult[] | Returns a EbicsFileTransferResult array that contains the result of every outbox file upload that was attempted. |
Exceptions
Type | Condition |
---|---|
EbicsFileSpoolerException | The folder is currently locked by another process. |