|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.dse.cs.html.RequestValidationServices
Back and double post validation requires that we keep a table of operations which are in progress. The table key is a composite key of sessionid.pageid. The data held for each record is a RequestData object, which encapsulates the channelContext and the operation which is running. Double (multiple) post validation is performed by testing that no entry is present for a sessionid.pageid before processing the request. Back button validation is related to processes. This support has not been added yet.
Field Summary | |
protected static long |
ageLimit
|
protected static java.util.Hashtable |
pendingRequestTable
|
protected static java.util.Hashtable |
sessionIdTable
|
Constructor Summary | |
RequestValidationServices()
|
Method Summary | |
static void |
addFieldTo(Context ctx,
java.lang.String name,
java.lang.Object value)
This method adds framework related fields to a context. |
static void |
addOpToPendingRequest(ChannelContext channelContext,
DSEServerOperation addOperation)
Once a record is added in the pending requests table, this method adds to this record the operation related with the request. |
static boolean |
addPendingRequest(ChannelContext channelContext,
DSEServerOperation addOperation)
Add a record for an operation in process for a given session id and a given page id. |
static void |
beginAgingRequest(ChannelContext channelContext)
If the system has a non-zero age limit, then set a timestamp (actually a date) for the pending request matching the session and page that is passed in. |
protected static boolean |
deletePendingRequest(java.lang.String compositeKey)
This method removes an operation which has completed for a given page in a given session. |
static java.lang.String |
getCompositeKey(ChannelContext channelContext)
Builds the composite key used to identify a request in the pending requests table. |
static java.lang.String |
getNextPageId(java.lang.String sessionId)
Generate and return the next page ID for a given session. |
static DSEServerOperation |
getOperationInProcess(ChannelContext channelContext)
Return the operation in process that corresponds to the session id and page id specified in the channelContext |
protected static Semaphore |
getOperationInProcessSem(ChannelContext channelContext)
Return the semaphore for the operation in process that corresponds to the session id and page id specified in the channelContext. |
static ChannelContext |
getPendingRequestChannelContext(ChannelContext channelContext)
Returns the channel context associated in the pending requests table with a given sessionId/pageId. |
static boolean |
isProcessorRequest(ChannelContext channelContext)
See if the request asks or a processor instead of an operation. |
static boolean |
isRequestAging(ChannelContext channelContext)
See if a request recently completed for a given page in a given session. |
static boolean |
isRequestPending(ChannelContext channelContext)
See if there is already a request in process for a given page in a given session. |
static boolean |
isUnconsistentProcessor(ChannelContext channelContext)
See if a request for this processor is still in process or its aging timeout has not been reached yet. |
protected static void |
removeExpiredRequests()
Remove requests that are in the pendingRequestTable which have been there longer than the max aging time set for the system. |
static boolean |
replaceChannelContext(ChannelContext channelContext)
Replace the ChannelContext for an operation in process for a given session id and a given page id. |
static void |
signalOnOpInProcessSem(ChannelContext channelContext)
Signal the associated semaphores: awakes all the threads waiting in the semaphore associated to this request. |
static void |
waitOnOpInProcessSem(ChannelContext channelContext)
Forces the calling thread to wait in the semaphore associated to this request. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected static java.util.Hashtable sessionIdTable
protected static java.util.Hashtable pendingRequestTable
protected static long ageLimit
Constructor Detail |
public RequestValidationServices()
Method Detail |
public static void addFieldTo(Context ctx, java.lang.String name, java.lang.Object value) throws java.lang.Exception
ctx
- com.ibm.dse.base.Contextname
- java.lang.Stringvalue
- java.lang.Objectpublic static void addOpToPendingRequest(ChannelContext channelContext, DSEServerOperation addOperation) throws DSEException
channelContext
- com.ibm.dse.clientserver.ChannelContextoper
- com.ibm.dse.cs.html.HtmlServerOperationpublic static boolean addPendingRequest(ChannelContext channelContext, DSEServerOperation addOperation) throws DSEException
channelContext
- com.ibm.dse.clientserver.ChannelContextoper
- com.ibm.dse.cs.html.HtmlServerOperationpublic static void beginAgingRequest(ChannelContext channelContext) throws DSEException
channelContext
- com.ibm.dse.clientserver.ChannelContextprotected static boolean deletePendingRequest(java.lang.String compositeKey)
compositeKey
- java.lang.Stringpublic static java.lang.String getCompositeKey(ChannelContext channelContext) throws DSEException
channelContext
- com.ibm.dse.clientserver.ChannelContextpublic static java.lang.String getNextPageId(java.lang.String sessionId)
sessionId
- java.lang.Stringpublic static DSEServerOperation getOperationInProcess(ChannelContext channelContext) throws DSEException
com.ibm.dse.clientserver.ChannelContext
- protected static Semaphore getOperationInProcessSem(ChannelContext channelContext) throws DSEException
channelContext
- com.ibm.dse.clientserver.ChannelContextpublic static ChannelContext getPendingRequestChannelContext(ChannelContext channelContext) throws DSEException
channelContext
- com.ibm.dse.clientserver.ChannelContextpublic static boolean isProcessorRequest(ChannelContext channelContext) throws DSEException
channelContext
- com.ibm.dse.clientserver.ChannelContextpublic static boolean isRequestAging(ChannelContext channelContext) throws DSEException
channelContext
- com.ibm.dse.clientserver.ChannelContextpublic static boolean isRequestPending(ChannelContext channelContext) throws DSEException
channelContext
- com.ibm.dse.clientserver.ChannelContextpublic static boolean isUnconsistentProcessor(ChannelContext channelContext) throws DSEException
channelContext
- com.ibm.dse.clientserver.ChannelContextprotected static void removeExpiredRequests()
public static boolean replaceChannelContext(ChannelContext channelContext) throws DSEException
channelContext
- com.ibm.dse.clientserver.ChannelContextpublic static void signalOnOpInProcessSem(ChannelContext channelContext) throws DSEException
ctx
- com.ibm.dse.cs.ChannelContextpublic static void waitOnOpInProcessSem(ChannelContext channelContext) throws DSEException
ctx
- com.ibm.dse.base.Context
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |