public abstract class BaseStorageModule extends BaseProcessorModule implements StorageModule
Modifier and Type | Field and Description |
---|---|
static String |
PARAM_FILENAME |
static String |
PARAM_PROTOCOL |
static String |
PARAM_TEMPDIR |
DO_STORE, DO_STOREMDN
Constructor and Description |
---|
BaseStorageModule() |
Modifier and Type | Method and Description |
---|---|
boolean |
canHandle(String action,
Message msg,
Map<Object,Object> options) |
protected File |
getFile(Message msg,
String fileParam)
Add one more method "getFile" to make no impact to all modules who call this method with
only two parameter "Message msg" & "String fileParam"
|
protected File |
getFile(Message msg,
String fileParam,
String action)
Extracts name of the file from the file parameter and returns a File object with the file name
|
protected abstract String |
getFilename(Message msg,
String fileParam,
String action) |
protected abstract String |
getModuleAction() |
void |
init(Session session,
Map<String,String> options)
Component lifecycle hook.
|
protected void |
store(File msgFile,
InputStream in) |
protected void |
writeStream(InputStream in,
File destination) |
destroy, getName, getParameter, getParameter, getParameterInt, getParameters, getSession, setParameter, setParameter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handle
destroy, getName, getParameters, getSession
public static final String PARAM_FILENAME
public static final String PARAM_PROTOCOL
public static final String PARAM_TEMPDIR
public boolean canHandle(String action, Message msg, Map<Object,Object> options)
canHandle
in interface ProcessorModule
public void init(Session session, Map<String,String> options) throws OpenAS2Exception
Component
init
in interface Component
init
in class BaseComponent
session
- the component uses this object to access other componentsoptions
- configuration values for the componentOpenAS2Exception
- If an error occurs while initializing the componentSession
protected abstract String getModuleAction()
protected File getFile(Message msg, String fileParam) throws IOException, OpenAS2Exception
msg
- the context objectfileParam
- Name of the fileIOException
- - IO system has a problemOpenAS2Exception
- - internally handled error condition occurredprotected File getFile(Message msg, String fileParam, String action) throws IOException, OpenAS2Exception
msg
- the context objectfileParam
- The parameter containing the format string for the file nameaction
- what to doIOException
- - IO system has a problemOpenAS2Exception
- - internally handled error condition occurredprotected abstract String getFilename(Message msg, String fileParam, String action) throws InvalidParameterException
InvalidParameterException
protected void store(File msgFile, InputStream in) throws IOException, OpenAS2Exception
IOException
OpenAS2Exception
protected void writeStream(InputStream in, File destination) throws IOException
IOException
Copyright © 2018. All rights reserved.