Class AbstractStorageModule
java.lang.Object
com.helger.as2lib.AbstractDynamicComponent
com.helger.as2lib.processor.module.AbstractProcessorModule
com.helger.as2lib.processor.storage.AbstractStorageModule
- All Implemented Interfaces:
IDynamicComponent
,IProcessorModule
,IProcessorStorageModule
- Direct Known Subclasses:
MDNFileModule
,MessageFileModule
public abstract class AbstractStorageModule
extends AbstractProcessorModule
implements IProcessorStorageModule
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
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
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Check if this processor module can handle a certain action on the provided messageboolean
protected Charset
final String
protected File
Not final - see #105final String
protected abstract String
getFilename
(IMessage aMsg, String sFileParam) final String
final String
int
hashCode()
final 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.final void
setCharsetName
(String sCharsetName) final void
setFilename
(String sFilename) final void
setProtocol
(String sProtocol) final void
setTempDir
(String sTempDir) protected void
store
(File aMsgFile, InputStream aIS) 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
Methods inherited from interface com.helger.as2lib.processor.module.IProcessorModule
handle
-
Field Details
-
ATTR_FILENAME
- See Also:
-
ATTR_PROTOCOL
- See Also:
-
ATTR_TEMPDIR
- See Also:
-
ATTR_CHARSET
- See Also:
-
-
Constructor Details
-
AbstractStorageModule
-
-
Method Details
-
getFilename
-
setFilename
-
getProtocol
-
setProtocol
-
getTempDir
-
setTempDir
-
getCharsetName
-
getCharset
- Returns:
- The charset configured via
ATTR_CHARSET
parameter or the system default. Nevernull
.
-
setCharsetName
-
canHandle
public final boolean canHandle(@Nonnull String sAction, @Nonnull IMessage aMsg, @Nullable Map<String, Object> aOptions) Description copied from interface:IProcessorModule
Check if this processor module can handle a certain action on the provided message- Specified by:
canHandle
in interfaceIProcessorModule
- 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
.- Returns:
true
of this module can handle the respective message,false
if not.
-
initDynamicComponent
public final 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 classAbstractDynamicComponent
- 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:
-
getFilename
protected abstract String getFilename(IMessage aMsg, String sFileParam) throws AS2InvalidParameterException - Throws:
AS2InvalidParameterException
-
getFile
@Nonnull @OverrideOnDemand protected File getFile(@Nonnull IMessage aMsg, @Nullable String sFileParam) throws IOException, AS2Exception Not final - see #105- Parameters:
aMsg
- The source messagesFileParam
- The parameter name including the filename- Returns:
- File The
File
to be used - Throws:
IOException
- In case of IO errorAS2Exception
- In case of error- Since:
- 2007-06-01
-
store
protected void store(@Nonnull File aMsgFile, @Nonnull @WillClose InputStream aIS) throws IOException - Throws:
IOException
-
equals
- Overrides:
equals
in classAbstractDynamicComponent
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractDynamicComponent
-