Package org.frankframework.receivers
Class FileRecordListener
java.lang.Object
org.frankframework.receivers.FileRecordListener
- All Implemented Interfaces:
IConfigurable
,IConfigurationAware
,IListener<String>
,INamedObject
,IPullingListener<String>
,IScopeProvider
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
@Deprecated
@ConfigurationWarning("Please replace with DirectoryListener, in combination with a FileLineIteratorPipe")
public class FileRecordListener
extends Object
implements IPullingListener<String>
Deprecated.
File
listener
that looks in a directory for files according to a wildcard. When a file is
found, it is read in a String object and parsed to records.
After reading the file, the file is renamed and moved to a directory.- Author:
- Johan Verrips
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterMessageProcessed
(PipeLineResult processResult, RawMessageWrapper<String> rawMessage, PipeLineSession pipeLineSession) Deprecated.Called to perform actions (like committing or sending a reply) after a message has been processed by the Pipeline.protected String
archiveFile
(File file) Deprecated.Moves a file to another directory and places a UUID in the name.void
close()
Deprecated.Close all resources used for listening.void
closeThread
(Map<String, Object> threadContext) Deprecated.Finalizes a message receiving thread.void
Deprecated.Configure does some basic checks (directoryProcessedFiles is a directory, inputDirectory is a directory, wildcard is filled etc.);extractMessage
(RawMessageWrapper<String> rawMessage, Map<String, Object> context) Deprecated.Extracts data from message obtained fromIPullingListener.getRawMessage(Map)
orIPushingListener.wrapRawMessage(Object, PipeLineSession)
.org.springframework.context.ApplicationContext
Deprecated.Deprecated.This ClassLoader is set upon creation of the object, used to retrieve resources configured by the Ibis application.Deprecated.protected File
Deprecated.Gets a file to process.Deprecated.getName()
Deprecated.getRawMessage
(Map<String, Object> threadContext) Deprecated.Retrieves a single record from a file.long
Deprecated.Deprecated.Deprecated.Deprecated.void
open()
Deprecated.Prepares the listener for receiving messages.Deprecated.Prepares a thread for receiving messages.parseToRecords
(String input) Deprecated.Parse a String to an Iterator with objects (records).void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) Deprecated.void
setDirectoryProcessedFiles
(String directoryProcessedFiles) Deprecated.the directory to store processed files invoid
setInputDirectory
(String inputDirectory) Deprecated.the directory name to look in for files.void
Deprecated.name of the listener as known to the adapter.void
setResponseTime
(long responseTime) Deprecated.The time in milliseconds to delay when no records are to be processed, and this class has to look for the arrival of a new filevoid
Deprecated.void
setStoreFileNameInSessionKey
(String storeFileNameInSessionKey) Deprecated.when set, the name of the read file is stored under this session keyvoid
setWildcard
(String wildcard) Deprecated.the wildcard to look for files in the specified directory, e.g.toString()
Deprecated.
-
Field Details
-
log
protected org.apache.logging.log4j.Logger logDeprecated.
-
-
Constructor Details
-
FileRecordListener
public FileRecordListener()Deprecated.
-
-
Method Details
-
afterMessageProcessed
public void afterMessageProcessed(PipeLineResult processResult, RawMessageWrapper<String> rawMessage, PipeLineSession pipeLineSession) throws ListenerException Deprecated.Description copied from interface:IListener
Called to perform actions (like committing or sending a reply) after a message has been processed by the Pipeline.- Specified by:
afterMessageProcessed
in interfaceIListener<String>
- Throws:
ListenerException
-
archiveFile
Deprecated.Moves a file to another directory and places a UUID in the name.- Returns:
- String with the name of the (renamed and moved) file
- Throws:
ListenerException
-
close
Deprecated.Description copied from interface:IListener
Close all resources used for listening. Called once each time the listener is stopped.- Specified by:
close
in interfaceIListener<String>
- Throws:
ListenerException
-
closeThread
Deprecated.Description copied from interface:IPullingListener
Finalizes a message receiving thread. Called once for each thread that listens for messages, just beforeIListener.close()
is called.- Specified by:
closeThread
in interfaceIPullingListener<String>
- Throws:
ListenerException
-
configure
Deprecated.Configure does some basic checks (directoryProcessedFiles is a directory, inputDirectory is a directory, wildcard is filled etc.);- Specified by:
configure
in interfaceIConfigurable
- Specified by:
configure
in interfaceIListener<String>
- Throws:
ConfigurationException
-
getFileToProcess
Deprecated.Gets a file to process. -
getRawMessage
public RawMessageWrapper<String> getRawMessage(@Nonnull Map<String, Object> threadContext) throws ListenerExceptionDeprecated.Retrieves a single record from a file. If the file is empty or fully processed, it looks wether there is a new file to process and returns the first record.- Specified by:
getRawMessage
in interfaceIPullingListener<String>
- Throws:
ListenerException
-
extractMessage
public Message extractMessage(@Nonnull RawMessageWrapper<String> rawMessage, @Nonnull Map<String, Object> context) Deprecated.Description copied from interface:IListener
Extracts data from message obtained fromIPullingListener.getRawMessage(Map)
orIPushingListener.wrapRawMessage(Object, PipeLineSession)
. May also extract other parameters from the message and put those into the context.- Specified by:
extractMessage
in interfaceIListener<String>
- Parameters:
rawMessage
- TheRawMessageWrapper
from which to extract theMessage
.context
- Context to populate. Either aPipeLineSession
or aMap
threadContext depending on caller.- Returns:
- input
Message
for adapter.
-
open
Deprecated.Description copied from interface:IListener
Prepares the listener for receiving messages.open()
is called once each time the listener is started.- Specified by:
open
in interfaceIListener<String>
- Throws:
ListenerException
-
openThread
Deprecated.Description copied from interface:IPullingListener
Prepares a thread for receiving messages. Called once for each thread that will listen for messages.- Specified by:
openThread
in interfaceIPullingListener<String>
- Returns:
- the threadContext for this thread. The threadContext is a Map in which
thread-specific data can be stored. May not be
null
, must be a mutable map type. - Throws:
ListenerException
-
parseToRecords
Deprecated.Parse a String to an Iterator with objects (records). This method currently uses the end-of-line character ("\n") as a seperator. This method is easy to extend to satisfy your project needs. -
setSender
Deprecated. -
getSender
Deprecated. -
toString
Deprecated. -
setName
Deprecated.name of the listener as known to the adapter.- Specified by:
setName
in interfaceINamedObject
-
getName
Deprecated.- Specified by:
getName
in interfaceIConfigurationAware
- Specified by:
getName
in interfaceINamedObject
-
setInputDirectory
Deprecated.the directory name to look in for files. -
getInputDirectory
Deprecated. -
setWildcard
Deprecated.the wildcard to look for files in the specified directory, e.g. \"*.inp\" -
getWildcard
Deprecated. -
setDirectoryProcessedFiles
Deprecated.the directory to store processed files in -
getDirectoryProcessedFiles
Deprecated. -
setResponseTime
public void setResponseTime(long responseTime) Deprecated.The time in milliseconds to delay when no records are to be processed, and this class has to look for the arrival of a new file- Default value
- 1000
-
getResponseTime
public long getResponseTime()Deprecated. -
setStoreFileNameInSessionKey
Deprecated.when set, the name of the read file is stored under this session key -
getStoreFileNameInSessionKey
Deprecated. -
getConfigurationClassLoader
Deprecated.Description copied from interface:IScopeProvider
This ClassLoader is set upon creation of the object, used to retrieve resources configured by the Ibis application.- Specified by:
getConfigurationClassLoader
in interfaceIScopeProvider
- Returns:
- returns the ClassLoader created by the
ClassLoaderManager
.
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()Deprecated.- Specified by:
getApplicationContext
in interfaceIConfigurationAware
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) Deprecated.- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-