Class AbstractDirectoryPollingModule
java.lang.Object
com.helger.as2lib.AbstractDynamicComponent
com.helger.as2lib.processor.module.AbstractProcessorModule
com.helger.as2lib.processor.module.AbstractActiveModule
com.helger.as2lib.processor.receiver.AbstractActiveReceiverModule
com.helger.as2lib.processor.receiver.AbstractActivePollingModule
com.helger.as2lib.processor.receiver.AbstractDirectoryPollingModule
- All Implemented Interfaces:
IDynamicComponent
,IProcessorActiveModule
,IProcessorModule
,IProcessorReceiverModule
- Direct Known Subclasses:
AS2DirectoryPollingModule
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
Path of the error directory.static final String
static final String
static final String
Path of the directory to poll from.static final String
static final String
Path of the error directory.static final String
Optional filename for storage in the error directory.static final String
Optional filename for storage in the sent directory.Fields inherited from class com.helger.as2lib.processor.receiver.AbstractActivePollingModule
ATTR_POLLING_INTERVAL
Fields inherited from class com.helger.as2lib.AbstractDynamicComponent
m_aRWLock
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected abstract IMessage
void
initDynamicComponent
(IAS2Session aSession, com.helger.commons.collection.attr.IStringMap aOptions) After creating a Component object, this method should be called to set any parameters used by the component.void
poll()
The abstract message that is called in the defined interval and needs to be overridden by subclasses.protected void
processFile
(File aFile) protected void
scanDirectory
(String sDirectory) protected void
void
updateMessage
(IMessage aMsg, File aFile) protected void
Methods inherited from class com.helger.as2lib.processor.receiver.AbstractActivePollingModule
doStart, doStop, getInterval, isBusy, setInterval
Methods inherited from class com.helger.as2lib.processor.module.AbstractActiveModule
canHandle, equals, forceStop, handle, hashCode, isRunning, start, stop, toString
Methods inherited from class com.helger.as2lib.AbstractDynamicComponent
attrs, getAttributeAsIntRequired, getAttributeAsStringRequired, getName, getSession
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.helger.as2lib.IDynamicComponent
attrs, getName, getSession
Methods inherited from interface com.helger.as2lib.processor.module.IProcessorActiveModule
isRunning, start, stop
Methods inherited from interface com.helger.as2lib.processor.module.IProcessorModule
canHandle, handle
-
Field Details
-
ATTR_OUTBOX_DIRECTORY
Path of the directory to poll from.- See Also:
-
ATTR_ERROR_DIRECTORY
Path of the error directory. May contain "date" and "msg" parameters.- See Also:
-
ATTR_STORED_ERROR_FILENAME
Optional filename for storage in the error directory. May contain "date" and "msg" parameters.- Since:
- 4.8.0
- See Also:
-
ATTR_SENT_DIRECTORY
Path of the error directory. May contain "date" and "msg" parameters.- See Also:
-
ATTR_STORED_SENT_FILENAME
Optional filename for storage in the sent directory. May contain "date" and "msg" parameters.- Since:
- 4.8.0
- See Also:
-
ATTR_FORMAT
- See Also:
-
ATTR_DELIMITERS
- See Also:
-
ATTR_DEFAULTS
- See Also:
-
ATTR_MIMETYPE
- See Also:
-
ATTR_SENDFILENAME
- See Also:
-
-
Constructor Details
-
AbstractDirectoryPollingModule
public AbstractDirectoryPollingModule()
-
-
Method Details
-
initDynamicComponent
public void initDynamicComponent(@Nonnull IAS2Session aSession, @Nullable com.helger.commons.collection.attr.IStringMap aOptions) throws AS2Exception Description copied from interface:IDynamicComponent
After creating a Component object, this method should be called to set any parameters used by the component. Component implementations typically have required parameter checking and code to start timers and threads within this method.- Specified by:
initDynamicComponent
in interfaceIDynamicComponent
- Overrides:
initDynamicComponent
in classAbstractActivePollingModule
- Parameters:
aSession
- the component uses this object to access other componentsaOptions
- configuration values for the component. All parameters will be stored as attributes of this component. All attributes existing before this method is called will be removed!- Throws:
AS2Exception
- If an error occurs while initializing the componentAS2InvalidParameterException
- If a required parameter is null in the parameters Map- See Also:
-
checkFile
-
trackedFiles
@Nonnull @ReturnsMutableObject public final com.helger.commons.collection.impl.ICommonsMap<String,Long> trackedFiles()- Returns:
- A map from absolute file path to the size of the file. Never
null
.
-
trackFile
-
scanDirectory
- Throws:
AS2InvalidParameterException
-
createMessage
-
processFile
- Throws:
AS2Exception
-
updateTracking
- Throws:
AS2Exception
-
updateMessage
- Throws:
AS2Exception
-
poll
public void poll()Description copied from class:AbstractActivePollingModule
The abstract message that is called in the defined interval and needs to be overridden by subclasses.- Specified by:
poll
in classAbstractActivePollingModule
-