|
1 // Copyright (c) 2006-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 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 @prototype |
|
20 */ |
|
21 |
|
22 |
|
23 //#include <comms-infras/ss_nodestates.h> |
|
24 //#include <comms-infras/corescprstates.h> |
|
25 #include <comms-infras/corescpractivities.h> |
|
26 #include <comms-infras/ss_nodemessages_dataclient.h> |
|
27 |
|
28 #include "agentscprstates.h" |
|
29 #include "agentscpractivities.h" |
|
30 #include "agentmessages.h" |
|
31 |
|
32 using namespace ESock; |
|
33 using namespace NetStateMachine; |
|
34 using namespace MeshMachine; |
|
35 |
|
36 // Authenticate Activity |
|
37 namespace AgentSCprAuthenticationActivity |
|
38 { |
|
39 DECLARE_DEFINE_NODEACTIVITY(ECFActivityAuthentication, AgentSCprAuthentication, TLinkMessage::TAuthenticate) |
|
40 FIRST_NODEACTIVITY_ENTRY(AgentSCprStates::TAwaitingAuthenticate, MeshMachine::TNoTag) |
|
41 NODEACTIVITY_ENTRY(KNoTag, AgentSCprStates::TSendAuthenticate, AgentSCprStates::TAwaitingAuthenticateComplete, MeshMachine::TNoTag) |
|
42 LAST_NODEACTIVITY_ENTRY(KNoTag, AgentSCprStates::TSendAuthenticateComplete) |
|
43 NODEACTIVITY_END() |
|
44 } |
|
45 |
|
46 namespace AgentSCprStartActivity |
|
47 { |
|
48 DECLARE_DEFINE_CUSTOM_NODEACTIVITY(ECFActivityStartDataClient, AgentSCprStart, TCFDataClient::TStart, MeshMachine::CNodeRetryActivity::NewL) |
|
49 FIRST_NODEACTIVITY_ENTRY(CoreNetStates::TAwaitingDataClientStart, MeshMachine::TNoTag) |
|
50 NODEACTIVITY_ENTRY(KNoTag, AgentSCprStates::TStartAgent, CoreNetStates::TAwaitingStarted, MeshMachine::TNoTag) |
|
51 NODEACTIVITY_ENTRY(KNoTag, PRStates::TStartDataClients, CoreNetStates::TAwaitingDataClientsStarted, MeshMachine::TNoTag) |
|
52 LAST_NODEACTIVITY_ENTRY(KNoTag, PRStates::TSendDataClientStarted) |
|
53 NODEACTIVITY_END() |
|
54 } |
|
55 |
|
56 |
|
57 namespace AgentSCprNotificationFromFlowActivity |
|
58 { |
|
59 DECLARE_DEFINE_NODEACTIVITY(ECFNotificationFromFlowActivity, AgentSCprNotificationFromFlow, TLinkMessage::TFlowToAgentNotification) |
|
60 FIRST_NODEACTIVITY_ENTRY(AgentSCprStates::TAwaitingNotificationFromFlow, MeshMachine::TNoTag) |
|
61 LAST_NODEACTIVITY_ENTRY(KNoTag, AgentSCprStates::TNotifyAgent) |
|
62 NODEACTIVITY_END() |
|
63 } |
|
64 |
|
65 namespace AgentSCprDataClientGoneDownActivity |
|
66 { |
|
67 DECLARE_DEFINE_NODEACTIVITY(ECFActivityDataClientGoneDown, AgentSCprDataClientGoneDown, TCFControlProvider::TDataClientGoneDown) |
|
68 FIRST_NODEACTIVITY_ENTRY(MeshMachine::TAwaitingAny, MeshMachine::TNoTag) |
|
69 LAST_NODEACTIVITY_ENTRY(KNoTag, AgentSCprStates::TProcessDataClientGoneDown) |
|
70 NODEACTIVITY_END() |
|
71 } |
|
72 |
|
73 namespace AgentSCprStopActivity |
|
74 { |
|
75 // Note: use of TStopYourFlows/TAwaitingFlowDown/TNoTag (i.e. no looping) as there is only one flow at the Agent level. |
|
76 DECLARE_DEFINE_CUSTOM_NODEACTIVITY(ECFActivityStopDataClient, AgentSCprStop, TCFDataClient::TStop, MeshMachine::CNodeRetryActivity::NewL) |
|
77 FIRST_NODEACTIVITY_ENTRY(CoreNetStates::TAwaitingDataClientStop, PRDataClientStopActivity::TNoTagOrProviderStoppedBlockedByStart) |
|
78 NODEACTIVITY_ENTRY(KNoTag, SCprStates::TStopYourFlows, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TTag<CoreNetStates::KProviderStopped>) |
|
79 |
|
80 THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, MeshMachine::TDoNothing, AgentSCprStates::TNoTagOrProviderStopped) |
|
81 NODEACTIVITY_ENTRY(KNoTag, AgentSCprStates::TStopAgent, AgentSCprStates::TAwaitingAgentDown, MeshMachine::TTag<CoreNetStates::KProviderStopped>) |
|
82 THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PRStates::TDestroyOrphanedDataClients, MeshMachine::TTag<CoreNetStates::KProviderStopped>) |
|
83 LAST_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PRStates::TSendDataClientStopped) |
|
84 NODEACTIVITY_END() |
|
85 } |
|
86 |
|
87 // This activity runs in response to the completion of an agent initiated disconnect |
|
88 namespace AgentSCprDataClientStoppedActivity |
|
89 { |
|
90 DECLARE_DEFINE_NODEACTIVITY(ECFSelfStopDataClientStoppedActivity, AgentSCprDataClientStopped, TCFDataClient::TStopped) |
|
91 FIRST_NODEACTIVITY_ENTRY(CoreNetStates::TAwaitingDataClientStopped, AgentSCprStates::TNoTagOrProviderStarted) |
|
92 LAST_NODEACTIVITY_ENTRY(KNoTag, AgentSCprStates::TSendError) |
|
93 LAST_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStarted, AgentSCprStates::TSendDataClientGoneDown) |
|
94 NODEACTIVITY_END() |
|
95 } |
|
96 |
|
97 |
|
98 // Activity Map |
|
99 namespace AgentSCprActivities |
|
100 { |
|
101 DEFINE_EXPORT_ACTIVITY_MAP(agentSCprActivities) |
|
102 ACTIVITY_MAP_ENTRY(AgentSCprNotificationFromFlowActivity, AgentSCprNotificationFromFlow) |
|
103 ACTIVITY_MAP_ENTRY(AgentSCprAuthenticationActivity, AgentSCprAuthentication) |
|
104 ACTIVITY_MAP_ENTRY(AgentSCprDataClientGoneDownActivity, AgentSCprDataClientGoneDown) |
|
105 ACTIVITY_MAP_ENTRY(AgentSCprStartActivity, AgentSCprStart) |
|
106 ACTIVITY_MAP_ENTRY(AgentSCprStopActivity, AgentSCprStop) |
|
107 ACTIVITY_MAP_ENTRY(AgentSCprDataClientStoppedActivity, AgentSCprDataClientStopped) |
|
108 ACTIVITY_MAP_END_BASE(SCprActivities, coreSCprActivities) |
|
109 } |
|
110 |