|
||
class CProtocolHandler : public CActive, public MHTTPFilter;
An abstract protocol handler. Protocol handlers are required to act as the bridge between abstract representations of sessions, transactions and headers (the client side of the HTTP architecture) and specific comms transports (the network side of the architecture).
Each instance of a concrete subclass of CProtocolHandler is associated with a specific client session, and hence with a particular choice of proxy type, and by implication, transport type. It is designed to appear like a filter in order to be placed at the end of a session's filter queue. This allows it to receive transaction-related events in the same way that any other filter (or indeed, the client) does. An active object, it may implement a queuing system for submitted transactions, according to the chosen internal service model.
In order to divide the abstract functionality associated with handling the HTTP protocol handler from the specifics needed for a particular choice of transport, this class defines a number of pure virtual methods which allow it to defer transport-specific choices or mechamisms. These are mainly concerned with the service model (ie. allocation of transactions to objects that can handle them), the codec model (ie. on-demand encoding/decoding of HTTP header data) and general housekeeping (eg. instantiation and cleanup of objects at particular points in a transaction lifecycle).
MHTTPFilterBase
- A HTTP Filter. This is the base class for normal filters (MHTTPFilter) which add...
MHTTPFilter
- A HTTP filter
CBase
-
Base class for all classes to be instantiated on the heap.
CActive
-
The core class of the active object abstraction.
CProtocolHandler
- An abstract protocol handler. Protocol handlers are required to act as the bridg...
Defined in CProtocolHandler
:
CProtocolHandler(RHTTPSession)
Constructs a protocol handler associated with the supplied HTTP client session. CancelTransactionHook(CProtTransaction &)
Intended Usage: Called when the RHTTPTransaction object corresponding to aTrans ...ClosedTransactionHook(CProtTransaction *)
Intended Usage: Called when the RHTTPTransaction object corresponding to aTrans ...Codec()const
Obtain the protocol handler's header codec. CompleteSelf()
Completes this active object - allows the protocol handler to reevaluate the que...ConstructL(RHTTPSession)
Second phase construction in which any necessary allocation is done Implementati...CreateCodecL()
Intended usage: Creates the specific type of codec required for a specific type ...CreateProtTransactionL(RHTTPTransaction)
Intended Usage: Creates a representation of a client transaction to be used in t...DoCancel()
Intended Usage: Cancel outstanding asynchronous requests that this object has ma...FindTransaction(RHTTPTransaction,const CProtTransaction *&)const
Searches the array of CProtTransaction objects to if the aTransaction object is ...GetInterfaceL(TUid,MProtHandlerInterface *&)
Intended Usage: This is a mechanism for allowing future change to CProtocolHandl...MHFLoad(RHTTPSession,THTTPFilterHandle)
Intended Usage: Called when the filter is being added to the session's filter qu...MHFRunError(TInt,RHTTPTransaction,const THTTPEvent &)
Intended Usage: Called when RunL leaves from a transaction event. This works in ...MHFRunL(RHTTPTransaction,const THTTPEvent &)
Intended Usage: Called when the filter's registration conditions are satisfied f...MHFSessionRunError(TInt,const THTTPSessionEvent &)
Intended Usage: Called when MHFRunL leaves from a session event. This works in t...MHFSessionRunL(const THTTPSessionEvent &)
Intended Usage: Called when the filters registration conditions are satisfied fo...MHFUnload(RHTTPSession,THTTPFilterHandle)
Intended Usage: Called when the filter is being removed from a session's filter ...NotifyNewRequestBodyPart(CProtTransaction &)
Intended Usage: Called to notify the concrete protocol handler that new request ...NumActiveTransactions()const
Obtain the number of currently active transactions Reserved2()
Intended Usage: Reserve a slot in the v-table to preserve future BC RunError(TInt)
Intended Usage: Do any cleanup required should RunL leave RunL()
Intended Usage: Do some processing when a previous asynchronous request made by ...ServiceL(CProtTransaction &)
Intended Usage: Attempt to service the transaction. This implies that the concre...SessionServerCert()
Get the Server Certificate for the current session. SessionServerCert(TCertInfo &)
Intended Usage: Get the Server Certificate for the current session. TransactionCompletedL(RHTTPTransaction,THTTPEvent)
Callback method for concrete protocol handler sub-classes to inform the base pro...TransactionFailed(RHTTPTransaction)
Callback method for concrete protocol handler sub-classes to inform the base pro...TransactionServerCert(RHTTPTransaction)
Get the Server Certificate for the specified transaction. TransactionServerCert(TCertInfo &,RHTTPTransaction)
Intended Usage: Get the Server Certificate for the specified transaction. iCodec
The codec used for this protocol handler (to be specialised in subclasses)iDummyLoggerNotUsed
HTTP logger handle (debug only)iSecurityPolicy
An interface providing the security policy. This may be NULL if there is no secu...iSession
The session to which this protocol handler is dedicated~CProtocolHandler()
Intended Usage: Class destructor. Inherited from CActive
:
CActive(TInt)
Constructs the active object with the specified priority.Cancel()
Cancels the wait for completion of an outstanding request.Deque()
Removes the active object from the active scheduler's list of active objects.EPriorityHigh
A priority higher than EPriorityUserInput.EPriorityIdle
A low priority, useful for active objects representing background processing.EPriorityLow
A priority higher than EPriorityIdle but lower than EPriorityStandard.EPriorityStandard
Most active objects will have this priority.EPriorityUserInput
A priority higher than EPriorityStandard; useful for active objects handling use...Extension_(TUint,TAny *&,TAny *)
Extension function IsActive()const
Determines whether the active object has a request outstanding.IsAdded()const
Determines whether the active object has been added to the active scheduler's li...Priority()const
Gets the priority of the active object.SetActive()
Indicates that the active object has issued a request and that it is now outstan...SetPriority(TInt)
Sets the priority of the active object.TPriority
Defines standard priorities for active objects. iStatus
The request status associated with an asynchronous request.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...Inherited from MHTTPFilter
:
ECache
Filters to handle caching behaviours. EClient
The client :- At the head of the filter chain : No position above this must be u...EClientFilters
Client filters that assume all standard behaviour is already there. ECookies
The cookie filter, and other filters that don't need to be concerned with resubm...EProtocolHandler
The Protocol Handler :- At the base of the filter chain and nearest to the trans...EStatusCodeHandler
Filters to handle particular status codes. e.g.Redirection and authentication. ETidyUp
The validation filter and any other final tidy up or initial preprocessing of tr...EUAProf
The UAProf filter. TPositions
Default filter positions protected: IMPORT_C CProtocolHandler(RHTTPSession aSession);
Constructs a protocol handler associated with the supplied HTTP client session.
|
protected: IMPORT_C void ConstructL(RHTTPSession aSession);
Second phase construction in which any necessary allocation is done Implementations of this interface may leave with KErrNoMemory
|
IMPORT_C CHeaderCodec* Codec() const;
Obtain the protocol handler's header codec.
|
CHeaderCodec
An abstract HTTP header codec.IMPORT_C const CCertificate* SessionServerCert();
Get the Server Certificate for the current session.
|
IMPORT_C const CCertificate* TransactionServerCert(RHTTPTransaction aTransaction);
Get the Server Certificate for the specified transaction.
|
|
virtual TInt SessionServerCert(TCertInfo &aServerCert)=0;
Intended Usage: Get the Server Certificate for the current session.
|
|
virtual TInt TransactionServerCert(TCertInfo &aServerCert, RHTTPTransaction aTransaction)=0;
Intended Usage: Get the Server Certificate for the specified transaction.
|
|
IMPORT_C virtual void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent &aEvent);
Intended Usage: Called when the filter's registration conditions are satisfied for events that occur on a transaction. Any Leaves must be handled by the appropriate MHFRunError. Note that this function is not allowed to leave if called with certain events.
|
|
THTTPEvent
A HTTP status message. Status messages consist of a UID and a status code within...MHTTPFilterBase
A HTTP Filter. This is the base class for normal filters (MHTTPFilter) which add...IMPORT_C virtual void MHFSessionRunL(const THTTPSessionEvent &aEvent);
Intended Usage: Called when the filters registration conditions are satisfied for events that occur on the session. Any leaves must be handled by the appropriate MHFRunError.
|
|
MHTTPFilterBase
A HTTP Filter. This is the base class for normal filters (MHTTPFilter) which add...IMPORT_C virtual TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction, const THTTPEvent &aEvent);
Intended Usage: Called when RunL leaves from a transaction event. This works in the same way as CActve::RunError; return KErrNone if you have handled the error. If you don't completely handle the error, a panic will occur.
|
|
MHTTPFilterBase
A HTTP Filter. This is the base class for normal filters (MHTTPFilter) which add...IMPORT_C virtual TInt MHFSessionRunError(TInt aError, const THTTPSessionEvent &aEvent);
Intended Usage: Called when MHFRunL leaves from a session event. This works in the same way as CActve::RunError. If you don't completely handle the error, a panic will occur.
|
|
MHTTPFilterBase
A HTTP Filter. This is the base class for normal filters (MHTTPFilter) which add...IMPORT_C virtual void MHFUnload(RHTTPSession aSession, THTTPFilterHandle aHandle);
Intended Usage: Called when the filter is being removed from a session's filter queue.
|
IMPORT_C virtual void MHFLoad(RHTTPSession aSession, THTTPFilterHandle aHandle);
Intended Usage: Called when the filter is being added to the session's filter queue.
|
protected: IMPORT_C void TransactionCompletedL(RHTTPTransaction aTrans, THTTPEvent aEventStatus);
Callback method for concrete protocol handler sub-classes to inform the base protocol handler that a transaction has completed. The concrete protocol handler must call this method in order to supply a completion event that will be sent to the client. In addition, the method allows the base protocol handler to do some queue management.
|
|
protected: IMPORT_C TInt NumActiveTransactions() const;
Obtain the number of currently active transactions
|
protected: IMPORT_C void TransactionFailed(RHTTPTransaction aTrans);
Callback method for concrete protocol handler sub-classes to inform the base protocol handler that a transaction has failed utterly. (i.e. the sub-class used aTrans.Fail().) The base protocol handler sets the transaction state to be cancelled.
|
protected: IMPORT_C void CompleteSelf();
Completes this active object - allows the protocol handler to reevaluate the queue of pending transactions and service new ones if possible.
protected: IMPORT_C TInt FindTransaction(RHTTPTransaction aTransaction, const CProtTransaction *&aProtTransaction) const;
Searches the array of CProtTransaction
objects to if the aTransaction object is wrapped by one of them. If one is found aProtTransaction is set to it
|
|
private: virtual void CreateCodecL()=0;
Intended usage: Creates the specific type of codec required for a specific type of protocol handler.
This must be implemented by a concrete protocol handler sub-class.
private: virtual CProtTransaction* CreateProtTransactionL(RHTTPTransaction aTransaction)=0;
Intended Usage: Creates a representation of a client transaction to be used in the protocol handler. Since the protocol handler
deals with the low- level data for a transaction as sent over a particular transport, an appropriate CProtTransaction-derived
class is used that owns a CRxData
and a CTxData
to handle the low-level data.
This must be implemented by a concrete protocol handler sub-class.
|
|
|
CRxData
An abstract base class for the decoding of response data received by a protocol ...CTxData
An abstract base class for the encoding of request data to be transmitted by a p...private: virtual TBool ServiceL(CProtTransaction &aTrans)=0;
Intended Usage: Attempt to service the transaction. This implies that the concrete protocol handler will allocate some transport resources to the transaction - which could fail if the protocol handler has hit an internal limit of resources or bandwidth. Implementations of this interface may leave with any of KErrHttpInvalidUri, KErrGeneral, KErrNoMemory
This must be implemented by a concrete protocol handler sub-class.
|
|
private: virtual void ClosedTransactionHook(CProtTransaction *aTrans)=0;
Intended Usage: Called when the RHTTPTransaction
object corresponding to aTrans has been closed by the client. This allows the concrete protocol handler to do any cleanup
required for this particular transaction.
Ownership of the CProtTransaction
object is transferred back to the concrete protocol handler, which then has deletion responsibility for it. By the time this
function has been called, the base protocol handler will have dequeued the transaction.
The client's RHTTPTransaction
will be closed when this function returns, so it is not possible to send events to the client during the function's execution.
This must be implemented by a concrete protocol handler sub-class.
|
private: virtual void CancelTransactionHook(CProtTransaction &aTransaction)=0;
Intended Usage: Called when the RHTTPTransaction
object corresponding to aTrans has been cancelled by the client or an intermediate filter. This allows the concrete protocol
handler to do any cleanup and to perform the necessary actions for cancellation on its transport layer.
This must be implemented by a concrete protocol handler sub-class.
|
private: virtual void NotifyNewRequestBodyPart(CProtTransaction &aTransaction)=0;
Intended Usage: Called to notify the concrete protocol handler that new request body data is available for transmission.
This must be implemented by a concrete protocol handler sub-class.
|
protected: IMPORT_C virtual void RunL();
Intended Usage: Do some processing when a previous asynchronous request made by this object has completed.
protected: IMPORT_C virtual TInt RunError(TInt aError);
Intended Usage: Do any cleanup required should RunL leave
|
|
protected: IMPORT_C virtual void DoCancel();
Intended Usage: Cancel outstanding asynchronous requests that this object has made
protected: inline virtual void GetInterfaceL(TUid aInterfaceId, MProtHandlerInterface *&aInterfacePtr);
Intended Usage: This is a mechanism for allowing future change to CProtocolHandler API without breaking BC.
|
inline virtual void Reserved2();
Intended Usage: Reserve a slot in the v-table to preserve future BC
protected: RHTTPSession iSession;
The session to which this protocol handler is dedicated
protected: CHeaderCodec * iCodec;
The codec used for this protocol handler (to be specialised in subclasses)
protected: TUint8 iDummyLoggerNotUsed[sizeof(THttpLogger)];
HTTP logger handle (debug only)
protected: CSecurityPolicy * iSecurityPolicy;
An interface providing the security policy. This may be NULL if there is no security policy plugin