common/src/main/java/HTTPClient/IdempotentSequence.java
/**
     * Is this request part of an idempotent sequence? This method <em>must
     * not</em> be called before all requests have been added to this
     * sequence; similarly, <var>add()</var> <em>must not</em> be called
     * after this method was invoked.
     *
     * <P>We split up the sequence of requests into individual sub-sequences,
     * or threads, with all requests in a thread having the same request-URI
     * and no two threads having the same request-URI. Each thread is then
     * marked as idempotent or not according to the following rules:
     *
     * <OL>
     * <LI>If any method is UNKNOWN then the thread is not idempotent;
     * <LI>else, if no method has side effects then the thread is idempotent;
     * <LI>else, if the first method has side effects and is complete then
     *     the thread is idempotent;
     * <LI>else, if the first method has side effects, is not complete,
     *     and no other method has side effects then the thread is idempotent;
     * <LI>else the thread is not idempotent.
     * </OL>
     *
     * <P>The major assumption here is that the side effects of any method
     * only apply to resource specified. E.g. a <tt>"PUT /barbara.html"</tt>
     * will only affect the resource "/barbara.html" and nothing else.
     * This assumption is violated by POST of course; however, POSTs are
     * not pipelined and will therefore never show up here.
     *
     * @param req the request
     */


We split up the sequence of requests into individual sub-sequences,
or threads, with all requests in a thread having the same request-URI
and no two threads having the same request-URI. Each thread is then
marked as idempotent or not according to the following rules.


If any method is UNKNOWN then the thread is not idempotent;
else, if no method has side effects then the thread is idempotent;
else, if the first method has side effects and is complete then
the thread is idempotent;
else, if the first method has side effects, is not complete,
and no other method has side effects then the thread is idempotent;
else the thread is not idempotent.

The major assumption here is that the side effects of any method
only apply to resource specified.

@param req the request
We split up the sequence of requests into individual sub - sequences or threads with all requests in a thread having the same request - URI and no two threads having the same request - URI . Each thread is then marked as idempotent or not according to the following rules . If any method is UNKNOWN then the thread is not idempotent ; else if no method has side effects then the thread is idempotent ; else if the first method has side effects and is complete then the thread is idempotent ; else if the first method has side effects is not complete and no other method has side effects then the thread is idempotent ; else the thread is not idempotent . The major assumption here is that the side effects of any method only apply to resource specified . @param req the request
public boolean isIdempotent(Request req)
    {
	if (!analysis_done)
	    do_analysis();
	return ((Boolean)threads.get(req.getRequestURI())).booleanValue();
    }
public boolean isIdempotent ( Request req ) { if ( ! analysis_done ) do_analysis ( ) ; return ( ( Boolean ) threads . get ( req . getRequestURI ( ) ) ) . booleanValue ( ) ; }
Is this request part of an idempotent sequence?
Is this request part of an idempotent sequence?