PECengine/PresenceManager2/SrcReactAuth/CPEngReactAuthStoreImp.cpp
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Reactive authorization store API implementation owner.
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include "CPEngReactAuthStoreImp.h"
       
    20 #include "CPEngNWSessionSlotID2Imp.h"
       
    21 #include "CPEngSessionSlotId.h"
       
    22 #include "CPEngNWSessionSlotStorageProxy.h"
       
    23 #include "PEngListLibraryFactory.h"
       
    24 #include "MPEngAuthorizationManager.h"
       
    25 #include "CPEngAuthorizationRespond.h"
       
    26 
       
    27 
       
    28 #include <CPEngNWSessionSlotID2.h>
       
    29 
       
    30 
       
    31 
       
    32 // ============================ MEMBER FUNCTIONS ===============================
       
    33 
       
    34 
       
    35 // -----------------------------------------------------------------------------
       
    36 // CPEngReactAuthStoreImp::NewL()
       
    37 // Two-phased constructor.
       
    38 // -----------------------------------------------------------------------------
       
    39 //
       
    40 CPEngReactAuthStoreImp* CPEngReactAuthStoreImp::NewL(
       
    41     const CPEngNWSessionSlotID2& aNWSessionSlotID,
       
    42     TInt aPriority )
       
    43     {
       
    44     CPEngReactAuthStoreImp* self =
       
    45         new ( ELeave ) CPEngReactAuthStoreImp( aPriority );
       
    46     CleanupStack::PushL( self );
       
    47     self->ConstructL( aNWSessionSlotID );
       
    48     CleanupStack::Pop( self );
       
    49     return self;
       
    50     }
       
    51 
       
    52 
       
    53 
       
    54 // Destructor
       
    55 CPEngReactAuthStoreImp::~CPEngReactAuthStoreImp()
       
    56     {
       
    57     delete iUsedSlot;
       
    58     if ( iAuthManager )
       
    59         {
       
    60         iAuthManager->Close();
       
    61         }
       
    62     }
       
    63 
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // CPEngReactAuthStoreImp::CPEngReactAuthStoreImp
       
    67 // C++ default constructor can NOT contain any code, that
       
    68 // might leave.
       
    69 // -----------------------------------------------------------------------------
       
    70 //
       
    71 CPEngReactAuthStoreImp::CPEngReactAuthStoreImp( TInt aPriority )
       
    72         : iCActivePriority( aPriority )
       
    73     {
       
    74     }
       
    75 
       
    76 
       
    77 // -----------------------------------------------------------------------------
       
    78 // CPEngReactAuthStoreImp::ConstructL()
       
    79 // -----------------------------------------------------------------------------
       
    80 //
       
    81 void CPEngReactAuthStoreImp::ConstructL( const CPEngNWSessionSlotID2& aNWSessionSlotID )
       
    82     {
       
    83     iUsedSlot = CPEngNWSessionSlotStorageProxy::NewL( aNWSessionSlotID );
       
    84     iAuthManager = PEngListLibraryFactory::AuthorizationManagerL( iUsedSlot->BaseId() );
       
    85     }
       
    86 
       
    87 
       
    88 // -----------------------------------------------------------------------------
       
    89 // CPEngReactAuthStoreImp::GetAndLockAuthorizationRespondL()
       
    90 // -----------------------------------------------------------------------------
       
    91 //
       
    92 void CPEngReactAuthStoreImp::GetAndLockAuthorizationRespondL(
       
    93     MPEngAuthorizationRespond*& aRespond )
       
    94     {
       
    95     CPEngAuthorizationRespond* respond = CPEngAuthorizationRespond::NewLC();
       
    96     MPEngAuthorizationManager* authMan = PEngListLibraryFactory::AuthorizationManagerL(
       
    97                                              iUsedSlot->BaseId() );
       
    98     //respond takes always the authMan ownership
       
    99     respond->LockRespondToAuthManagerL( *authMan );
       
   100 
       
   101     CleanupStack::Pop( respond );
       
   102     aRespond = respond;
       
   103     }
       
   104 
       
   105 
       
   106 // End of File
       
   107 
       
   108