IMPSengine/engsrv/inc/impsserver.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Including CImpsScheduler: WV engine thread scheduler.
       
    15 *              Including CImpsConn: CSP session connections.
       
    16 *              Including CImpsCSPDestroyer : This deletes CSP session entity asynchronously
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CIMPSSERVER_H
       
    21 #define CIMPSSERVER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <s32file.h>
       
    26 #include "impsconst.h"
       
    27 #include "impsservercommon.h"
       
    28 #include "impsservices.h"
       
    29 #include "impsmessageinterpreterapi.h"
       
    30 #include "impsdataaccessorapi.h"
       
    31 #include "impssrvutils.h"
       
    32 #include "impscspsessionapi.h"
       
    33 #include "impscommonenums.h"
       
    34 
       
    35 // DATA TYPES
       
    36 
       
    37 // Server operations (states)
       
    38 enum TImpsSrvOperation
       
    39     {
       
    40     EImpsSrvNone,
       
    41     EImpsSrvShuttingDown,
       
    42     EImpsSrvFinish      // no return back, scheduler will be stopped
       
    43     };
       
    44 
       
    45 // Terminal off-line states
       
    46 enum TImpsSR2TOff
       
    47     {
       
    48     EImpsSR2TOffNone,
       
    49     EImpsSR2TOffStarted
       
    50     };
       
    51 
       
    52 
       
    53 // FORWARD DECLARATIONS
       
    54 class CImpsSession;
       
    55 class CImpsSubSession;
       
    56 class CImpsFields;
       
    57 class CImpsShutdownTimer;
       
    58 class CImpsExpiryTimer;
       
    59 class CImpsVariant;
       
    60 class CImpsOrphans;
       
    61 class CImpsCSPDestroyer;
       
    62 class MImpsCSPSession;
       
    63 class CImpsTOffObserver;
       
    64 
       
    65 // CLASS DECLARATION
       
    66 
       
    67 /**
       
    68 * CImpsScheduler
       
    69 * WV engine thread scheduler.
       
    70 */
       
    71 class CImpsScheduler: public CActiveScheduler
       
    72     {
       
    73     public:  // from base class
       
    74 
       
    75         /**
       
    76         * Error handling that ignores leaves of
       
    77         * active object RunL methods
       
    78         */
       
    79         void Error( TInt anError ) const;
       
    80     };
       
    81 
       
    82 /**
       
    83 *  CSP session connections
       
    84 */
       
    85 class CImpsConn : public CBase
       
    86     {
       
    87     public:
       
    88 
       
    89         /** Two-phased constructor.
       
    90         * @param aSess CSP session entiry
       
    91         * @param aServer server entity
       
    92         * @return CImpsConn
       
    93         */
       
    94         static CImpsConn* CImpsConn::NewL(
       
    95             MImpsCSPSession* aSess, CImpsServer& aServer );
       
    96 
       
    97         /**
       
    98         * Delete the CSP session asynchronously, i.e. this
       
    99         * can be deleted inside transport response.
       
   100         */
       
   101         void DeleteCSPAsynch();
       
   102 
       
   103         /**
       
   104         * Match with a a specific CSP session entity
       
   105         * @param aCSP CSP connection id
       
   106         * @return ETrue if matches
       
   107         */
       
   108         TBool MatchCSP( TImpsSessIdent aCSP );
       
   109 
       
   110         /**
       
   111         * destructors
       
   112         */
       
   113         ~CImpsConn();
       
   114 
       
   115         /**
       
   116         * This deletes related CSP session entity and cancels
       
   117         * peninding asynchrounous deletion if such exists.
       
   118         */
       
   119         void Destroy();
       
   120 
       
   121         /**
       
   122         * Session accesor
       
   123         * @return CSP session entity
       
   124         */
       
   125         MImpsCSPSession* Sess();
       
   126 
       
   127     private:  // methods
       
   128 
       
   129         /**
       
   130         * contructor
       
   131         * @param aServer server entity
       
   132         */
       
   133         void ConstructL( CImpsServer& aServer );
       
   134 
       
   135         /**
       
   136         * contructor
       
   137         * @param aSess CSP session entity
       
   138         * @param aTimer delay timer for delayed off-line events
       
   139         */
       
   140         CImpsConn( MImpsCSPSession* aSess );
       
   141 
       
   142     private:  // data
       
   143         MImpsCSPSession*    iSess;
       
   144         CImpsCSPDestroyer*  iRemover;
       
   145     public:
       
   146         TDblQueLink         iLink;          //lint !e1925
       
   147     };
       
   148 
       
   149 
       
   150 /**
       
   151 * CImpsCSPDestroyer
       
   152 * This deletes CSP session entity asynchronously
       
   153 */
       
   154 class CImpsCSPDestroyer: public CActive
       
   155     {
       
   156     public:
       
   157         /**
       
   158         * Constructor
       
   159         * @param aServer WV engine server
       
   160         * @param aSess CSP session entity
       
   161         * @param aPriority active object priority
       
   162         */
       
   163         CImpsCSPDestroyer(
       
   164             CImpsServer& aServer,
       
   165             MImpsCSPSession& aSess,
       
   166             TInt aPriority );
       
   167 
       
   168         /**
       
   169         * Destructor
       
   170         */
       
   171         virtual ~CImpsCSPDestroyer();
       
   172 
       
   173         /**
       
   174         * Start deletion.
       
   175         */
       
   176         void DeleteCSPAsynch();
       
   177 
       
   178     protected:
       
   179         // From base class
       
   180         void RunL();
       
   181         void DoCancel();
       
   182     private:
       
   183         CImpsServer&        iServer;
       
   184         MImpsCSPSession&    iSess;
       
   185         TBool               iCanceled;
       
   186 
       
   187     };
       
   188 
       
   189 /**
       
   190 *  CImpsServer.
       
   191 *  The core of the whole WV engine.
       
   192 */
       
   193 
       
   194 class CImpsServer : public CPolicyServer
       
   195 
       
   196     {
       
   197     public:  // Constructors and destructor
       
   198 
       
   199         /**
       
   200         * constructs and starts the server.
       
   201         */
       
   202         static CImpsServer* New();
       
   203 
       
   204         /**
       
   205         * Destructor.
       
   206         */
       
   207         virtual ~CImpsServer();
       
   208 
       
   209     public: // New functions
       
   210 
       
   211         /**
       
   212         * Memory allocations. Called by a thread start function!
       
   213         */
       
   214         void ConstructL();
       
   215 
       
   216         /**
       
   217         * Deletes this session's first buffered event from the list and sends the next
       
   218         * one if there are any waiting.
       
   219         *
       
   220         * @param aSession the session concerned
       
   221         *
       
   222         */
       
   223         void NextEvent( CImpsSession* aSession );
       
   224 
       
   225         /**
       
   226         * Close client-server session.
       
   227         * Cancel transport and start idle timer if there is only one session.
       
   228         * @param aCSP CSP connection id
       
   229         * @param aComplete TRUE is session entity creation is complete
       
   230         */
       
   231         void CloseSession( TImpsSessIdent aCSP, TBool aComplete );
       
   232 
       
   233         /**
       
   234         * Stop the engine right now
       
   235         */
       
   236         void DoShutDown();
       
   237 
       
   238         /**
       
   239         * Server bootstrap code.
       
   240         *
       
   241         * @param aSignal signal that's used to inform the client thread when the server
       
   242         *                is up.
       
   243         *
       
   244         */
       
   245         IMPORT_C static TInt ThreadStart( TImpsSignal& aSignal );
       
   246 
       
   247         /**
       
   248         * Login WV server
       
   249         * @param aUser User-id  (max 50 characters)
       
   250         * @param aPsw password  (max 50 characters)
       
   251         * @param aClientId client id used to log in server.
       
   252         *        The client-id having prefix '+' or number is considered
       
   253         *        as MSISDN number (E.164),
       
   254         *        otherwise it is handled as URL (max 200 character).
       
   255         *        This MAY be used for CIR addressing if SAP is not able to
       
   256         *        detect MSISDN number in other way
       
   257         * @param aServer SAP URI, may include port number
       
   258         * @param aAP CommDb id for access point
       
   259         * @param aAnyAP ETrue if any other open access point is accepted
       
   260         * @param aKey1 future option
       
   261         * @param aKey2 future option
       
   262         * @param aSub requesting subsession
       
   263         * @param aLoginExpiry epiry time of login request
       
   264         * @param aReactive reactive presence auth negotiation
       
   265         * @return TID
       
   266         */
       
   267         TPtrC LoginL(
       
   268             const TDesC& aUser,
       
   269             const TDesC& aPassword,
       
   270             const TDesC& aClientId,
       
   271             const TDesC& aSAP,
       
   272             TUint32 aAP,
       
   273             const TDesC& aKey1,
       
   274             const TDesC& aKey2,
       
   275             CImpsSubSession* aSub,
       
   276             const TTime aLoginExpiry,
       
   277             TBool aReactive );
       
   278 
       
   279         /**
       
   280         * Logout SAP
       
   281         * @param aCancel ETrue if login cancel functionaliy wanted
       
   282         * @param aCSP CSP connection id
       
   283         * @return TID
       
   284         */
       
   285         TPtrC LogoutL(
       
   286             TBool aCancel,
       
   287             TImpsSessIdent aCSP );
       
   288 
       
   289         /**
       
   290         * CIR message handler
       
   291         * @param aCookie entire session cookie message
       
   292         */
       
   293         void CirMessageL(
       
   294             const TDesC8& aCookie );
       
   295 
       
   296         /**
       
   297         * Send data from session current data to WV server.
       
   298         * Login must have been done.
       
   299         * @param aSession requestion client session
       
   300         * @param aCSP CSP connection id
       
   301         * @return transaction-id
       
   302         */
       
   303         TPtrC SendDataL(
       
   304             CImpsSubSession* aSession,
       
   305             TImpsSessIdent aCSP
       
   306         );
       
   307 
       
   308         /**
       
   309         * Get number of client sessions
       
   310         * @param aIgnoreCIR ETrue if CIR watcher session is ignored
       
   311         * @return number of sessions
       
   312         */
       
   313         TInt NbrSessions( TBool aIgnoreCIR );
       
   314 
       
   315         /**
       
   316         * Get number of client sessions for the specified CSP connection
       
   317         * @param aIgnoreCIR ETrue if CIR watcher session is ignored
       
   318         * @param aCSP CSP connection id
       
   319         * @return number of sessions
       
   320         */
       
   321         TInt NbrSessions( TBool aIgnoreCIR, TImpsSessIdent aCSP );
       
   322 
       
   323         /**
       
   324         * Stop the idle timer
       
   325         */
       
   326         void StopTimer() const;
       
   327 
       
   328         /**
       
   329         * Is the CSP session logged in
       
   330         * @param aCSP CSP connection id. If all values are zero length then
       
   331         * check if any session is logged in
       
   332         * @param password, OUTPUT, optional
       
   333         * @return ETrue if logged in
       
   334         */
       
   335         TBool IsLogged( TImpsSessIdent aCSP, TPtrC* aPsw );
       
   336 
       
   337         /**
       
   338         * CSP session-id accessor
       
   339         * @param aCSP CSP connection id. If all values are zero length then
       
   340         * check if any session is logged in
       
   341         * @return CSP session-id
       
   342         */
       
   343         TPtrC SID( TImpsSessIdent aCSP );
       
   344 
       
   345         /**
       
   346         * Is the CSP session capabilities negotiated
       
   347         * @param aCSP CSP connection id
       
   348         * @return ETrue if negotiated
       
   349         */
       
   350         TBool IsNegotiated( TImpsSessIdent aCSP );
       
   351 
       
   352         /**
       
   353         * Transport status change indicator
       
   354         * @param aConnectionState  new status, on_line, off_line or no_iap
       
   355         */
       
   356         void TransportStatus( EImpsInternalStatus aConnectionState,
       
   357                               MImpsCSPSession* aSess );
       
   358 
       
   359         /**
       
   360         * Active services accessor
       
   361         * @param aCSP CSP connection id
       
   362         * @return current WV services
       
   363         */
       
   364         TImpsServices* Services( TImpsSessIdent aCSP );
       
   365 
       
   366         /**
       
   367         * Is there pendig login operation
       
   368         * @param aCSP CSP connection id
       
   369         * @return ETrue if yes
       
   370         */
       
   371         TBool IsPendingLogin( TImpsSessIdent aCSP );
       
   372 
       
   373         /**
       
   374         * Generate expiry time
       
   375         * @param aMsgType WV message primitive
       
   376         * @return expiry time
       
   377         */
       
   378         TTime ExpiryTime( TImpsMessageType aMsgType );
       
   379 
       
   380         /**
       
   381         * Generate expiry time
       
   382         * @param aSrv WV service type
       
   383         * @return expiry time
       
   384         */
       
   385         TTime ExpiryTime( TImpsEventType aSrv );
       
   386 
       
   387         /**
       
   388         * Generate expiry time
       
   389         * @param aExpiry expiry time in seconds
       
   390         * @return expiry time
       
   391         */
       
   392         TTime ExpiryTime( TInt aExpiry );
       
   393 
       
   394         /**
       
   395         * Default Expiry time accessor
       
   396         * @param aSrv WV service type
       
   397         * @return expiry time in seconds
       
   398         */
       
   399         TInt ExpirySeconds( TImpsEventType aSrv );
       
   400 
       
   401         /**
       
   402         * check expired messages
       
   403         * @param aType WV service type
       
   404         */
       
   405         void CheckExpiryL( TImpsEventType aType );
       
   406 
       
   407         /**
       
   408         * check expired messages
       
   409         * @param aType WV service type
       
   410         */
       
   411         void CheckExpiryL( TImpsEventType aType, TTime aExpiry );
       
   412 
       
   413         /**
       
   414         * Cancel a transaction.
       
   415         * Removes request from server's transaction queue and
       
   416         * asks transport to cancel the request too.
       
   417         * @param aTID transaction id to identify the request.
       
   418         * @param aCSP CSP session id
       
   419         */
       
   420         void CancelTrans( const TDesC& aTID, TImpsSessIdent aCSP );
       
   421 
       
   422         /**
       
   423         * Cancel a transaction.
       
   424         * Removes request from server's transaction queue and
       
   425         * asks transport to cancel the request too.
       
   426         * @param aTID transaction id to identify the request.
       
   427         * @param aSess CSP session entity
       
   428         */
       
   429         void CancelTrans( const TDesC& aTID, MImpsCSPSession* aSess );
       
   430 
       
   431         /**
       
   432         * Do the logout routines
       
   433         * @param aOpId operation id, KImpsNullId means SAP initiated logout
       
   434         * @param aCSPDis if CSP session really disconnected (existed)
       
   435         */
       
   436         void DoLogoutSrv( TInt aOpId, TBool aCSPDis,
       
   437                           MImpsCSPSession* aSess );
       
   438 
       
   439         /**
       
   440         * Create container
       
   441         * @return container
       
   442         */
       
   443         CObjectCon* NewContainerL();
       
   444 
       
   445         /**
       
   446         * Remove container
       
   447         * @param aCon container
       
   448         */
       
   449         void RemoveContainer( CObjectCon* aCon );
       
   450 
       
   451         /**
       
   452         * Maximum transaction content
       
   453         * @return max size for WV message
       
   454         */
       
   455         TInt BufferSize();
       
   456 
       
   457         /**
       
   458         * Receive terminal off_line/on_line indication
       
   459         * @param aParam True if connections allowed, else False.
       
   460         */
       
   461         void SetConnAllowed( TBool aParam );
       
   462 
       
   463         /**
       
   464         * Decodes accessor
       
   465         * Subsession needs this to build XML-formatted response
       
   466         * @return Message decoder
       
   467         */
       
   468         inline MImpsDecoder& Decoder() const;
       
   469 
       
   470         /**
       
   471         * iConnAllowed accessor
       
   472         * @retuns ETrue if connection allowed and terminal is not OFF-LINE
       
   473         */
       
   474         inline TBool IsConAllowed() const;
       
   475 
       
   476         /**
       
   477         * Discard a request from a session
       
   478         * @param aTid transaction-id to be discarded
       
   479         * @param aType event type (service type)
       
   480         * @param aCode an error code to a client request
       
   481         * @param aCSP CSP session id
       
   482         */
       
   483         void DiscardRequest(
       
   484             const TDesC& aTid,
       
   485             TImpsEventType aType,
       
   486             TInt aCode,
       
   487             TImpsSessIdent aCSP );
       
   488 
       
   489         /**
       
   490         * Discard a request from a session
       
   491         * @param aType event type (service type)
       
   492         * @param aExpiry request expiration time
       
   493         * @param aCSP CSP session id
       
   494         * @param aSess CSP session entity
       
   495         */
       
   496         void DiscardRequests(
       
   497             TImpsEventType aType,
       
   498             TTime aExpiry,
       
   499             TImpsSessIdent aCSP,
       
   500             MImpsCSPSession* aSess );
       
   501 
       
   502         /**
       
   503         * Discard all requests from a session
       
   504         * @param aType event type (service type)
       
   505         * @param aError error code to be sent
       
   506         * @param aCSP CSP session id
       
   507         * @param aSess CSP session entity
       
   508         */
       
   509         void DiscardRequests(
       
   510             TImpsEventType aType,
       
   511             TInt aError,
       
   512             TImpsSessIdent aCSP,
       
   513             MImpsCSPSession* aSess );
       
   514 
       
   515         /**
       
   516         * Discard Logout request that actually sends logout events to clients
       
   517         * @param aTID transaction-id
       
   518         * @param aCSP CSP session id
       
   519         */
       
   520         void DiscardLogout(
       
   521             const TDesC& aTID,
       
   522             TImpsSessIdent aCSP );
       
   523 
       
   524         /**
       
   525         * Make and send simple error event to certain type of sessions
       
   526         * @param aType session event type
       
   527         * @param aCode error code
       
   528         * @param aOpId operation-id
       
   529         * @param aCSP CSP session id
       
   530         */
       
   531         void SendErrorEvent(
       
   532             TImpsEventType aType,
       
   533             TInt aCode,
       
   534             TInt aOpId,
       
   535             TImpsSessIdent aCSP );
       
   536 
       
   537         /**
       
   538         * Send online status change events to clients
       
   539         * @param aStatus new engine status
       
   540         * @param aCSP CSP session id
       
   541         */
       
   542         void SendStatusEvents(
       
   543             EImpsInternalStatus aStatus,
       
   544             TImpsSessIdent aCSP );
       
   545 
       
   546         /**
       
   547         * Handle notification orders for incoming message.
       
   548         * Create corresponding events
       
   549         * @param aFields response message
       
   550         * @param aCSP CSP session id
       
   551         * @return True if matching subsession is found.
       
   552         * (client-id and media type ok)
       
   553         */
       
   554         TBool CheckNotifications(
       
   555             CImpsFields* aFields,
       
   556             TImpsSessIdent aCSP );
       
   557 
       
   558         /**
       
   559         * Handles pending requests for the incoming message
       
   560         * @param aFields response message
       
   561         * @param aFound OUT: true if found request
       
   562         * @param aCSP CSP session id
       
   563         * @return error code
       
   564         */
       
   565         void CheckRequestsL(
       
   566             CImpsFields* aFields,
       
   567             TBool& aFound,
       
   568             TImpsSessIdent aCSP );
       
   569 
       
   570         /**
       
   571         * Handle orphan message
       
   572         * @param aFields msg, CImpsServer takes the ownership of this msg.
       
   573         * @param aCSP CSP session id
       
   574         */
       
   575         void HandleOrphanL( CImpsFields* aFields, TImpsSessIdent aCSP );
       
   576 
       
   577         /**
       
   578         * Get next orphan message for the subsession
       
   579         * @param aCID client-id
       
   580         * @param aServiceType the type of the client which requests the message
       
   581         * @param aCSP CSP session id
       
   582         * @return new message, NULL if no match. Ownership of the msg is
       
   583         * passed to the caller of this method.
       
   584         */
       
   585         CImpsFields* NextOrphanLC(
       
   586             const TDesC& aCID,
       
   587             TImpsEventType aServiceType,
       
   588             TImpsSessIdent aCSP );
       
   589 
       
   590         /**
       
   591         * Check all orphans messages and send them to clients.
       
   592         * This is called when a client session starts to share
       
   593         * an existing CSP session.
       
   594         */
       
   595         void HandleAllOrphans();
       
   596 
       
   597         /**
       
   598         * Get matching CSP session entity
       
   599         * @param aCSP CSP connection id
       
   600         * @param aAll sessions shutting down are returned too
       
   601         * @returm matching CSP session or NULL
       
   602         */
       
   603         MImpsCSPSession* GetCSP( TImpsSessIdent aCSP,
       
   604                                  TBool aAll );
       
   605 
       
   606         /**
       
   607         * Create CSP session entity
       
   608         * @param aCSP CSP connection id
       
   609         * @param aVer CSP version
       
   610         * @returm CSP session
       
   611         */
       
   612         MImpsCSPSession* NewCSPL( TImpsSessIdent aCSP, TImpsCspVersion aVer );
       
   613 
       
   614         /**
       
   615         * Delete CSP session entity
       
   616         * @param aSess CSP session entity
       
   617         */
       
   618         void DeleteCSP( MImpsCSPSession* aSess );
       
   619 
       
   620         /**
       
   621         * CSP session entity counter
       
   622         * @return number of CSP sessions
       
   623         */
       
   624         TInt NbrCSPs();
       
   625 
       
   626         /**
       
   627         * CSP session id seed to generate unique ids across CSP sessions
       
   628         */
       
   629         TInt TidSeed();
       
   630 
       
   631         /**
       
   632         * Close all CSP sessions immediately and go to SHUTTING_DOWN state
       
   633         */
       
   634         void LogoutAll();
       
   635 
       
   636         /**
       
   637         * CSP version
       
   638         */
       
   639         inline TImpsCspVersion CspVersion();
       
   640 
       
   641         /**
       
   642         * Is shutting down?
       
   643         * @return ETrue if state is SHUTTING_DOWN
       
   644         */
       
   645         inline TBool IsShuttingDown();
       
   646 
       
   647         /**
       
   648         * Current settings accessor
       
   649         * @return current variant settings
       
   650         */
       
   651         inline const TImpsSrvSettings* Settings() const;
       
   652 
       
   653         /**
       
   654         * Reset expiry timer if needed
       
   655         * The time may decrease only
       
   656         * @param aSeconds subsession expiry time in seconds. 0 means undefined and default values are used.
       
   657         * @param aInit set this in login so that timer is started first time.
       
   658         */
       
   659         void SetExpiryTimer( TInt aSeconds, TBool aInit );
       
   660 
       
   661         /**
       
   662         * Reset expiry timer if needed
       
   663         * The time may increase only when a subsession is closed
       
   664         * @param aSeconds subsession expiry time in seconds. 0 means undefined value.
       
   665         */
       
   666         void ResetExpiryTimer( TInt aSeconds );
       
   667 
       
   668 
       
   669     public:  // Functions from base classes
       
   670 
       
   671         /**
       
   672         * Opens a new session to the server.
       
   673         *
       
   674         * @param aVersion required version of the server.
       
   675         * @param aMessage client request
       
   676         * @return pointer to a new session
       
   677         *
       
   678         * Leaves if:
       
   679         * - Required version not supported (KErrNotSupported)
       
   680         * - In very rare case when engine is going down (KErrNotReady)
       
   681         */
       
   682         CSession2* NewSessionL( const TVersion& aVersion, const RMessage2& aMessage ) const;
       
   683 
       
   684     protected:  // Functions from base classes
       
   685 
       
   686         /**
       
   687         * C++ default constructor.
       
   688         */
       
   689         CImpsServer();
       
   690 
       
   691     private: // Functions from base classes
       
   692 
       
   693 
       
   694         // From CPolicyServer
       
   695         CPolicyServer::TCustomResult CustomSecurityCheckL(
       
   696             const RMessage2& aMsg, TInt& aAction, TSecurityInfo& aMissing );
       
   697 
       
   698 
       
   699         void GetCSPVersion();
       
   700 
       
   701     private:
       
   702 
       
   703         // By default, prohibit copy constructor
       
   704         CImpsServer( const CImpsServer& );
       
   705         // Prohibit assigment operator
       
   706         CImpsServer& operator= ( const CImpsServer& );
       
   707 
       
   708         /**
       
   709         * Send extra events to HandleLogoutL methods to clients
       
   710         * @param aSub subsession to be ignored
       
   711         *        IF NULL the all subsessions handled
       
   712         * @param aOpId operation-id, -1 means SAP initiated disconnect
       
   713          * @param aCSP CSP connection id
       
   714         */
       
   715         void SendLogoutEvents( CImpsSubSession* aSub,
       
   716                                TInt aOpId, TImpsSessIdent aCSP );
       
   717 
       
   718         /**
       
   719         * Transport status change indicator
       
   720         * @param aConnectionState new status, on_line, off_line or no_iap
       
   721         * @param aSess CSP session entity
       
   722         */
       
   723         void DoTransportStatusL( EImpsInternalStatus aConnectionState,
       
   724                                  MImpsCSPSession* aSess );
       
   725 
       
   726         /**
       
   727         * Do the logout routines
       
   728         * @param aSub requesting subsession, logout event ignored for this
       
   729         * @param aOpId operation id, KImpsNullId means SAP initiated logout
       
   730         * @param aCSPDis true if CSP really disconnected
       
   731         * @param aCSP CSP connection id
       
   732         */
       
   733         void DoLogoutNow(
       
   734             CImpsSubSession* aSub,
       
   735             TInt aOpId,
       
   736             TBool aCSPDis,
       
   737             TImpsSessIdent aCSP );
       
   738 
       
   739         /**
       
   740         * Close all CSP session emtities
       
   741         * @param aCSP CSP connection id
       
   742         */
       
   743         void CloseAllCSPs();
       
   744 
       
   745         /**
       
   746         * Start to delete CSP session entity asynchronously
       
   747         * @param aSess CSP session entity
       
   748         */
       
   749         void DeleteCSPAsynch( MImpsCSPSession* aSess );
       
   750 
       
   751     public:     // Data
       
   752 
       
   753     protected:  // Data
       
   754 
       
   755     private:    // Data
       
   756         CObjectConIx*       iContainerIndex;
       
   757         RFs                 iFs;
       
   758 
       
   759         CImpsFields*        iSnd;        // internal data structure
       
   760 
       
   761         CImpsShutdownTimer* iShutTimer;
       
   762         CImpsExpiryTimer*   iExpiryTimer;
       
   763 
       
   764         TImpsSrvSettings    iSettings;
       
   765 
       
   766         CImpsVariant*       iVariant;
       
   767         TBool               iConAllowed;    // Is network connections allowed
       
   768 
       
   769         TImpsCspVersion     iCSPVersion;
       
   770         TImpsSrvOperation   iOperation;
       
   771 
       
   772         CImpsOrphans*       iOrphans;
       
   773         TDblQue<CImpsConn>  iCSPList;
       
   774 
       
   775         TInt                iSeed;
       
   776         CImpsTOffObserver*  iObserver;
       
   777         TInt                iExpiryInterval; // current expiry times value
       
   778     };
       
   779 
       
   780 #ifdef __WINS__
       
   781 EXPORT_C TInt ThreadFunction( TAny* aThreadParams );
       
   782 #endif
       
   783 
       
   784 #include "ImpsServer.inl"
       
   785 
       
   786 #endif      // ?INCLUDE_H   
       
   787 
       
   788 // End of File