Package org.openas2.processor.resender
Class DirectoryResenderModule
- java.lang.Object
-
- org.openas2.BaseComponent
-
- org.openas2.processor.BaseProcessorModule
-
- org.openas2.processor.BaseActiveModule
-
- org.openas2.processor.resender.BaseResenderModule
-
- org.openas2.processor.resender.DirectoryResenderModule
-
- All Implemented Interfaces:
Component,ActiveModule,ProcessorModule,ResenderModule
public class DirectoryResenderModule extends BaseResenderModule
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_RESEND_DELAYstatic java.lang.StringPARAM_ERROR_DIRECTORYstatic java.lang.StringPARAM_RESEND_DELAYstatic java.lang.StringPARAM_RESEND_DIRECTORY-
Fields inherited from class org.openas2.processor.resender.BaseResenderModule
TICK_INTERVAL
-
Fields inherited from interface org.openas2.processor.resender.ResenderModule
DO_RESEND, DO_RESENDMDN, OPTION_CAUSE, OPTION_INITIAL_SENDER, OPTION_RESEND_METHOD, OPTION_RETRIES
-
-
Constructor Summary
Constructors Constructor Description DirectoryResenderModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandle(java.lang.String action, Message msg, java.util.Map<java.lang.Object,java.lang.Object> options)protected java.lang.StringgetFilename()voidhandle(java.lang.String action, Message msg, java.util.Map<java.lang.Object,java.lang.Object> options)booleanhealthcheck(java.util.List<java.lang.String> failures)When invoked, the module must run a self check to verify it is functioning correctly.voidinit(Session session, java.util.Map<java.lang.String,java.lang.String> options)Component lifecycle hook.protected booleanisTimeToSend(java.io.File currentFile)protected voidprocessFile(java.io.File file)voidresend()protected java.util.List<java.io.File>scanDirectory()-
Methods inherited from class org.openas2.processor.resender.BaseResenderModule
doStart, doStop
-
Methods inherited from class org.openas2.processor.BaseActiveModule
forceStop, isRunning, start, stop, toString
-
Methods inherited from class org.openas2.BaseComponent
destroy, getName, getParameter, getParameter, getParameterInt, getParameters, getSession, setParameter, setParameter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openas2.Component
destroy, getName, getParameters, getSession
-
-
-
-
Field Detail
-
PARAM_RESEND_DIRECTORY
public static final java.lang.String PARAM_RESEND_DIRECTORY
- See Also:
- Constant Field Values
-
PARAM_ERROR_DIRECTORY
public static final java.lang.String PARAM_ERROR_DIRECTORY
- See Also:
- Constant Field Values
-
PARAM_RESEND_DELAY
public static final java.lang.String PARAM_RESEND_DELAY
- See Also:
- Constant Field Values
-
DEFAULT_RESEND_DELAY
public static final long DEFAULT_RESEND_DELAY
- See Also:
- Constant Field Values
-
-
Method Detail
-
canHandle
public boolean canHandle(java.lang.String action, Message msg, java.util.Map<java.lang.Object,java.lang.Object> options)- Specified by:
canHandlein interfaceProcessorModule- Overrides:
canHandlein classBaseActiveModule
-
handle
public void handle(java.lang.String action, Message msg, java.util.Map<java.lang.Object,java.lang.Object> options) throws OpenAS2Exception- Specified by:
handlein interfaceProcessorModule- Overrides:
handlein classBaseActiveModule- Throws:
OpenAS2Exception
-
init
public void init(Session session, java.util.Map<java.lang.String,java.lang.String> options) throws OpenAS2Exception
Description copied from interface:ComponentComponent lifecycle hook. 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:
initin interfaceComponent- Overrides:
initin classBaseComponent- Parameters:
session- the component uses this object to access other componentsoptions- configuration values for the component- Throws:
OpenAS2Exception- If an error occurs while initializing the component- See Also:
Session
-
resend
public void resend()
- Specified by:
resendin classBaseResenderModule
-
healthcheck
public boolean healthcheck(java.util.List<java.lang.String> failures)
Description copied from interface:ActiveModuleWhen invoked, the module must run a self check to verify it is functioning correctly. Any failures must be reported in the failures list passed in to the method by the callee- Specified by:
healthcheckin interfaceActiveModule- Specified by:
healthcheckin classBaseActiveModule- Parameters:
failures- - a list of failures if any occur- Returns:
- - true if module has no problems otherwise false ith failure messages in passed in List
-
getFilename
protected java.lang.String getFilename() throws InvalidParameterException- Throws:
InvalidParameterException
-
isTimeToSend
protected boolean isTimeToSend(java.io.File currentFile)
-
processFile
protected void processFile(java.io.File file) throws OpenAS2Exception- Throws:
OpenAS2Exception
-
scanDirectory
protected java.util.List<java.io.File> scanDirectory() throws OpenAS2Exception, java.io.IOException- Throws:
OpenAS2Exceptionjava.io.IOException
-
-