|
1 // Copyright (c) 2007-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 // This is part of an ECOM plug-in |
|
15 // SIP TierManager class definition |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 */ |
|
23 |
|
24 #include <comms-infras/ss_log.h> |
|
25 #include <comms-infras/ss_corepractivities.h> |
|
26 #include <comms-infras/coretiermanagerstates.h> |
|
27 #include <comms-infras/coretiermanageractivities.h> |
|
28 #include "siptiermanager.h" |
|
29 #include "siptiermanagerselector.h" |
|
30 |
|
31 #ifdef __CFLOG_ACTIVE |
|
32 #define KSipTierMgrTag KESockMetaConnectionTag |
|
33 #endif |
|
34 |
|
35 using namespace ESock; |
|
36 using namespace NetStateMachine; |
|
37 using namespace Messages; |
|
38 using namespace MeshMachine; |
|
39 |
|
40 namespace SipTierManagerActivities |
|
41 { |
|
42 DECLARE_DEFINE_ACTIVITY_MAP(stateMap) |
|
43 ACTIVITY_MAP_END_BASE(TMActivities, coreTMActivities) |
|
44 } |
|
45 |
|
46 |
|
47 CSipTierManager* CSipTierManager::NewL(ESock::CTierManagerFactoryBase& aFactory) |
|
48 /** |
|
49 @param aParentContainer the parent factory container which owns this factory |
|
50 @return factory for SIP level meta connection providers |
|
51 */ |
|
52 { |
|
53 CSipTierManager* self = new (ELeave) CSipTierManager(aFactory,SipTierManagerActivities::stateMap::Self()); |
|
54 CleanupStack::PushL (self); |
|
55 self->ConstructL(); |
|
56 CleanupStack::Pop(); |
|
57 return self; |
|
58 } |
|
59 |
|
60 CSipTierManager::CSipTierManager(ESock::CTierManagerFactoryBase& aFactory, |
|
61 const MeshMachine::TNodeActivityMap& aActivityMap) |
|
62 : CCoreTierManager(aFactory,aActivityMap) |
|
63 /** |
|
64 @param aFactoryId the ID which this factory can be looked up by |
|
65 @param aParentContainer the parent factory container which owns this factory |
|
66 */ |
|
67 { |
|
68 LOG_NODE_CREATE(KSipTierMgrTag, CSipTierManager); |
|
69 } |
|
70 |
|
71 MProviderSelector* CSipTierManager::DoCreateProviderSelectorL(const Meta::SMetaData& aSelectionPreferences) |
|
72 { |
|
73 |
|
74 MProviderSelector* selector = CSipMetaCprSelector::NewL(aSelectionPreferences); |
|
75 CSipMetaCprSelector* sipselector = static_cast<CSipMetaCprSelector* >(selector); |
|
76 sipselector->SetTierManager(this); |
|
77 return selector; |
|
78 } |
|
79 |
|
80 void CSipTierManager::ReceivedL(const TRuntimeCtxId& aSender, const TNodeId& aRecipient, TSignatureBase& aMessage) |
|
81 { |
|
82 TNodeContext<CSipTierManager> ctx(*this, aMessage, aSender, aRecipient); |
|
83 CCoreTierManager::Received(ctx); |
|
84 User::LeaveIfError(ctx.iReturn); |
|
85 } |
|
86 |
|
87 void CSipTierManager::ConstructL() |
|
88 { |
|
89 //create the TransitionEngineManager here |
|
90 iTransitionEngineManager = new (ELeave) CTransitionEngineMgr; |
|
91 CCoreTierManager::ConstructL(); |
|
92 } |
|
93 |
|
94 CTransitionEngineMgr* CSipTierManager::TransitionEngineManager() |
|
95 { |
|
96 return iTransitionEngineManager; |
|
97 } |
|
98 |
|
99 CSipTierManager::~CSipTierManager() |
|
100 { |
|
101 delete iTransitionEngineManager; |
|
102 iTransitionEngineManager = NULL; |
|
103 } |
|
104 |
|
105 |