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
Fields Modifier and Type Field Description static String
ATTR_CHARSET
static String
ATTR_FILENAME
static String
ATTR_PROTOCOL
static String
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 Modifier Constructor Description protected
AbstractStorageModule(String sModuleAction)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
canHandle(String sAction, IMessage aMsg, Map<String,Object> aOptions)
boolean
equals(Object o)
protected Charset
getCharset()
String
getCharsetName()
protected File
getFile(IMessage aMsg, String sFileParam)
Not final - see #105String
getFilename()
protected abstract String
getFilename(IMessage aMsg, String sFileParam)
String
getProtocol()
String
getTempDir()
int
hashCode()
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
setCharsetName(String sCharsetName)
void
setFilename(String sFilename)
void
setProtocol(String sProtocol)
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 Detail
-
ATTR_FILENAME
public static final String ATTR_FILENAME
- See Also:
- Constant Field Values
-
ATTR_PROTOCOL
public static final String ATTR_PROTOCOL
- See Also:
- Constant Field Values
-
ATTR_TEMPDIR
public static final String ATTR_TEMPDIR
- See Also:
- Constant Field Values
-
ATTR_CHARSET
public static final String ATTR_CHARSET
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCharset
@Nonnull protected Charset getCharset()
- Returns:
- The charset configured via
ATTR_CHARSET
parameter or the system default. Nevernull
.
-
canHandle
public final boolean canHandle(@Nonnull String sAction, @Nonnull IMessage aMsg, @Nullable Map<String,Object> aOptions)
- Specified by:
canHandle
in interfaceIProcessorModule
-
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:
IAS2Session
-
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
public boolean equals(Object o)
- Overrides:
equals
in classAbstractDynamicComponent
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractDynamicComponent
-
-