wim/WimServer/inc/WimSession.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Represents a session for a client thread on the server-side.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CWIMSESSION_H
       
    19 #define CWIMSESSION_H
       
    20 
       
    21 #include "WimClsv.h"
       
    22 #include "WimTimer.h"
       
    23 #include "Wimi.h"            //WIMI definitions
       
    24 
       
    25 // FORWARD DECLARATION
       
    26 class CWimServer;
       
    27 class CWimCertHandler;
       
    28 class CWimAuthObjHandler;
       
    29 class CWimTokenHandler;
       
    30 class CWimKeyMgmtHandler;
       
    31 class CWimSignTextHandler;
       
    32 class CWimMemMgmt;
       
    33 class CWimUtilityFuncs;
       
    34 class CWimUtilityFuncs;
       
    35 class CWimOmaProvisioning;
       
    36 class CWimJavaProvisioning;
       
    37 class CWimTrustSettingsHandler;
       
    38 
       
    39 /**
       
    40 *  A session acts as a channel of communication between the client and
       
    41 *  the server.
       
    42 *  A client thread can have multiple concurrent sessions with a server.
       
    43 *
       
    44 *  @since Series60 2.1
       
    45 */
       
    46 class CWimSession : public CSession2, public MWimTimerListener
       
    47     {
       
    48 
       
    49     public:  // Constructors and destructor
       
    50 
       
    51         /**
       
    52         * Two-phased constructor.
       
    53         */
       
    54         static CWimSession* NewL( CWimServer* aWimServer );
       
    55 
       
    56         /**
       
    57         * Destructor.
       
    58         */
       
    59         virtual ~CWimSession();
       
    60 
       
    61     public: // New functions
       
    62 
       
    63         /**
       
    64         * Handles the servicing of client requests to the server.
       
    65         * @param    aMessage Encapsulates a client request.
       
    66         * @return   void
       
    67         */
       
    68         virtual void ServiceL( const RMessage2& aMessage );
       
    69 
       
    70         /**
       
    71         * Complete NotifyOnRemoval message, meaning that card is removed.
       
    72         * @return   void
       
    73         */
       
    74         void NotifyComplete();
       
    75 
       
    76     private:
       
    77 
       
    78         /**
       
    79         * C++ default constructor.
       
    80         */
       
    81         CWimSession();
       
    82 
       
    83         /**
       
    84         * By default Symbian 2nd phase constructor is private.
       
    85         */
       
    86         void ConstructL( CWimServer* aWimServer );
       
    87 
       
    88         /**
       
    89         * Handles client requests and forwards
       
    90         * them to appropriate handler class.
       
    91         * @param    aMessage Encapsulates a client request.
       
    92         * @return   void
       
    93         */
       
    94         void DispatchMessageL( const RMessage2& aMessage );
       
    95 
       
    96         /**
       
    97         * Fetches the list of the references of WIMs currently associated
       
    98         * with readers.
       
    99         * @return   void
       
   100         */
       
   101         void GetWimRefListL();
       
   102 
       
   103         /**
       
   104         * Fetches the count of WIM cards in use.
       
   105         * @return   void
       
   106         */
       
   107         void GetWimCountL();
       
   108 
       
   109         /**
       
   110         * Timer for closing connection to the WIM card.
       
   111         * @return   void
       
   112         */
       
   113         void TimerExpired();
       
   114 
       
   115         /**
       
   116         * NotifyOnRemoval message received. Store the message for completing.
       
   117         * @return   void
       
   118         */
       
   119         void NotifyOnRemovalL();
       
   120 
       
   121         /**
       
   122         * Cancel NotifyOnRemoval. Complete notification message with KErrCancel.
       
   123         * @return   void
       
   124         */
       
   125         void CancelNotifyOnRemoval();
       
   126 
       
   127         /**
       
   128         * Check if current request accesses HW.
       
   129         * @param	TInt	Request ID
       
   130         * @return   TBool
       
   131         */
       
   132         TBool RequestAccessesHW( TInt aFunction );
       
   133 
       
   134         /**
       
   135         * Re-initializes WIMlib.
       
   136         * Executed when card data has been changed.
       
   137         * @return   void
       
   138         */
       
   139         void RefreshWimi();
       
   140 
       
   141     private:    // Data
       
   142         // total number of resources allocated
       
   143         TInt                      iResourceCount;
       
   144         // Pointer to the server. Not owned.
       
   145         CWimServer*               iWimSvr;
       
   146         // Pointer for memory management. Owned.
       
   147         CWimMemMgmt*              iWimMgmt;
       
   148         // Pointer to timer. Owned.
       
   149         //CWimTimer*                iTimer;
       
   150         // Certificate Handler class pointer. Owned.
       
   151         CWimCertHandler*          iWimCertHandler;
       
   152         // Authentication Object Handler class pointer. Owned.
       
   153         CWimAuthObjHandler*       iWimAuthObjHandler;
       
   154         // Token Handler class pointer. Owned.
       
   155         CWimTokenHandler*         iWimTokenHandler;
       
   156         // Key Management Handler class pointer. Owned.
       
   157         CWimKeyMgmtHandler*       iWimKeyMgmtHandler;
       
   158         // Pointer to Sign Text handler. Owned.
       
   159         CWimSignTextHandler*      iWimSignTextHandler;
       
   160         // Utility functions. Owned.
       
   161         CWimUtilityFuncs*         iWimUtilFuncs;
       
   162         // Pointer to OMA Provisioning class. Owned.
       
   163         CWimOmaProvisioning*      iWimOmaProvisioning;
       
   164         
       
   165         CWimJavaProvisioning*     iWimJavaProvisioning;
       
   166         // Pointer to WimTrustSettingsHandler. Owned.
       
   167         CWimTrustSettingsHandler* iWimTrustSettingsHandler;
       
   168         // NotifyOnRemoval Message, to be completed. Owned.
       
   169         RMessage2*                iNotifyMessage;
       
   170         // Message to be server. Owned.
       
   171         RMessage2*                iMessage;
       
   172     };
       
   173 
       
   174 #endif      // CWIMSESSION_H
       
   175 
       
   176 // End of File