IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.cs.ajax
Class FileUploadServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.ibm.btt.cs.ajax.FileUploadServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class FileUploadServlet
extends javax.servlet.http.HttpServlet

This class extends HttpServlet class used to handle file updload scenario. It will save the uploaded file in file system or configured DB

See Also:
Serialized Form

Field Summary
static java.lang.String CANCELPENDING
           
static java.lang.String CHECK_DURATION
          check duration paramter for servlet
static long checkDuration
          request time out check duration, in milliseconds.
static java.lang.String FILE_HANDLERS
          constant id of file handlers in btt.xml
static java.lang.String FILE_OVERSIZE
           
static java.lang.String FILEUPLOADACTION
           
static java.lang.String HANDLER_CLASS
           
static java.lang.String QUERYSIZE
           
static java.lang.String REQ_EXPIRED
          add a request expired info for a request
static java.lang.String REQ_TIMEOUT
          add a time out info into request attribute
static java.lang.String UUID
           
 
Constructor Summary
FileUploadServlet()
           
 
Method Summary
 void destroy()
           
protected  void doDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          handle file delete request
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  AbstractFileHandler getFileHandler(javax.servlet.http.HttpServletRequest request)
          get proper file handler from the request
 void init(javax.servlet.ServletConfig config)
          initialize paramters
 void initParams(javax.servlet.ServletConfig config)
          initialize paramters
 void start()
          Start request timeout check.
 
Methods inherited from class javax.servlet.http.HttpServlet
doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQ_TIMEOUT

public static final java.lang.String REQ_TIMEOUT
add a time out info into request attribute

See Also:
Constant Field Values

REQ_EXPIRED

public static final java.lang.String REQ_EXPIRED
add a request expired info for a request

See Also:
Constant Field Values

FILE_HANDLERS

public static final java.lang.String FILE_HANDLERS
constant id of file handlers in btt.xml

See Also:
Constant Field Values

HANDLER_CLASS

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

UUID

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

FILEUPLOADACTION

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

QUERYSIZE

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

CANCELPENDING

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

FILE_OVERSIZE

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

checkDuration

public static long checkDuration
request time out check duration, in milliseconds. Default value is 20 minutes.


CHECK_DURATION

public static final java.lang.String CHECK_DURATION
check duration paramter for servlet

See Also:
Constant Field Values
Constructor Detail

FileUploadServlet

public FileUploadServlet()
Method Detail

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      java.io.IOException
Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

doDelete

protected void doDelete(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
                 throws javax.servlet.ServletException,
                        java.io.IOException
handle file delete request

Overrides:
doDelete in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

getFileHandler

protected AbstractFileHandler getFileHandler(javax.servlet.http.HttpServletRequest request)
                                      throws javax.servlet.ServletException
get proper file handler from the request

Parameters:
request -
Returns:
file handler or null if errors
Throws:
javax.servlet.ServletException

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
initialize paramters

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

start

public void start()
Start request timeout check. Schedule a timer task for a given time defined in each file handler, which will look for expired fileupload request. when a request is expired, it will be handled by the handler's OnRequestExpired method


destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet

initParams

public void initParams(javax.servlet.ServletConfig config)
                throws javax.servlet.ServletException
initialize paramters

Throws:
javax.servlet.ServletException

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011