|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.mvc.AbstractController
org.springframework.web.servlet.mvc.BaseCommandController
org.springframework.web.servlet.mvc.AbstractCommandController
net.sf.xaj.web.XmlDbBatchWebService
public class XmlDbBatchWebService
Web service for managing long-running batch operations.
This web service allows for long-running transactions that span any number of HTTP requests. The normal use case is this:
XmlDbWebConstants.BatchOperation.BEGIN_BATCH operation
to begin the batch transaction. This will return a special HTTP header
in the response, XmlDbWebConstants.TRANSACTION_ID_HEADER_NAME, whose value is
the transaction ID of the transaction. You will need to also specify
the XmlDb service for which you want to perform this batch
operation against, using the XmlDbBatchWebService.Command.setXmlDbServiceName(String)
value.XmlDbBatchWebService.Command.setTxId(String) value
and the XmlDbWebConstants.BatchOperation.CONTINUE_BATCH operation. In this way you can
store several XLM documents.XmlDbWebConstants.BatchOperation.COMMIT_BATCH operation. This will commit
the transaction and return a List of XmlResource IDs that were affected
by the transaction. Alternatively, you can cll this service with the
XmlDbWebConstants.BatchOperation.ABORT_BATCH operation, which will cause the transaction
to rollback.The configurable properties of this class are:
XmlDbWebConstants.BatchOperation.COMMIT_BATCH
operation. Defaults to batch-commit.XmlDbManager to use for obtaining XmlDb instances.
| Nested Class Summary | |
|---|---|
static class |
XmlDbBatchWebService.Command
Controller command object. |
| Field Summary | |
|---|---|
static int |
DEFAULT_BATCH_QUEUE_SIZE
The default value for the batchQueueSize property. |
static int |
DEFAULT_INFO_BATCH_PROCESS
The default value for the infoBatchProgress property. |
static long |
DEFAULT_MAX_SECONDS_OFFER_QUEUE
The default value for the maxSecondsOfferQueue property. |
static long |
DEFAULT_MAX_WAIT_BATCH_RESULTS
The default value for the maxWaitForBatchResults property (14 hours). |
static long |
DEFAULT_PAUSE_AFTER_DELETE
The default value for the pauseAfterDeleteMs property. |
static long |
DEFAULT_TRANSACTION_TIMEOUT
The default value for the transactionTimeoutMs property (4 hours). |
static long |
DEFAULT_TRANSACTION_TIMEOUT_PERIOD
The default value for the transactionTimoutPeriodMs property. |
static java.lang.String |
DELETE_RESULT_MODEL_KEY
The model key for the Integer number resulting from a batch delete. |
static java.lang.String |
XML_RESOURCE_IDS_MODEL_KEY
The model key for the List of XmlResource IDs after a commit. |
| Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController |
|---|
DEFAULT_COMMAND_NAME |
| Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator |
|---|
HEADER_CACHE_CONTROL, HEADER_EXPIRES, HEADER_PRAGMA, METHOD_GET, METHOD_HEAD, METHOD_POST |
| Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
|---|
logger |
| Constructor Summary | |
|---|---|
XmlDbBatchWebService()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
void |
destroy()
|
int |
getBatchQueueSize()
|
protected java.lang.Object |
getCommand(javax.servlet.http.HttpServletRequest request)
|
java.lang.String |
getCommitView()
|
int |
getInfoBatchProgress()
|
long |
getMaxSecondsOfferQueue()
|
long |
getMaxWaitForBatchResults()
|
long |
getPauseAfterDeleteMs()
|
long |
getTransactionTimeoutMs()
|
java.util.Timer |
getTransactionTimeoutTimer()
|
long |
getTransactionTimoutPeriodMs()
|
XmlDbManager |
getXmlDbManager()
|
protected org.springframework.web.servlet.ModelAndView |
handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object command,
org.springframework.validation.BindException errors)
|
void |
setBatchQueueSize(int batchQueueSize)
|
void |
setCommitView(java.lang.String commitView)
|
void |
setInfoBatchProgress(int infoBatchProgress)
|
void |
setMaxSecondsOfferQueue(long maxSecondsOfferQueue)
|
void |
setMaxWaitForBatchResults(long maxWaitForBatchResults)
|
void |
setPauseAfterDeleteMs(long pauseAfterDeleteMs)
|
void |
setTransactionTimeoutMs(long transactionTimeoutMs)
|
void |
setTransactionTimeoutTimer(java.util.Timer transactionTimeoutTimer)
|
void |
setTransactionTimoutPeriodMs(long transactionTimoutPeriodMs)
|
void |
setXmlDbManager(XmlDbManager xmlDbManager)
|
| Methods inherited from class org.springframework.web.servlet.mvc.AbstractCommandController |
|---|
handleRequestInternal |
| Methods inherited from class org.springframework.web.servlet.mvc.BaseCommandController |
|---|
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, onBindAndValidate, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, suppressBinding, suppressValidation |
| Methods inherited from class org.springframework.web.servlet.mvc.AbstractController |
|---|
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession |
| Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator |
|---|
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseExpiresHeader |
| Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
|---|
getServletContext, getTempDir, getWebApplicationContext, isContextRequired |
| Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
|---|
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String XML_RESOURCE_IDS_MODEL_KEY
public static final java.lang.String DELETE_RESULT_MODEL_KEY
public static final long DEFAULT_MAX_SECONDS_OFFER_QUEUE
maxSecondsOfferQueue property.
public static final int DEFAULT_BATCH_QUEUE_SIZE
batchQueueSize property.
public static final long DEFAULT_MAX_WAIT_BATCH_RESULTS
maxWaitForBatchResults property (14 hours).
public static final long DEFAULT_TRANSACTION_TIMEOUT
transactionTimeoutMs property (4 hours).
public static final long DEFAULT_TRANSACTION_TIMEOUT_PERIOD
transactionTimoutPeriodMs property.
public static final int DEFAULT_INFO_BATCH_PROCESS
infoBatchProgress property.
public static final long DEFAULT_PAUSE_AFTER_DELETE
pauseAfterDeleteMs property.
| Constructor Detail |
|---|
public XmlDbBatchWebService()
| Method Detail |
|---|
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exception
protected java.lang.Object getCommand(javax.servlet.http.HttpServletRequest request)
throws java.lang.Exception
getCommand in class org.springframework.web.servlet.mvc.BaseCommandControllerjava.lang.Exception
public void destroy()
throws java.lang.Exception
destroy in interface org.springframework.beans.factory.DisposableBeanjava.lang.Exception
protected org.springframework.web.servlet.ModelAndView handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object command,
org.springframework.validation.BindException errors)
throws java.lang.Exception
handle in class org.springframework.web.servlet.mvc.AbstractCommandControllerjava.lang.Exceptionpublic java.lang.String getCommitView()
public void setCommitView(java.lang.String commitView)
commitView - the commitView to setpublic XmlDbManager getXmlDbManager()
public void setXmlDbManager(XmlDbManager xmlDbManager)
xmlDbManager - the xmlDbManager to setpublic int getBatchQueueSize()
public void setBatchQueueSize(int batchQueueSize)
batchQueueSize - the batchQueueSize to setpublic long getMaxSecondsOfferQueue()
public void setMaxSecondsOfferQueue(long maxSecondsOfferQueue)
maxSecondsOfferQueue - the maxSecondsOfferQueue to setpublic long getMaxWaitForBatchResults()
public void setMaxWaitForBatchResults(long maxWaitForBatchResults)
maxWaitForBatchResults - the maxWaitForBatchResults to setpublic long getTransactionTimeoutMs()
public void setTransactionTimeoutMs(long transactionTimeoutMs)
transactionTimeoutMs - the transactionTimeoutMs to setpublic java.util.Timer getTransactionTimeoutTimer()
public void setTransactionTimeoutTimer(java.util.Timer transactionTimeoutTimer)
transactionTimeoutTimer - the transactionTimeoutTimer to setpublic long getTransactionTimoutPeriodMs()
public void setTransactionTimoutPeriodMs(long transactionTimoutPeriodMs)
transactionTimoutPeriodMs - the transactionTimoutPeriodMs to setpublic int getInfoBatchProgress()
public void setInfoBatchProgress(int infoBatchProgress)
infoBatchProgress - the infoBatchProgress to setpublic long getPauseAfterDeleteMs()
public void setPauseAfterDeleteMs(long pauseAfterDeleteMs)
pauseAfterDeleteMs - the pauseAfterDeleteMs to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||