vpnengine/vpnmanager/inc/vpnmanagersession.h
changeset 0 33413c0669b9
child 2 ef893827b4d1
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2003 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: Handles client requests.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __VPNMANAGERSESSION_H__
       
    21 #define __VPNMANAGERSESSION_H__
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 class CVpnManagerServer;
       
    26 class CRequestDispatcher;
       
    27    
       
    28 /** 
       
    29  * A handler for the service requests received from clients.
       
    30  * An instance of class CVpnManagerSession is created for each client.
       
    31  */
       
    32 class CVpnManagerSession : public CSession2
       
    33     {
       
    34 public:
       
    35     /**
       
    36      * Creates a CVpnManagerSession object using two phase construction,
       
    37      * and returns a pointer to the created object
       
    38      *
       
    39      * @param Client's thread
       
    40      * @param The server
       
    41      *
       
    42      * @result Pointer to the new session
       
    43      */
       
    44     static CVpnManagerSession* NewL(CVpnManagerServer& aServer,
       
    45                                     CRequestDispatcher& aRequestDispatcher);
       
    46     /**
       
    47      * Creates a CVpnManagerSession object using two phase construction,
       
    48      * and returns a pointer to the created object
       
    49      * (leaving a pointer to the object on the cleanup stack)
       
    50      *
       
    51      * @param Client's thread
       
    52      * @param The server
       
    53      *
       
    54      * @result Pointer to the new session
       
    55      */
       
    56     static CVpnManagerSession* NewLC(CVpnManagerServer& aServer,
       
    57                                      CRequestDispatcher& aRequestDispatcher);
       
    58 
       
    59 	/**
       
    60      * Destroy the object and release all memory objects
       
    61      */
       
    62     ~CVpnManagerSession();
       
    63 
       
    64 public: // from CSession
       
    65     /**
       
    66      * Service request from client
       
    67      * 
       
    68      * @param Message from client (containing requested operation and any data)
       
    69      */
       
    70     void ServiceL(const RMessage2& aMessage);
       
    71 
       
    72 private: // New methods
       
    73 
       
    74     /**
       
    75      * The first phase of two phase construction
       
    76      * 
       
    77      * @param Client's thread
       
    78      * @param The server
       
    79      */
       
    80     CVpnManagerSession(CVpnManagerServer& aServer,
       
    81                        CRequestDispatcher& aRequestDispatcher);
       
    82 
       
    83     /**
       
    84      * The second phase of two phase construction
       
    85      */
       
    86     void ConstructL() ;
       
    87 
       
    88 private:
       
    89     RMessage2               iMessage;
       
    90     CVpnManagerServer&      iServer;
       
    91     CRequestDispatcher&     iRequestDispatcher;    
       
    92     };
       
    93 
       
    94 #endif // __VPNMANAGERSESSION_H__