applayerprotocols/httpexamples/nwsswsptrhnd/CNwssWspCOSession.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file CNwssWspCOSession.h
       
    18  @warning : This file contains Rose Model ID comments - please do not delete
       
    19 */
       
    20 
       
    21 #ifndef	__CNWSSWSPCOSESSION_H__
       
    22 #define __CNWSSWSPCOSESSION_H__
       
    23 
       
    24 // System includes
       
    25 #include <wapcli.h> // NWSS Wap Stack
       
    26 #include <wsp/mwspcosessioninvoker.h>
       
    27 #include <wsp/mwspcomethodinvoker.h>
       
    28 #include <http/framework/logging.h>
       
    29 
       
    30 // Local includes
       
    31 #include "cnwsswspsession.h"
       
    32 #include "cnwsstranslookuptable.h"
       
    33 #include "mnwsssessioneventhandler.h"
       
    34 #include "mnwsstransactioneventhandler.h"
       
    35 #include "mnwssoomhandler.h"
       
    36 
       
    37 // Forward declarations
       
    38 class MNwssWapServer;
       
    39 class MConnectionInfoProvider;
       
    40 class MWspCOSessionCallback;
       
    41 class CNwssWspCOEventDispatcher;
       
    42 class CCapCodec;
       
    43 class CNwssConnectGuard;
       
    44 class CNwssWspTransactionEventFilter;
       
    45 class CNwssWspSessionEventFilter;
       
    46 
       
    47 /**
       
    48 	@since			7.0
       
    49 	This class encapsulates a Connection-Oriented WSP session by specialising
       
    50 	CNwssWspSession.  It is responsible for making the majority of the calls on the
       
    51 	underlying NWSS WAP protocol stack.  It has five main areas of functionality:
       
    52 	1.	Opening, and connecting, the handle for a WSP CO session using the proxy
       
    53 		information supplied by the client (::OpenWspSession() and
       
    54 		::CompleteProxyConnectionL())
       
    55 	2.	Converting the requested client capabilities from the M-class interfaces
       
    56 		supplied by the client into a CCapCodec object, as used by the NWSS WAP
       
    57 		stack (::PrepareClientCapabilities())
       
    58 	3.	Doing the reverse for negotiated capabilities that are received from the
       
    59 		WAP Proxy before passing back to the client (::SetNegotiatedCapabilitiesL()).
       
    60 	4.	Implementing the MWspCOSessionInvoker and MWspCOMethodInvoker interfaces,
       
    61 		and translating each of the primitives exposed by these interfaces into
       
    62 		calls on the underlying NWSS WAP Stack.
       
    63 	5.	Implementing the MNwssSessionEventHandler and MNwssTransactionEventHandler
       
    64 		interfaces, in order that events received from the underlying WAP Stack (by
       
    65 		the class CNwssWspCOEventDispatcher) may be converted into the primitives
       
    66 		exposed by the client's callback interfaces MWspCOSessionCallback and
       
    67 		MWspCOMethodCallback.
       
    68  */
       
    69 
       
    70 //##ModelId=3BBDCF00036A
       
    71 class CNwssWspCOSession : public CNwssWspSession,
       
    72 						  public MWspCOSessionInvoker,
       
    73 						  public MWspCOMethodInvoker,
       
    74 						  public MNwssSessionEventHandler,
       
    75 						  public MNwssTransactionEventHandler,
       
    76 						  public MNwssOomHandler
       
    77 	{
       
    78 // Unit testing only - give friendship to a public state accessor 
       
    79 #ifdef __UNIT_TESTING__
       
    80 	friend class TNwssWspCOSession_StateAccessor;
       
    81 #endif
       
    82 
       
    83 public: // methods
       
    84 
       
    85 /**
       
    86 	Factory construction of the CNwssWspCOSession class.
       
    87 	@since			7.0
       
    88 	@param			aStringPool			(in) The client's string pool.
       
    89 	@param			aWapStackProvider	(in) An owner of a WAP stack server session.
       
    90 	@param			aConnInfoProvider	(in) A collection of client interfaces that
       
    91 											 provide connection-related information
       
    92 	@param			aSecurityPolicy		(in) A security policy provider.
       
    93 	@param			aSessionCB			(in) The client's callback for receiving
       
    94 											 WSP session events
       
    95 	@return			The newly constructed CNwssWspCOSession instance.
       
    96 	@leave			System error codes, e.g. KErrNoMemory.
       
    97 */
       
    98 	//##ModelId=3C4C49D202E6
       
    99 	static CNwssWspCOSession* NewL(RStringPool& aStringPool,
       
   100 								   MNwssWapServer& aWapStackProvider,
       
   101 								   MConnectionInfoProvider& aConnInfoProvider,
       
   102 								   MSecurityPolicy& aSecurityPolicy,
       
   103 								   MWspCOSessionCallback& aSessionCB);
       
   104 
       
   105 /** Destructor.
       
   106 	@since			7.0
       
   107 */
       
   108 	//##ModelId=3C4C49D2021E
       
   109 	virtual ~CNwssWspCOSession();
       
   110 
       
   111 private: // methods inherited from CNwssWspSession
       
   112 
       
   113 /** Hook provided to the parent class allowing it to cause a
       
   114 					Connection-Oriented WSP session to the specified proxy to be
       
   115 					opened.
       
   116 	@since			7.0
       
   117 	@param			aRemoteHost	(in) The bearer-dependent address of the proxy.
       
   118 	@param			aRemotePort	(in) The proxy port to which a connection is made.
       
   119 	@param			aLocalPort	(in) (optional) The local port to which proxy replies
       
   120 									 are sent. A value of zero means 'don't care'.
       
   121 	@param			aBearer		(in) The bearer on which the connection is made.
       
   122 	@param			aSecureConn	(in) Flag indicating whether WTLS is to be used.
       
   123 	@return			A system error code originating from the NWSS WAP Stack.
       
   124  */
       
   125 	//##ModelId=3C4C49D10014
       
   126 	virtual TInt OpenWspSession(const TDesC8& aRemoteHost,
       
   127 								RWAPConn::TPort aRemotePort,
       
   128 								RWAPConn::TPort aLocalPort,
       
   129 								TBearer aBearer,
       
   130 								TBool aSecureConn);
       
   131 
       
   132 /** Hook provided to the parent class allowing it to cause an
       
   133 					opened Connection-Oriented WSP session to be closed.
       
   134 	@since			7.0
       
   135 	@return			A system error code originating from the NWSS WAP Stack.
       
   136  */
       
   137 	//##ModelId=3C591A9A0171
       
   138 	virtual TInt CloseWspSession();
       
   139 
       
   140 /** 	Hook provided to the parent class allowing it to perform any
       
   141 					required actions to complete a connection to the WAP Proxy
       
   142 					after the WSP session has been opened, and optionally a WTLS
       
   143 					handshake performed.
       
   144 					For connection-oriented WSP, this implies the use of
       
   145 					RWSPCOConn::Connect() to send the S-Connect.cnf primitive to
       
   146 					the proxy.  This initiates the connection, with an exchange of
       
   147 					capability information and session headers.
       
   148 	@since			7.0
       
   149 	@leave			A system error code originating from the NWSS WAP Stack.
       
   150  */
       
   151 	//##ModelId=3C4C49D002F7
       
   152 	virtual void CompleteProxyConnectionL();
       
   153 
       
   154 /** Hook provided to the parent class allowing it to obtain the
       
   155 					WTLS handle from the current opened Connection-Oriented WSP
       
   156 					session.
       
   157 	@since			7.0
       
   158 	@return			A handle for the WTLS layer of the WAP protocol stack.
       
   159  */
       
   160 	//##ModelId=3C4C49D001FD
       
   161 	virtual RWTLS WtlsHnd();
       
   162 
       
   163 /** Allows this class to to perform specific actions in response to
       
   164 					the parent class' RunError().  This is called in the EReady
       
   165 					state.
       
   166 					This handles situations where CompleteProxyConnectionL() has
       
   167 					left.  In practice, this handles errors arising from the use
       
   168 					of RWSPCOConn::Connect().
       
   169 	@since			7.0
       
   170 	@param			aError	(in) The error code to be handled, with which
       
   171 					CompleteProxyConnectionL() left.
       
   172  */
       
   173 	//##ModelId=3C4C49D0001C
       
   174 	virtual void DoRunError(TInt aError);
       
   175 
       
   176 /** Called from DoCancel ofthe parent class' RunError() in the
       
   177 					EReady state.  This class cancels outstanding asynchronous
       
   178 					requests it makes from the Event Dispatcher.
       
   179 	@since			7.0
       
   180 	@return			Flag indicating whether, following cancellation, this class
       
   181 					must return to the EDisconnected state.
       
   182  */
       
   183 	//##ModelId=3C591A9A0103
       
   184 	virtual TBool SubDoCancel();
       
   185 
       
   186 private: // methods inherited from MWspCOSessionInvoker
       
   187 
       
   188 	/** This represents the S-Connect.req primitive. 
       
   189 		@see MWspCOSessionInvoker
       
   190 	*/
       
   191 	//##ModelId=3C4C49CF030A
       
   192 	virtual void ConnectReq();
       
   193 
       
   194 	/** This represents the S-Disconnect.req primitive.
       
   195 		@see MWspCOSessionInvoker
       
   196 	*/
       
   197 	//##ModelId=3C4C49CF0133
       
   198 	virtual void DisconnectReq(TWspReason aReason);
       
   199 
       
   200 	/** This represents the S-Suspend.req primitive.
       
   201 		@see MWspCOSessionInvoker
       
   202 	*/
       
   203 	//##ModelId=3C4C49CF0043
       
   204 	virtual void SuspendReq();
       
   205 
       
   206 	/** This represents the S-Resume.req primitive. 
       
   207 		@see MWspCOSessionInvoker
       
   208 	*/
       
   209 	//##ModelId=3C4C49CE0345
       
   210 	virtual void ResumeReq();
       
   211 
       
   212 private: // methods inherited from MWspCOMethodInvoker
       
   213 
       
   214 	/** This represents the S-MethodInvoke.req primitive.
       
   215 		@see MWspCOSessionInvoker
       
   216 	*/
       
   217 	//##ModelId=3C4C49CD01D1
       
   218 	virtual void MethodInvokeReq(
       
   219 								MWspCOMethodCallback&		aTransactionCallback, 
       
   220 								RStringF					aMethod, 
       
   221 								const TUriC8&				aRequestUri, 
       
   222 								const TDesC8&				aRequestHeaders, 
       
   223 								const TDesC8&				aRequestBody,
       
   224 								TBool						aMoreData
       
   225 								);
       
   226 
       
   227 	/** This represents the S-MethodInvokeData.req primitive. 
       
   228 		@see MWspCOSessionInvoker
       
   229 	*/
       
   230 	//##ModelId=3C4C49CC031A
       
   231 	virtual void MethodInvokeDataReq(
       
   232 									MWspCOMethodCallback&	aTransactionCallback,
       
   233 									const TDesC8&			aRequestBody,
       
   234 									const TDesC8&			aTrailerHeaders,
       
   235 									TBool					aMoreData
       
   236 									);
       
   237 
       
   238 	/** This represents the S-MethodAbort.req primitive.
       
   239 		@see MWspCOSessionInvoker
       
   240 	*/
       
   241 	//##ModelId=3C4C49CC0161
       
   242 	virtual void MethodAbortReq(MWspCOMethodCallback& aTransactionCallback);
       
   243 
       
   244 	/** This represents the S-MethodResult.res primitive.
       
   245 		@see MWspCOSessionInvoker
       
   246 	*/
       
   247 	//##ModelId=3C4C49CB02BE
       
   248 	virtual void MethodResultRes(
       
   249 								MWspCOMethodCallback&	aTransactionCallback, 
       
   250 								const TDesC8&				aAckHeaders
       
   251 								);
       
   252 
       
   253 	/** This represents the S-MethodResultData.res primitive. 
       
   254 		@see MWspCOSessionInvoker
       
   255 	*/
       
   256 	//##ModelId=3C4C49CB0047
       
   257 	virtual void MethodResultDataRes(
       
   258 									MWspCOMethodCallback&	aTransactionCallback, 
       
   259 									const TDesC8&				aAckHeaders
       
   260 									);
       
   261 
       
   262 
       
   263 private: // methods inherited from MNwssSessionEventHandler,
       
   264 
       
   265 	/** This represents the S-Disconnect.ind primitive.
       
   266 		@see MNwssSessionEventHandler
       
   267 	*/
       
   268 	//##ModelId=3C4C49CA035D
       
   269 	virtual void HandleDisconnectIndL();
       
   270 
       
   271 	/** This represents the S-Suspend.ind primitive.
       
   272 		@see MNwssSessionEventHandler
       
   273 	*/
       
   274 	//##ModelId=3C4C49CA0231
       
   275 	virtual void HandleSuspendIndL();
       
   276 
       
   277 	/** This represents the S-Resume.cnf primitive.
       
   278 		@see MNwssSessionEventHandler
       
   279 	*/
       
   280 	//##ModelId=3C4C49CA0168
       
   281 	virtual void HandleResumeCnfL();
       
   282 
       
   283 	/** This represents the S-Connect.cnf primitive.
       
   284 		@see MNwssSessionEventHandler
       
   285 	*/
       
   286 	//##ModelId=3C4C49CA00AA
       
   287 	virtual void HandleConnectCnfL();
       
   288 
       
   289 	/** This represents the S-Disconnect.ind (redirect) primitive.
       
   290 		@see MNwssSessionEventHandler
       
   291 	*/
       
   292 	//##ModelId=3C4C49C903D4
       
   293 	virtual void HandleRedirectIndL();
       
   294 
       
   295 	/** This represents the E-Exception.ind primitive.
       
   296 		@see MNwssSessionEventHandler
       
   297 	*/
       
   298 	//##ModelId=3C4C49C9031F
       
   299 	virtual void HandleExceptionIndL();
       
   300 
       
   301 private: // methods inherited from MNwssTransactionEventHandler
       
   302 
       
   303 	/** This represents the T-MethodInvoke.cnf primitive.
       
   304 		@see MNwssTransactionEventHandler
       
   305 	*/
       
   306 	//##ModelId=3C4C49C901AD
       
   307 	virtual void HandleMethodInvokeCnfL(RWSPCOTrans::TTransID aTransId);
       
   308 
       
   309 	/** This represents the T-MethodResult.ind primitive.
       
   310 		@see MNwssTransactionEventHandler
       
   311 	*/
       
   312 	//##ModelId=3C4C49C90044
       
   313 	virtual void HandleMethodResultIndL(RWSPCOTrans::TTransID aTransId);
       
   314 
       
   315 	/** This represents the T-MethodAbort.ind primitive.
       
   316 		@see MNwssTransactionEventHandler
       
   317 	*/
       
   318 	//##ModelId=3C4C49C802CE
       
   319 	virtual void HandleAbortIndL(RWSPCOTrans::TTransID aTransId);
       
   320 
       
   321 private: // structure used to hold items sent to the delayed OOM handling for methodabort below
       
   322 
       
   323 	struct TDelayedMethodAbortPckg
       
   324 		{
       
   325 		CNwssWspCOSession* iSession;
       
   326 		MWspCOMethodCallback* iCallback;
       
   327 		TBool iAbortOnStack;
       
   328 		};
       
   329 	//##ModelId=3C9B09540101
       
   330 	void ScheduleDelayedOomMethodAbort(MWspCOMethodCallback& aMethodToAbort, TBool aAbortOnStack);
       
   331 	//##ModelId=3C9B0954001A
       
   332 	static TInt DelayedSendOomMethodAbort(TAny* aPtr);
       
   333 
       
   334 private: // structure used to hold items sent to the delayed OOM handling for disconnect below
       
   335 
       
   336 	struct TDelayedDisconnectPckg
       
   337 		{
       
   338 		CNwssWspCOSession* iSession;
       
   339 		TBool iDisconnectOnStack;
       
   340 		};
       
   341 	//##ModelId=3C9B09530344
       
   342 	void ScheduleDelayedOomDisconnect(TBool aDisconnectOnStack);
       
   343 	//##ModelId=3C9B09530268
       
   344 	static TInt DelayedSendOomDisconnect(TAny* aPtr);
       
   345 
       
   346 private: // methods inherited from MNwssOomHandler
       
   347 
       
   348 /**		Used as an asynchronous callback, in an OOM situation, to cause the method that
       
   349 					couldn't complete at the moment of OOM, to be cleanly aborted for the client.
       
   350 	@param			aMethodToAbort	(in) The method which is to be aborted due to the OOM situation
       
   351 	@param			aAbortOnStack	(in) Flag indicating whether the method must be aborted on the
       
   352 										 WAP stack as well.
       
   353 	@since			7.0
       
   354  */
       
   355 	//##ModelId=3C9B095203C5
       
   356 	virtual void SendOomMethodAbort(MWspCOMethodCallback& aMethodToAbort, TBool aAbortOnStack);
       
   357 
       
   358 /**	Used as an asynchronous callback, in an OOM situation, to cause the method that
       
   359 					couldn't complete at the moment of OOM, to be cleanly aborted for the client.
       
   360 	@param			aTransId		(in) A WAP stack transaction ID that identifies the method which
       
   361 										 is to be aborted due to the OOM situation
       
   362 	@param			aAbortOnStack	(in) Flag indicating whether the method must be aborted on the
       
   363 										 WAP stack as well.
       
   364 	@since			7.0
       
   365  */
       
   366 	//##ModelId=3C9B09530131
       
   367 	virtual void SendOomMethodAbort(RWSPCOTrans::TTransID aTransId, TBool aAbortOnStack);
       
   368 
       
   369 /**		Used as an asynchronous callback, in an OOM situation, to cause the session that
       
   370 					couldn't connect at the moment of OOM, to be cleanly disconnected for the client.
       
   371 	@param			aDisconnectOnStack	(in) Flag indicating whether the session must be disconnected
       
   372 											 on the WAP stack as well.
       
   373 	@since			7.0
       
   374  */
       
   375 	//##ModelId=3C9B095202F2
       
   376 	virtual void SendOomDisconnect(TBool aDisconnectOnStack);
       
   377 
       
   378 private: // methods
       
   379 
       
   380 /** Normal constructor.  Creates an instance of the session, keeping
       
   381 					references to the supplied providers from the client.
       
   382 	@since			7.0
       
   383 	@param			aStringPool			(in) The client's string pool.
       
   384 	@param			aWapStackProvider	(in) An owner of a WAP stack server session.
       
   385 	@param			aConnInfoProvider	(in) A collection of client interfaces that
       
   386 											 provide connection-related information
       
   387 	@param			aSecurityPolicy		(in) A security policy provider.
       
   388 	@param			aSessionCB			(in) The client's callback for receiving
       
   389 											 WSP session events
       
   390  */
       
   391 	//##ModelId=3C4C49C702A4
       
   392 	CNwssWspCOSession(RStringPool& aStringPool,
       
   393 					  MNwssWapServer& aWapStackProvider,
       
   394 				      MConnectionInfoProvider& aConnInfoProvider,
       
   395 					  MSecurityPolicy& aSecurityPolicy,
       
   396 					  MWspCOSessionCallback& aSessionCB);
       
   397 
       
   398 /**	Second phase of construction.  Allocations may be made here.
       
   399 	@since			7.0
       
   400 	@leave			System error codes, e.g. KErrNoMemory.
       
   401  */
       
   402 	//##ModelId=3C4C49C70236
       
   403 	void ConstructL();
       
   404 
       
   405 /** 	Helper to ConnectReq, configures a capability codec to reflect
       
   406 					the capabilities proposed by the client.
       
   407 	@since			7.0
       
   408  */
       
   409 	//##ModelId=3C4C49C701C8
       
   410 	void PrepareClientCapabilities();
       
   411 
       
   412 /**	Helper to HandleConnectCnf, uses the capability codec to return
       
   413 					the capabilities negotiated with the proxy.
       
   414 	@since			7.0
       
   415 	@leave			System error codes, e.g. KErrNoMemory.
       
   416  */
       
   417 	//##ModelId=3C4C49C7015A
       
   418 	void SetNegotiatedCapabilitiesL();
       
   419 
       
   420 /** Helper in the extraction of WSP session data from the NWSS WAP
       
   421 					stack.  Should be used when the data size is known in advance
       
   422 					and may be passed as a buffer like TPckgBuf<TUint> for example.
       
   423 	@warning		It will Panic the client if there is more data available than
       
   424 					the buffer can hold!
       
   425 	@since			7.0
       
   426 	@param			aBuffer		(in) The client's pre-allocated buffer
       
   427 	@param			aType		(in) The type of the session data to be extracted
       
   428 	@return			A WAP stack error code
       
   429  */
       
   430 	//##ModelId=3C4C49C6037F
       
   431 	TInt GetSessionData(TDes8& aBuffer, RWSPCOConn::TSessionDataType aType);
       
   432 
       
   433 /** Helper in the extraction of WSP session data from the NWSS WAP
       
   434 					stack.  This method retrieves all data of a named type,
       
   435 					allocating a heap descriptor large enough to hold it all.
       
   436 					Should be used for data of unknown size.
       
   437 	@since			7.0
       
   438 	@param			aType		(in) The type of the session data to be extracted
       
   439 	@return			A heap-allocated 8-bit buffer to contain the session data. This
       
   440 					buffer is left on the clean-up stack.
       
   441 	@leave			System error codes, e.g. KErrNoMemory
       
   442  */
       
   443 	//##ModelId=3C4C49C6025D
       
   444 	HBufC8* GetAllSessionDataLC(RWSPCOConn::TSessionDataType aType);
       
   445 
       
   446 /**	Helper in the extraction of WSP transaction data from the NWSS
       
   447 					WAP stack.  Should be used when the data size is known in
       
   448 					advance and may be passed as a buffer like TPckgBuf<TUint> for
       
   449 					example.
       
   450 	@warning		It will Panic the client if there is more data available than
       
   451 					the buffer can hold!
       
   452 	@since			7.0
       
   453 	@param			aTransaction(in) The stack transaction handle
       
   454 	@param			aBuffer		(in) The client's pre-allocated buffer
       
   455 	@param			aType		(in) The type of the transaction data to be extracted
       
   456 	@return			A WAP stack error code
       
   457  */
       
   458 	//##ModelId=3C4C49C503CE
       
   459 	TInt GetTransactionData(RWSPCOTrans aTransaction,
       
   460 							TDes8& aBuffer,
       
   461 							RWSPCOTrans::TDataType aType);
       
   462 
       
   463 /** Helper in the extraction of WSP transaction data from the NWSS
       
   464 					WAP stack.  This method retrieves all data of a named type,
       
   465 					allocating a heap descriptor large enough to hold it all.
       
   466 					Should be used for data of unknown size.
       
   467 	@since			7.0
       
   468 	@param			aTransaction(in) The stack transaction handle
       
   469 	@param			aType		(in) The type of the transaction data to be extracted
       
   470 	@return			A heap-allocated 8-bit buffer to contain the transaction data. This
       
   471 					buffer is left on the clean-up stack.
       
   472 	@leave			System error codes, e.g. KErrNoMemory
       
   473  */
       
   474 	//##ModelId=3C4C49C5020B
       
   475 	HBufC8* GetAllTransactionDataLC(RWSPCOTrans aTransaction,
       
   476 									RWSPCOTrans::TDataType aType);
       
   477 
       
   478 /** Utility to convert a buffer received as the 'redirect addresses'
       
   479 					after an S-Disconnect.ind (Redirect) event, into the structure
       
   480 					used in the adaptation API to represent a redirect address. The
       
   481 					address is written into the structure iRedirectAddr.
       
   482 	@since			7.0
       
   483 	@param			aRedirectedAddresses (in) The raw WSP-encoded address data
       
   484 	@leave			System error codes, e.g. KErrNoMemory
       
   485  */
       
   486 	//##ModelId=3C591A9A0027
       
   487 	void ExtractRedirectedProxyInfoL(const TDesC8& aRedirectedAddresses);
       
   488 
       
   489 	//##ModelId=3C9B0952008F
       
   490 	void DoSendDisconnectInd(Wap::TWspReason			aReason, 
       
   491 							  TBool						aRedirectSecurity, 
       
   492 							  TWspRedirectedAddress&	aRedirectAddress, 
       
   493 							  const TDesC8&				aErrorHeader, 
       
   494 							  const TDesC8&				aErrorBody);
       
   495 
       
   496 private: // type definitions
       
   497 
       
   498 	/** An enumeration of the reasons for aborting a transaction. Not all might
       
   499 		might have meaning for both CO and CL WSP sessions.  Note that this type
       
   500 		should be in <wapcli.h> but was omitted there for some reason.
       
   501 	 */
       
   502 	enum TAbortReason 
       
   503 		{
       
   504 		EUnknown = -1,
       
   505 		EWapStackTimeout = 8,
       
   506 		// abort reason code assignments - taken from NWSS source file wps/source/wsp/common/common_dmu,h)
       
   507 		EProtoErr      =  0xe0,
       
   508 		EDisconnect    =  0xe1,
       
   509 		ESuspend       =  0xe2,
       
   510 		EResume        =  0xe3,
       
   511 		ECongestion    =  0xe4,
       
   512 		EConnectErr    =  0xe5,
       
   513 		EMRUExceeded   =  0xe6,
       
   514 		EMORExceeded   =  0xe7,
       
   515 		EPeerReq       =  0xe8,
       
   516 		ENetErr        =  0xe9,
       
   517 		EUserReq       =  0xea
       
   518 		};
       
   519 
       
   520 private: // attributes
       
   521 
       
   522 	/** Connection-oriented WAP Stack session
       
   523 	*/
       
   524 	//##ModelId=3C4C49C50201
       
   525 	RWSPCOConn iWspCOSession;
       
   526 
       
   527 	/** The transaction look-up table
       
   528 	*/
       
   529 	//##ModelId=3C4C49C501ED
       
   530 	CNwssTransLookUpTable* iCOTransTable;
       
   531 
       
   532 	/** The client's callback for session events
       
   533 	*/
       
   534 	//##ModelId=3C4C49C501D9
       
   535 	MWspCOSessionCallback& iSessionCB;
       
   536 
       
   537 	/** A hub to receive events from the WAP stack
       
   538 	*/
       
   539 	//##ModelId=3C4C49C501C5
       
   540 	CNwssWspCOEventDispatcher* iEventDispatcher;
       
   541 
       
   542 	/** A codec for client and server capabilities
       
   543 	*/
       
   544 	//##ModelId=3C4C49C501B1
       
   545 	CCapCodec* iCapabilityCodec;
       
   546 
       
   547 	/** A scratch buffer used for URLs, which must be converted from 8-bit to Unicode
       
   548 		when submitting transactions to the WAP stack
       
   549 	*/
       
   550 	//##ModelId=3C4D9875006F
       
   551 	HBufC* iUriBuffer;
       
   552 
       
   553 	/** A scratch buffer used for retrieving session data
       
   554 	*/
       
   555 	//##ModelId=3C4D9865036F
       
   556 	HBufC8* iSessDataBuffer;
       
   557 
       
   558 	/** The negotiated Method Maximum Outstanding Requests (MOR) value
       
   559 	*/
       
   560 	//##ModelId=3C4D984301D6
       
   561 	TUint8 iMethodMOR;
       
   562 
       
   563 	/** The negotiated 'Use Acknowledgement Headers' protocol option
       
   564 	*/
       
   565 	//##ModelId=3C4D982503C7
       
   566 	TBool iUseAckHdrs;
       
   567 
       
   568 	/** A parsed redirect address
       
   569 	*/
       
   570 	//##ModelId=3C591A9903C9
       
   571 	TWspRedirectedAddress iRedirectAddr;
       
   572 
       
   573 	/** A flag indicating that S-Connect.req has been sent by the client but has
       
   574 		yet to be sent to the WAP Stack.
       
   575 	*/
       
   576 	//##ModelId=3C9B0952007B
       
   577 	TBool	iInConnectLimbo;
       
   578 
       
   579 	/** Object that handles the connect limbo state.
       
   580 	*/
       
   581 	//##ModelId=3C9B09520053
       
   582 	CNwssConnectGuard*	iConnectGuard;
       
   583 
       
   584 	/** Object used to filter transaction events from the NWSS stack and to ensure
       
   585 		that T-MethodAbort.ind events are sent for transactions in EDone state.
       
   586 	*/
       
   587 	//##ModelId=3C9B0952002B
       
   588 	CNwssWspTransactionEventFilter* iTransEventFilter;
       
   589 
       
   590 	/** Object used to filter session events from the NWSS stack to ensure WSP
       
   591 		spec compliance.		
       
   592 	*/
       
   593 	//##ModelId=3C9B0952000D
       
   594 	CNwssWspSessionEventFilter* iSessionEventFilter;
       
   595 
       
   596 	/** Object used to get an asynchronous, one-off callback, in order to break the callstack
       
   597 		from the client when OOM forces us to abort their T-MethodInvoke.req
       
   598 	*/
       
   599 	//##ModelId=3C9B095103CD
       
   600 	CAsyncCallBack* iOOMCallBack;
       
   601 
       
   602 	/** Structure that holds some info needed by the TCallback method that sends a deferred
       
   603 		T-MethodAbort.ind in OOM situations experienced during a T-MethodInvoke.req
       
   604 	*/
       
   605 	//##ModelId=3C9B095103A5
       
   606 	TDelayedMethodAbortPckg iAbortPckg;
       
   607 
       
   608 	/** Structure that holds some info needed by the TCallback method that sends a deferred
       
   609 		S-Disconnect.ind in OOM situations experienced during a S-Disconnect.req
       
   610 	*/
       
   611 	//##ModelId=3C9B09510387
       
   612 	TDelayedDisconnectPckg iDisconnectPckg;
       
   613 	};
       
   614 
       
   615 
       
   616 #endif // __CNWSSWSPCOSESSION_H__