IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.cs.ajax.fileupload
Class AbstractFileHandler

java.lang.Object
  extended by com.ibm.btt.cs.ajax.fileupload.AbstractFileHandler
All Implemented Interfaces:
IFileHandler

public abstract class AbstractFileHandler
extends java.lang.Object
implements IFileHandler

This class is a abstract class used to handler file upload process


Field Summary
static int DELETE_FAILED
           
static int DELETE_SUCCESS
           
static java.lang.String FILE
          the file kcoll id, used in file data definition
static java.lang.String FILE_HANDLER
          file handler name in the data definition
static java.lang.String FILE_ID
          the file id name, used in file data definition
static java.lang.String FILE_NAME
          the file kcoll id, used in file data definition
static java.lang.String FILE_RECEIVED
          received files icoll name, defined in data definition.
static int FILE_SIZE_EXCEED
           
static int REQ_INVALID
          file upload request is valid
static java.lang.String REQ_PARAM_DATANAME
           
static java.lang.String REQ_PARAM_PROCID
          file upload request paramters
static java.lang.String REQ_PARAM_SID
           
static int REQ_TIMEOUT
           
static int REQ_VALID
          file upload request is valid
static int SAVE_FAILED
           
static int SAVE_SUCCESS
           
static int UPDATE_CTX_FAILED
           
static int UPDATE_CTX_SUCCESS
           
 
Constructor Summary
AbstractFileHandler()
           
 
Method Summary
abstract  AbstractFileHandler clone()
          this method is used to clone a new file handler.
protected abstract  int doRequestValidation(javax.servlet.http.HttpServletRequest request)
          validate whether the fileupload request is valid. e.g session expired, context error, or file system storage error etc.
 KeyedCollection getConfig()
           
 java.lang.String getDataname()
           
protected  Context getProcessorContext(java.lang.String sessionId, java.lang.String processId)
          get processor context
 java.lang.String getProcessorId()
           
protected  Context getSessionContext(java.lang.String sessionId)
          get Session context
 java.lang.String getSessionId()
           
 long getTimeout()
          get the time out value of the file upload handler the time is milli-seconds.
 long getTimestamp()
          time stamp of the file handler
 boolean isExpired()
          Check whether the request is expired or the session is expired.
 int requestValidate(javax.servlet.http.HttpServletRequest request)
          it is suggested to extend the doRequestValidation() method for customer validation.
 void setConfig(KeyedCollection config)
           
 void setDataname(java.lang.String dataname)
           
 void setExpired(boolean isExpired)
           
 void setProcessorId(java.lang.String processorId)
           
 void setSessionId(java.lang.String sessionId)
           
 void setTimeout(long value)
           
protected  void updateTimeout(javax.servlet.http.HttpServletRequest request)
          Update the timeout flag for process
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.btt.cs.ajax.fileupload.IFileHandler
cleanContext, deleteFile, getFileId, getFileInfo, getFileName, initConfig, onRequestExpired, retrieveFile, saveFile, upldateContext
 

Field Detail

REQ_VALID

public static final int REQ_VALID
file upload request is valid

See Also:
Constant Field Values

REQ_INVALID

public static final int REQ_INVALID
file upload request is valid

See Also:
Constant Field Values

SAVE_SUCCESS

public static final int SAVE_SUCCESS
See Also:
Constant Field Values

SAVE_FAILED

public static final int SAVE_FAILED
See Also:
Constant Field Values

DELETE_SUCCESS

public static final int DELETE_SUCCESS
See Also:
Constant Field Values

DELETE_FAILED

public static final int DELETE_FAILED
See Also:
Constant Field Values

UPDATE_CTX_SUCCESS

public static final int UPDATE_CTX_SUCCESS
See Also:
Constant Field Values

UPDATE_CTX_FAILED

public static final int UPDATE_CTX_FAILED
See Also:
Constant Field Values

FILE_SIZE_EXCEED

public static final int FILE_SIZE_EXCEED
See Also:
Constant Field Values

REQ_TIMEOUT

public static final int REQ_TIMEOUT
See Also:
Constant Field Values

REQ_PARAM_PROCID

public static final java.lang.String REQ_PARAM_PROCID
file upload request paramters

See Also:
Constant Field Values

REQ_PARAM_SID

public static final java.lang.String REQ_PARAM_SID
See Also:
Constant Field Values

REQ_PARAM_DATANAME

public static final java.lang.String REQ_PARAM_DATANAME
See Also:
Constant Field Values

FILE

public static final java.lang.String FILE
the file kcoll id, used in file data definition

See Also:
Constant Field Values

FILE_NAME

public static final java.lang.String FILE_NAME
the file kcoll id, used in file data definition

See Also:
Constant Field Values

FILE_ID

public static final java.lang.String FILE_ID
the file id name, used in file data definition

See Also:
Constant Field Values

FILE_HANDLER

public static final java.lang.String FILE_HANDLER
file handler name in the data definition

See Also:
Constant Field Values

FILE_RECEIVED

public static final java.lang.String FILE_RECEIVED
received files icoll name, defined in data definition.

See Also:
Constant Field Values
Constructor Detail

AbstractFileHandler

public AbstractFileHandler()
Method Detail

isExpired

public boolean isExpired()
Check whether the request is expired or the session is expired.

Returns:
true if the request is expired, false the request is valid

setExpired

public void setExpired(boolean isExpired)

getTimestamp

public long getTimestamp()
time stamp of the file handler

Returns:

getConfig

public KeyedCollection getConfig()

setConfig

public void setConfig(KeyedCollection config)

getTimeout

public long getTimeout()
Description copied from interface: IFileHandler
get the time out value of the file upload handler the time is milli-seconds.

Specified by:
getTimeout in interface IFileHandler
Returns:
time out value with milliseconds

setTimeout

public void setTimeout(long value)

getProcessorId

public java.lang.String getProcessorId()

setProcessorId

public void setProcessorId(java.lang.String processorId)

getSessionId

public java.lang.String getSessionId()

setSessionId

public void setSessionId(java.lang.String sessionId)

getDataname

public java.lang.String getDataname()

setDataname

public void setDataname(java.lang.String dataname)

requestValidate

public int requestValidate(javax.servlet.http.HttpServletRequest request)
it is suggested to extend the doRequestValidation() method for customer validation.

Specified by:
requestValidate in interface IFileHandler
Parameters:
request - fileupload request
Returns:
0, the request is valid, others means that the request is invalid.

doRequestValidation

protected abstract int doRequestValidation(javax.servlet.http.HttpServletRequest request)
validate whether the fileupload request is valid. e.g session expired, context error, or file system storage error etc.

Parameters:
request - fileupload request
Returns:
0, the request is valid, others means that the request is invalid.

updateTimeout

protected void updateTimeout(javax.servlet.http.HttpServletRequest request)
                      throws BTTSMException
Update the timeout flag for process

Throws:
BTTSMException

getSessionContext

protected final Context getSessionContext(java.lang.String sessionId)
                                   throws BTTSMException
get Session context

Parameters:
sessionId -
Returns:
session context or exception if not found
Throws:
BTTSMException

getProcessorContext

protected final Context getProcessorContext(java.lang.String sessionId,
                                            java.lang.String processId)
                                     throws BTTSMException
get processor context

Parameters:
sessionId -
processId -
Returns:
processor context or null if errors
Throws:
BTTSMException

clone

public abstract AbstractFileHandler clone()
this method is used to clone a new file handler.

Overrides:
clone in class java.lang.Object

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011