]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/Initiator.h
1 #ifndef SQUID_ADAPTATION__INITIATOR_H
2 #define SQUID_ADAPTATION__INITIATOR_H
4 #include "base/AsyncJob.h"
5 #include "adaptation/forward.h"
8 * The ICAP Initiator is an ICAP vectoring point that initates ICAP
9 * transactions. This interface exists to allow ICAP transactions to
10 * signal their initiators that they have the answer from the ICAP server
11 * or that the ICAP query has aborted and there will be no answer. It
12 * is also handy for implementing common initiator actions such as starting
13 * or aborting an ICAP transaction.
21 class Initiator
: virtual public AsyncJob
24 Initiator(): AsyncJob("Initiator") {}
25 virtual ~Initiator() {}
27 // called when ICAP response headers are successfully interpreted
28 virtual void noteAdaptationAnswer(HttpMsg
*message
) = 0;
30 // called when valid ICAP response headers are no longer expected
31 // the final parameter is set to disable bypass or retries
32 virtual void noteAdaptationQueryAbort(bool final
) = 0;
35 Initiate
*initiateAdaptation(Initiate
*x
); // locks and returns x
37 // done with x (and not calling announceInitiatorAbort)
38 void clearAdaptation(Initiate
*&x
); // unlocks x
40 // inform the transaction about abnormal termination and clear it
41 void announceInitiatorAbort(Initiate
*&x
); // unlocks x
44 } // namespace Adaptation
46 #endif /* SQUID_ADAPTATION__INITIATOR_H */