Class MessageFileModule
- java.lang.Object
-
- com.helger.as2lib.AbstractDynamicComponent
-
- com.helger.as2lib.processor.module.AbstractProcessorModule
-
- com.helger.as2lib.processor.storage.AbstractStorageModule
-
- com.helger.as2lib.processor.storage.MessageFileModule
-
- All Implemented Interfaces:
IDynamicComponent
,IProcessorModule
,IProcessorStorageModule
public class MessageFileModule extends AbstractStorageModule
Store message content and optionally message headers and attributes to a file- Author:
- Philip Helger
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_HEADER
-
Fields inherited from class com.helger.as2lib.processor.storage.AbstractStorageModule
ATTR_CHARSET, ATTR_FILENAME, ATTR_PROTOCOL, ATTR_TEMPDIR
-
Fields inherited from class com.helger.as2lib.AbstractDynamicComponent
m_aRWLock
-
Fields inherited from interface com.helger.as2lib.processor.storage.IProcessorStorageModule
DO_STORE, DO_STOREMDN, DO_VALIDATE_AFTER_STORE, DO_VALIDATE_BEFORE_STORE
-
-
Constructor Summary
Constructors Constructor Description MessageFileModule()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getFilename(IMessage aMsg, String sFileParam)
String
getHeaderFilename()
protected static InputStream
getHeaderStream(IMessage aMsg, Charset aCharset)
void
handle(String sAction, IMessage aMsg, Map<String,Object> aOptions)
Main handling of the message.void
setHeaderFilename(String sHeaderFilename)
-
Methods inherited from class com.helger.as2lib.processor.storage.AbstractStorageModule
canHandle, equals, getCharset, getCharsetName, getFile, getFilename, getProtocol, getTempDir, hashCode, initDynamicComponent, setCharsetName, setFilename, setProtocol, setTempDir, store
-
Methods inherited from class com.helger.as2lib.AbstractDynamicComponent
attrs, getAttributeAsIntRequired, getAttributeAsStringRequired, getName, getSession, toString
-
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
-
-
-
-
Field Detail
-
ATTR_HEADER
public static final String ATTR_HEADER
- See Also:
- Constant Field Values
-
-
Method Detail
-
handle
public void handle(@Nonnull String sAction, @Nonnull IMessage aMsg, @Nullable Map<String,Object> aOptions) throws AS2Exception
Description copied from interface:IProcessorModule
Main handling of the message. Only called, ifIProcessorModule.canHandle(String, IMessage, Map)
returnedtrue
.- Parameters:
sAction
- The action to be executed. Nevernull
.aMsg
- The message in question. May be an AS2 message or an MDN message. Nevernull
.aOptions
- The options to be considered. May benull
.- Throws:
AS2Exception
- in case something goes wrong
-
getFilename
@Nonnull protected String getFilename(@Nonnull IMessage aMsg, @Nullable String sFileParam) throws AS2InvalidParameterException
- Specified by:
getFilename
in classAbstractStorageModule
- Throws:
AS2InvalidParameterException
-
-