|
1 /* |
|
2 * Copyright (c) 2007-2008 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: subscribe to grant presence request list |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <ximpprotocolconnectionhost.h> |
|
20 #include "csubscribepresencegrantrequestlistrequest.h" |
|
21 #include "mossprotocolconnectionmanager.h" |
|
22 #include "ossprotocolpluginlogger.h" |
|
23 #include <protocolpresenceauthorizationdatahost.h> |
|
24 |
|
25 #include "cossprotocolconnectionmanager.h" |
|
26 |
|
27 #include <ximpobjectfactory.h> |
|
28 #include <ximpobjectcollection.h> |
|
29 #include <protocolpresentitygroupsdatahost.h> |
|
30 #include <presentitygroupinfo.h> |
|
31 #include <presentitygroupmemberinfo.h> |
|
32 #include <ximpidentity.h> |
|
33 #include <ximpdatasubscriptionstate.h> |
|
34 |
|
35 |
|
36 // ======== MEMBER FUNCTIONS ======== |
|
37 |
|
38 // --------------------------------------------------------------------------- |
|
39 // CSubscribePresenceGrantRequestListRequest::CSubscribePresenceGrantRequestListRequest |
|
40 // --------------------------------------------------------------------------- |
|
41 // |
|
42 CSubscribePresenceGrantRequestListRequest::CSubscribePresenceGrantRequestListRequest( |
|
43 MOSSProtocolConnectionManager& aConnMan, |
|
44 TXIMPRequestId aRequestId ) : |
|
45 CActive( EPriorityNormal ), |
|
46 iRequestId( aRequestId ), |
|
47 iConnMan( aConnMan ) |
|
48 { |
|
49 LOGGER ( TXT("::CSubscribePresenceGrantRequestListRequest Start") ); |
|
50 CActiveScheduler::Add( this ); |
|
51 LOGGER ( TXT("::CSubscribePresenceGrantRequestListRequest End") ); |
|
52 } |
|
53 |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // CSubscribePresenceGrantRequestListRequest::ConstructL |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 void CSubscribePresenceGrantRequestListRequest::ConstructL() |
|
60 { |
|
61 LOGGER ( TXT("::ConstructL Start") ); |
|
62 LOGGER ( TXT("::ConstructL End") ); |
|
63 } |
|
64 |
|
65 |
|
66 // --------------------------------------------------------------------------- |
|
67 // CSubscribePresenceGrantRequestListRequest::NewL |
|
68 // --------------------------------------------------------------------------- |
|
69 // |
|
70 CSubscribePresenceGrantRequestListRequest* CSubscribePresenceGrantRequestListRequest::NewL( |
|
71 MOSSProtocolConnectionManager& aConnMan, |
|
72 TXIMPRequestId aRequestId ) |
|
73 { |
|
74 LOGGER ( TXT("CSubscribePresenceGrantRequestListRequest::NewL Start") ); |
|
75 |
|
76 CSubscribePresenceGrantRequestListRequest* self = new( ELeave ) |
|
77 CSubscribePresenceGrantRequestListRequest( aConnMan, aRequestId ); |
|
78 CleanupStack::PushL( self ); |
|
79 self->ConstructL(); |
|
80 CleanupStack::Pop( self ); |
|
81 |
|
82 LOGGER ( TXT("CSubscribePresenceGrantRequestListRequest::NewL End") ); |
|
83 return self; |
|
84 } |
|
85 |
|
86 |
|
87 // --------------------------------------------------------------------------- |
|
88 // CSubscribePresenceGrantRequestListRequest::NewLC |
|
89 // --------------------------------------------------------------------------- |
|
90 // |
|
91 CSubscribePresenceGrantRequestListRequest* CSubscribePresenceGrantRequestListRequest::NewLC( |
|
92 MOSSProtocolConnectionManager& aConnMan, |
|
93 TXIMPRequestId aRequestId ) |
|
94 { |
|
95 LOGGER ( TXT("CSubscribePresenceGrantRequestListRequest::NewLC Start") ); |
|
96 |
|
97 CSubscribePresenceGrantRequestListRequest* self = |
|
98 CSubscribePresenceGrantRequestListRequest::NewL( aConnMan, aRequestId ); |
|
99 CleanupStack::PushL( self ); |
|
100 |
|
101 LOGGER ( TXT("CSubscribePresenceGrantRequestListRequest::NewLC End") ); |
|
102 return self; |
|
103 } |
|
104 |
|
105 // --------------------------------------------------------------------------- |
|
106 // CSubscribePresenceGrantRequestListRequest::~CSubscribePresenceGrantRequestListRequest |
|
107 // --------------------------------------------------------------------------- |
|
108 // |
|
109 CSubscribePresenceGrantRequestListRequest::~CSubscribePresenceGrantRequestListRequest() |
|
110 { |
|
111 LOGGER ( TXT("::~CSubscribePresenceGrantRequestListRequest Start") ); |
|
112 |
|
113 CActive::Cancel(); |
|
114 |
|
115 LOGGER ( TXT("::~CSubscribePresenceGrantRequestListRequest End") ); |
|
116 } |
|
117 |
|
118 |
|
119 // --------------------------------------------------------------------------- |
|
120 // CSubscribePresenceGrantRequestListRequest::DoCancel() |
|
121 // --------------------------------------------------------------------------- |
|
122 // |
|
123 void CSubscribePresenceGrantRequestListRequest::DoCancel() |
|
124 { |
|
125 LOGGER ( TXT("CSubscribePresenceGrantRequestListRequest::DoCancel Start") ); |
|
126 iConnMan.DataHandler().CancelListeningAddNotication(); |
|
127 LOGGER ( TXT("CSubscribePresenceGrantRequestListRequest::DoCancel End") ); |
|
128 } |
|
129 |
|
130 |
|
131 // --------------------------------------------------------------------------- |
|
132 // CSubscribePresenceGrantRequestListRequest::RunL() |
|
133 // --------------------------------------------------------------------------- |
|
134 // |
|
135 void CSubscribePresenceGrantRequestListRequest::RunL() |
|
136 { |
|
137 LOGGER ( TXT("CSubscribePresenceGrantRequestListRequest::RunL Start") ); |
|
138 |
|
139 User::LeaveIfError( iStatus.Int() ); |
|
140 |
|
141 iConnMan.HandleToHost().HandleRequestCompleted( iRequestId, KErrNone); |
|
142 |
|
143 delete this; |
|
144 LOGGER ( TXT("CSubscribePresenceGrantRequestListRequest::RunL End") ); |
|
145 } |
|
146 |
|
147 |
|
148 // --------------------------------------------------------------------------- |
|
149 // CSubscribePresenceGrantRequestListRequest::RunError |
|
150 // --------------------------------------------------------------------------- |
|
151 // |
|
152 TInt CSubscribePresenceGrantRequestListRequest::RunError( TInt aError ) |
|
153 { |
|
154 LOGGER ( TXT("CSubscribePresenceGrantRequestListRequest::RunError Start") ); |
|
155 |
|
156 iConnMan.HandleToHost().HandleRequestCompleted( iRequestId, aError ); |
|
157 |
|
158 delete this; |
|
159 LOGGER ( TXT("CSubscribePresenceGrantRequestListRequest::RunError End") ); |
|
160 return KErrNone; |
|
161 } |
|
162 |
|
163 // --------------------------------------------------------------------------- |
|
164 // CSubscribePresenceGrantRequestListRequest::SubscribePresenceGrantRequestListL |
|
165 // --------------------------------------------------------------------------- |
|
166 // |
|
167 void CSubscribePresenceGrantRequestListRequest::SubscribePresenceGrantRequestListL() |
|
168 { |
|
169 LOGGER ( TXT("::SubscribePresenceGrantRequestListL Start") ); |
|
170 // signal the scheduler |
|
171 SetActive(); |
|
172 |
|
173 //by default adaptation 1.2 is ready for receiving presence authorisation requests from the server.no need to subscribe for it |
|
174 TRequestStatus *status = &iStatus; |
|
175 User::RequestComplete( status, KErrNone); |
|
176 |
|
177 LOGGER ( TXT("::SubscribePresenceGrantRequestListL End") ); |
|
178 } |
|
179 |
|
180 // End of file |