@Deprecated @ConfigurationWarning(value="Please replace with DirectoryListener, in combination with a FileLineIteratorPipe") public class FileRecordListener extends Object implements IPullingListener
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.Modifier and Type | Field and Description |
---|---|
protected org.apache.logging.log4j.Logger |
log
Deprecated.
|
Constructor and Description |
---|
FileRecordListener()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
afterMessageProcessed(PipeLineResult processResult,
Object rawMessage,
Map threadContext)
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 threadContext)
Deprecated.
Finalizes a message receiving thread.
|
void |
configure()
Deprecated.
Configure does some basic checks (directoryProcessedFiles is a directory, inputDirectory is a directory, wildcard is filled etc.);
|
Message |
extractMessage(Object rawMessage,
Map threadContext)
Deprecated.
Extracts string from message obtained from
IPullingListener.getRawMessage(Map) . |
String |
getDirectoryProcessedFiles()
Deprecated.
|
protected File |
getFileToProcess()
Deprecated.
Gets a file to process.
|
String |
getIdFromRawMessage(Object rawMessage,
Map threadContext)
Deprecated.
Returns the name of the file in process (the
archived file) concatenated with the
record number. |
String |
getInputDirectory()
Deprecated.
|
String |
getName()
Deprecated.
|
Object |
getRawMessage(Map threadContext)
Deprecated.
Retrieves a single record from a file.
|
long |
getResponseTime()
Deprecated.
|
ISender |
getSender()
Deprecated.
|
String |
getStoreFileNameInSessionKey()
Deprecated.
|
String |
getWildcard()
Deprecated.
|
void |
open()
Deprecated.
Prepares the listener for receiving messages.
|
Map |
openThread()
Deprecated.
Prepares a thread for receiving messages.
|
protected Iterator<String> |
parseToRecords(String input)
Deprecated.
Parse a String to an Iterator with objects (records).
|
void |
setDirectoryProcessedFiles(String directoryProcessedFiles)
Deprecated.
the directory to store processed files in
|
void |
setInputDirectory(String inputDirectory)
Deprecated.
the directory name to look in for files.
|
void |
setName(String name)
Deprecated.
The functional name of the object.
|
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
|
void |
setSender(ISender sender)
Deprecated.
|
void |
setStoreFileNameInSessionKey(String storeFileNameInSessionKey)
Deprecated.
when set, the name of the read file is stored under this session key
|
void |
setWildcard(String wildcard)
Deprecated.
the wildcard to look for files in the specified directory, e.g.
|
String |
toString()
Deprecated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getApplicationContext
getConfigurationClassLoader
public void afterMessageProcessed(PipeLineResult processResult, Object rawMessage, Map threadContext) throws ListenerException
IListener
afterMessageProcessed
in interface IListener
ListenerException
protected String archiveFile(File file) throws ListenerException
ListenerException
public void close() throws ListenerException
IListener
close
in interface IListener
ListenerException
public void closeThread(Map threadContext) throws ListenerException
IPullingListener
IListener.close()
is called.closeThread
in interface IPullingListener
ListenerException
public void configure() throws ConfigurationException
configure
in interface IConfigurable
configure
in interface IListener
ConfigurationException
protected File getFileToProcess()
public String getIdFromRawMessage(Object rawMessage, Map threadContext) throws ListenerException
archived
file) concatenated with the
record number. As te archivedFile
method always renames to a
unique file, the combination of this filename and the recordnumber is unique, enabling tracing in case of errors
in the processing of the file.
Override this method for your specific needs!getIdFromRawMessage
in interface IListener
ListenerException
public Object getRawMessage(Map threadContext) throws ListenerException
getRawMessage
in interface IPullingListener
ListenerException
public Message extractMessage(Object rawMessage, Map threadContext) throws ListenerException
IListener
IPullingListener.getRawMessage(Map)
. May also extract
other parameters from the message and put those in the threadContext.extractMessage
in interface IListener
ListenerException
public void open() throws ListenerException
IListener
open()
is called once each time the listener is started.open
in interface IListener
ListenerException
public Map openThread() throws ListenerException
IPullingListener
openThread
in interface IPullingListener
ListenerException
protected Iterator<String> parseToRecords(String input)
public void setSender(ISender sender)
public ISender getSender()
public void setName(String name)
INamedObject
setName
in interface INamedObject
public String getName()
getName
in interface IConfigurationAware
getName
in interface INamedObject
public void setInputDirectory(String inputDirectory)
public String getInputDirectory()
public void setWildcard(String wildcard)
public String getWildcard()
public void setDirectoryProcessedFiles(String directoryProcessedFiles)
public String getDirectoryProcessedFiles()
public void setResponseTime(long responseTime)
public long getResponseTime()
public void setStoreFileNameInSessionKey(String storeFileNameInSessionKey)
public String getStoreFileNameInSessionKey()
Copyright © 2023 Frank!Framework. All rights reserved.