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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final StringPath of the error directory.static final Stringstatic final Stringstatic final StringPath of the directory to poll from.static final Stringstatic final StringPath of the error directory.static final StringOptional filename for storage in the error directory.static final StringOptional filename for storage in the sent directory.Fields inherited from class com.helger.as2lib.processor.receiver.AbstractActivePollingModule
ATTR_POLLING_INTERVALFields inherited from class com.helger.as2lib.AbstractDynamicComponent
m_aRWLock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected abstract IMessagevoidinitDynamicComponent(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.voidpoll()The abstract message that is called in the defined interval and needs to be overridden by subclasses.protected voidprocessFile(File aFile) protected voidscanDirectory(String sDirectory) protected voidvoidupdateMessage(IMessage aMsg, File aFile) protected voidMethods inherited from class com.helger.as2lib.processor.receiver.AbstractActivePollingModule
doStart, doStop, getInterval, isBusy, setIntervalMethods inherited from class com.helger.as2lib.processor.module.AbstractActiveModule
canHandle, equals, forceStop, handle, hashCode, isRunning, start, stop, toStringMethods inherited from class com.helger.as2lib.AbstractDynamicComponent
attrs, getAttributeAsIntRequired, getAttributeAsStringRequired, getName, getSessionMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.as2lib.IDynamicComponent
attrs, getName, getSessionMethods inherited from interface com.helger.as2lib.processor.module.IProcessorActiveModule
isRunning, start, stopMethods 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:IDynamicComponentAfter 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:
initDynamicComponentin interfaceIDynamicComponent- Overrides:
initDynamicComponentin 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:AbstractActivePollingModuleThe abstract message that is called in the defined interval and needs to be overridden by subclasses.- Specified by:
pollin classAbstractActivePollingModule
-