

Implementation Guide › Adapter Configuration Specifications › DataSourceInterface Section
DataSourceInterface Section
The DataSourceInterface section consists of attributes specifying the connection and the connection type between the Adapter and data source (Measurement Tool, CRM, System log, etc.) and is divided into two main types: File Interface and SQL Interface.
File Interface
The File Adapter can be used to retrieve data from log files, scheduled reports or any other text based file, and the DataSourceInterface defines rules of parsing the information from the file data source and extracting it into fields.
The DataSourceInterface section also defines the way the Adapter handles the source file (whether it deletes the original file in case it was created only for the Adapter, or whether it leaves the data alone if it is needed for other uses, and so on).
XML Structure:
<DataSourceInterface WorkFileName="MyWorkingFile.txt" >
<Files>
<File
IsActive="yes"
InputFormat="events"
Path="D:\adapters\sample_data\"
NamePattern="adapterXXX*.log"
DeleteFileAfterProcessing="no"
Delimiters=","
IgnoreRedundantDelimiters ="no"
TitleExists="no"
SleepTime="10">
</File>
</Files>
</DataSourceInterface>
- WorkFileName-(optional). When DeleteFileAfterProcessing is set to 'no' - the file is copied to this name, when it is set to 'yes' - the file is renamed to this name. If not specified default value will be taken ('WorkFile.txt').
- Files-collection of file elements (more then one File can be defined in one Adapter).
- File-specified the file attributes.
- IsActive-(optional) [yes/no]. Defines if this file is activate (when set to "no" this file will not be read).
- InputFormat-the InputFormat associated with this file. The adapter uses the InputFormat to extract the data from the data source.
- Path-the path to the location of the source data files.
- NamePattern-sepcifiy the data source file name. Can use wildcard if more than one file uses the same Input Format.
- DeleteFileAfterProcessing [yes|no] - The way the Adapter handles the source file. When the file was created only for the adapter and it can be deleted after processing set it to "yes". The file is renamed, processed, and than deleted.When it set to "no" the file is copied and the processing takes place in the copied file. If new records are appended to the end of this file, the Adapter copies these new records to the work file in the next cycle. If new records are not appended to the file, the Adapter searches for the first file with the same pattern and name greater (in lexicographic order) than the current file. If the Adapter finds such a file, it proceeds to work with this file. The Adapter does not revert to the previous file even if new records are appended to this file. Use "no" when you need to keep the integrity of the source file.
- InitialFileName -the first file name from it the adapter will search for file with the given pattern. Use this attribute when the NamePattern contains wildcards and you do not want that the adapter read old files.
- Delimiters-(optional). One or more characters serving as delimiters, according to which data rows will be parsed into fields, if not specified default value is "\t".
- IgnoreRedundantDelimiters-(optional) [yes/no]. When set to "yes" consecutive delimiters will be treated as one, else a blank field will be created between the delimiters.
- RegExForParser-(optional). A regular expression to use in order to extract fields from the data source replacing the Delimiters specified earlier. For example:
<File
….
RegExForParser="^(.{8}) (.{6}) (?:[ ])*([0-9]+) "
/>
See regular expression documentation for more details.
- TitleExists-(optional) [yes/no] Specify if the first non blank line in the data source file is a title line. The title can be used by the Adapter when parsing the data.
- SleepTime-Specify the retrieving data interval (in seconds) i.e. - number of seconds break between the Adapter data retrieval from the source data file.
- LogicLineDefinition-(Optional)
<File
….
<LogicLineDefinition
FirstLine="Job server:.*"
NumberOfLines="5"
/>
/>
In case the dataset is built from the number of lines and not by one line, the following attributes defines the extraction starting point , end point, and the number of lines compromising the data:
- AllFile-(optional) [yes/no] When set to "yes" all the file considered as one record, one logical line.
- FirstLine-(optional) A regular expression that define the first line of the logical line. It can be specified with/without LastLine and/or NumberOfLines.
- LastLine-(optional) A regular expression that define the last line of the logical line. It can be specified with/without FirstLine and/or NumberOfLines.
- NumberOfLines-(optional) Number of lines in a logical line. It can be specified with/without FirstLine and/or LastLine.
- MatchCase-(optional) [yes/no] Defines whether the regular expression matching is case sensitive.
Copyright © 2012 CA.
All rights reserved.
 
|
|