]>
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 "ICAP/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.
18 namespace Adaptation
{
20 class Initiator
: virtual public AsyncJob
23 Initiator(): AsyncJob("Initiator") {}
24 virtual ~Initiator() {}
26 // called when ICAP response headers are successfully interpreted
27 virtual void noteAdaptationAnswer(HttpMsg
*message
) = 0;
29 // called when valid ICAP response headers are no longer expected
30 // the final parameter is set to disable bypass or retries
31 virtual void noteAdaptationQueryAbort(bool final
) = 0;
34 Initiate
*initiateAdaptation(Initiate
*x
); // locks and returns x
36 // done with x (and not calling announceInitiatorAbort)
37 void clearAdaptation(Initiate
*&x
); // unlocks x
39 // inform the transaction about abnormal termination and clear it
40 void announceInitiatorAbort(Initiate
*&x
); // unlocks x
43 } // namespace Adaptation
45 #endif /* SQUID_ADAPTATION__INITIATOR_H */