EnsLib.File.InboundAdapter
class EnsLib.File.InboundAdapter extends Ens.InboundAdapter, EnsLib.File.Common
Finds files in a FilePath directory and submits all that match a FileSpec wildcard to an associated BusinessService for processingProperty Inventory
- AppendTimestamp
- ArchivePath
- Charset
- ConfirmComplete
- DeleteFromServer
- FileAccessTimeout
- FilePath
- FileSpec
- SemaphoreSpec
- SubdirectoryLevels
- VMSLatestVersionOnly
- WorkPath
Method Inventory
Parameters
Properties
If this value is empty or 0, no timestamp will be appended. If it is 1, then the standard timestamped filename specification template '%f_%Q' will be used.
Any other value will be used directly as a timestamped filename specification template.
Note that the AppendTimestamp option must be used to avoid name collisions in the archive directory if the same filename will be retrieved repeatedly.
Native - the default character encoding of the installed locale of the InterSystems IRIS server
latin1 - the ISO Latin1 8-bit encoding
ISO-8859-1 - the ISO Latin1 8-bit encoding
UTF-8 - the Unicode 8-bit encoding
Unicode - the Unicode 16-bit encoding (Little-Endian)
UnicodeBig - the Unicode 16-bit encoding (Big-Endian)
@<ttable> - <ttable> means a raw InterSystems character translation table name. A prefix of '@' means to use the named table.
This option alone may not be sufficient when the source application is sluggish. If the OS reports the same size for the file for a duration of the FileAccessTimeout value then InterSystems IRIS will consider the file complete.
- 'Rename' means keep trying to read more data for a file until the OS allows us to rename it. If WorkPath or ArchivePath is different from FilePath, this option is implied because the file must be moved which is equivalent to renaming. This option may not be effective because it is common for an OS to allow InterSystems IRIS to rename a file even while another application has the file open and is still writing more data into it.
- 'Readable' means if we consider the file complete if we are simply able to open it in Read mode. Depending on the OS and the details of the process that puts the file in the FilePath directory where we find it, this may be enough although in many cases it isn't.
- 'Writable' means if we consider the file complete if we are able to open it in Write mode (as a test - we generally don't intend to write to it.). This may be enough depending on the OS and the details of the process that puts the file in the FilePath directory where we find it.
If not deleted, the adapter will ignore files already processed until something else deletes them.
Note 1: If this setting is false an attempt will be made to delete file when the IRIS message is purged.
Note 2: If a WorkPath is specified this setting is ignored and the file is moved to the work path.
Allows you to indicate that the data file or files are complete and ready to be read by creating an associated second file in the same directory that is used as a semaphore. The inbound file adapter waits until the semaphore file exists before checking the other conditions specified by the Confirm Complete requirements and then processing the data file or files. The adapter tests only for the existence of the semaphore file and does not read the semaphore file contents.
If the Semaphore Specification is an empty string, the adapter does not wait for a semaphore file and processes the data files as soon as the conditions specified by the Confirm Complete requirements are met.
If you are using the Semaphore Specification feature, consider setting the Confirm Complete field to None.
SYNTAX: Semaphore Specification can be an empty string or can be a series of pairs, each of which associates a data filename pattern with a semaphore filename pattern. The pairs are separated by semicolons:
DataFileSpec=SemaphoreFileSpec;DataFileSpec=SemaphoreFileSpec;...
DataFileSpec either a plain filename or is a filename pattern that includes the * wildcard (which matches any character). Similarly, SemaphoreFileSpec either a plain filename or is a filename pattern that includes the * wildcard (but in this case, the * wildcard matches any character except a period). Notes:
- The semaphore file associated with a given data file (or multiple data files) must be in the same directory as those files.
- DataFileSpec and SemaphoreFileSpec do not include the directory name.
- DataFileSpec is always case-sensitive.
- SemaphoreFileSpec is case-sensitive if the operating system is case-sensitive and is not case-sensitive otherwise.
- The pairs are processed left-to-right, and the first matching pair is used; see below. Consequently, if you are including multiple specifications that can match the same file, you should specify the more specific specification before the more general ones.
- If an adapter configured with a FileSpec equal to *, the adapter usually considers all files in the directory as data files. But if Semaphore Specification is also specified, the adapter can recognize a file as a semaphore file and not treat it as a data file.
FILENAMES THAT DO NOT MATCH A PATTERN: If a Semaphore Specification is specified and a given data file does not match any of the patterns, then the adapter will not process this data file. If this is undesirable, specify a final pair that will match any file and that uses its own semaphore file. For example, consider this Semaphore Specification:
*.DAT=*.SEM; *.DOC=*.READY; *=SEM.LAST
The SEM.LAST is the semaphore file for all files that do not end with .DAT or .DOC.
HOW THE ADAPTER USES SEMAPHORE SPECIFICATION: Within each polling cycle, the inbound file adapter examines all the files found within the configured directory (and any subdirectories). Then for each file:
- The adapter reads the Semaphore Specification from left-to-right, finding the first specification whose DataFileSpec matches the given filename. This indicates the name of the semaphore file to look for.
- The adapter looks for the semaphore file in the same directory as the file being examined. Then: If it does not find the semaphore file, the adapter skips the file and sets an internal flag that causes the adapter to wait until the next polling cycle. If it does find the semaphore file, the adapter processes the file.
After the adapter has processed through all the data files in a polling cycle, it deletes all the corresponding semaphore files.
This setting is useful when the same filename is used for repeated file submissions.
Note: This setting takes precedence over DeleteFromServer and the file is moved from the source directory to this directory if DeleteFromServer is false.
Methods
Inherited Members
Inherited Properties
- %CredentialsObj
- %WarnedLatest
- %logTransfers
- BusinessHost
- CallInterval
- Credentials
- KeepaliveInterval
- RegistryID
Inherited Methods
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %ValidateObject()
- AssignOneSetting()
- ClearAllAppData()
- ClearRuntimeAppData()
- ClearStaticAppData()
- CorrespondingSemaphoreExists()
- CreateTimestamp()
- CredentialsSet()
- DeepListClose()
- DeepListExecute()
- DeepListFetch()
- EnumerateSettingsClose()
- EnumerateSettingsExecute()
- EnumerateSettingsFetch()
- FileLikePattern()
- FileListClose()
- FileListExecute()
- FileListFetch()
- GenerateSemaphoreFilename()
- GetSettings()
- LinkFileStream()
- NormalizeDirectory()
- OnKeepalive()
- OnTearDown()
- SemaphoreFileExists()
- fixPath()