author | cgandhi <chandradeep.gandhi@sasken.com> |
Wed, 23 Jun 2010 19:51:49 +0530 | |
changeset 14 | a469c0e6e7fb |
parent 13 | b5d63d5fc252 |
child 18 | 013a02bf2bb0 |
permissions | -rw-r--r-- |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
1 |
/** |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2010 Sasken Communication Technologies Ltd. |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
5 |
* under the terms of the "Eclipse Public License v1.0" |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html" |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
8 |
* |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
10 |
* Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
11 |
* |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
12 |
* Contributors: |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
13 |
* Manasij Roy, Nalina Hariharan |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
14 |
*/ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
15 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
16 |
#include "smfserver.h" |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
17 |
#include "smfpluginmanager.h" |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
18 |
#include "smftransportmanager.h" |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
19 |
#include "dsm.h" |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
20 |
#include "smfclientglobal.h" |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
21 |
#include <smfprovider.h> |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
22 |
#include <smfpost.h> |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
23 |
#include <smflocation.h> |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
24 |
#include <smfcontact.h> |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
25 |
#include <smfpicture.h> |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
26 |
#include <smfcomment.h> |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
27 |
#include <SmfCredMgrClient.h> |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
28 |
#include <smfrelationmgr.h> |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
29 |
#include <smfclientglobal.h> |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
30 |
#include <QImage> |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
31 |
#include <QUrl> |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
32 |
#include <smfgroup.h> |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
33 |
#include <QTextStream> |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
34 |
#include <QFile> |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
35 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
36 |
#ifdef Q_OS_SYMBIAN |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
37 |
#include "smfserversymbian_p.h" |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
38 |
#else |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
39 |
#include "smfserverqt_p.h" |
13
b5d63d5fc252
Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents:
10
diff
changeset
|
40 |
#include "smfserverqtsession.h" |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
41 |
#endif |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
42 |
|
13
b5d63d5fc252
Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents:
10
diff
changeset
|
43 |
SmfServer::SmfServer(QObject* parent) |
b5d63d5fc252
Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents:
10
diff
changeset
|
44 |
: QObject(parent) |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
45 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
46 |
} |
13
b5d63d5fc252
Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents:
10
diff
changeset
|
47 |
|
b5d63d5fc252
Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents:
10
diff
changeset
|
48 |
SmfServer::~SmfServer() |
b5d63d5fc252
Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents:
10
diff
changeset
|
49 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
50 |
if(m_SmfServerPrivate) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
51 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
52 |
delete m_SmfServerPrivate; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
53 |
m_SmfServerPrivate = NULL; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
54 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
55 |
|
13
b5d63d5fc252
Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents:
10
diff
changeset
|
56 |
} |
b5d63d5fc252
Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents:
10
diff
changeset
|
57 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
58 |
bool SmfServer::startServer() |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
59 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
60 |
bool success = false; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
61 |
//Initialize all the component handles |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
62 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
63 |
SmfTransportInitializeResult networkStatus = prepareTransport(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
64 |
qDebug()<<("Before m_pluginManager construction"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
65 |
m_pluginManager = SmfPluginManager::getInstance(this); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
66 |
qDebug()<<("After m_pluginManager construction"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
67 |
// m_dataStoreManager = new SmfDataStoreManager(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
68 |
//Initialize private implementation |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
69 |
#ifdef Q_OS_SYMBIAN |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
70 |
TRAPD(err, m_SmfServerPrivate = SmfServerSymbian::NewL(CActive::EPriorityStandard,this)); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
71 |
QString log("SmfServer::startServer="); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
72 |
int errorQ = err ; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
73 |
log += errorQ; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
74 |
qDebug()<<(log); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
75 |
if( KErrNone != err ) |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
76 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
77 |
return success; |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
78 |
} |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
79 |
TInt error = m_SmfServerPrivate->Start( KSmfServerName ); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
80 |
RSemaphore semaphore; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
81 |
User::LeaveIfError( semaphore.OpenGlobal( KSmfServerSemaphoreName ) ); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
82 |
// Semaphore opened ok |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
83 |
semaphore.Signal(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
84 |
semaphore.Close(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
85 |
errorQ = error ; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
86 |
log.clear(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
87 |
log = QString("m_SmfServerPrivate->Start="); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
88 |
log += QString::number(error); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
89 |
qDebug()<<(log); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
90 |
if( KErrNone == error ) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
91 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
92 |
success = true; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
93 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
94 |
else |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
95 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
96 |
//error |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
97 |
return success; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
98 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
99 |
#else |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
100 |
m_SmfServerPrivate = new SmfServerQt(this); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
101 |
success = m_SmfServerPrivate->start(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
102 |
if (!success) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
103 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
104 |
return success; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
105 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
106 |
#endif |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
107 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
108 |
m_credentialMngr = new SmfCredMgrClient(); |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
109 |
return success; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
110 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
111 |
//Note:- Almost all the following APIs are called by private impl via the handle |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
112 |
/** |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
113 |
* This API is called by the private impl when client is authorized |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
114 |
* @param interfaceID Interface id, provided by the private impl (it gets it from client) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
115 |
* @param pluginIDMap Map of plugins who implement this interface and corresponding provider, |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
116 |
* this is returned to the private impl |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
117 |
* It calls PM to get the list. Note:- PM may return SmfProviderBase which is superset of SmfProvider. |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
118 |
* TODO:- session should store this map for future ref? |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
119 |
*/ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
120 |
void SmfServer::getPlugins(SmfInterfaceID interfaceID, QMap<SmfPluginID,SmfProvider>& pluginIDMap) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
121 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
122 |
pluginIDMap.clear(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
123 |
m_pluginManager->getPlugins(interfaceID,pluginIDMap); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
124 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
125 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
126 |
SmfPluginID SmfServer::getPlugin(SmfInterfaceID interfaceID,SmfProvider provider) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
127 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
128 |
//TODO:- do it properly as per PM implementation |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
129 |
//return PM->getplugin(interfaceID,provider); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
130 |
//TODO:- PM is not yet ready |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
131 |
SmfPluginID id; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
132 |
m_pluginManager->getPluginId(interfaceID,provider, id); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
133 |
return id; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
134 |
//testing purpose only |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
135 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
136 |
/** |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
137 |
* This API is called by the private impl to get a list of authorized plugins from CM |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
138 |
* @param list List of plugins to be filtered |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
139 |
* @param authList List of authorised plugins filled by CM |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
140 |
* this is returned to the private impl |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
141 |
* It calls CMclient to get the list synchronously |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
142 |
* TODO:- session should store this for future ref? |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
143 |
*/ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
144 |
void SmfServer::getAuthorizedPlugins(QList<SmfPluginID>& list,QList<SmfPluginID>& authList) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
145 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
146 |
//TODO:-Uncomment the following once authorization flow of plugin is implemented |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
147 |
/* authList.clear(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
148 |
for(int i=0;i<list.count();i++) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
149 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
150 |
bool isAuthorized = m_credentialMngr->CheckPluginAuthentication(list[i]); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
151 |
if(isAuthorized) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
152 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
153 |
authList.append(list[i]); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
154 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
155 |
}*/ |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
156 |
authList = list; |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
157 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
158 |
SmfTransportInitializeResult SmfServer::prepareTransport() |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
159 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
160 |
qDebug()<<("Before SmfTransportManager::getInstance"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
161 |
m_transportManager = SmfTransportManager::getInstance(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
162 |
qDebug()<<("Before m_transportManager->initializeTransport"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
163 |
//checking the network status |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
164 |
SmfTransportInitializeResult networkStatus = m_transportManager->initializeTransport(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
165 |
qDebug()<<("m_transportManager->initializeTransport return = ")<<networkStatus; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
166 |
return networkStatus; |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
167 |
} |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
168 |
void SmfServer::sendToPluginManager(int requestID,SmfPluginID pluginID,SmfInterfaceID interfaceID,SmfRequestTypeID requestTypeID,QByteArray dataForPlugin ,int pageno,int perpage) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
169 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
170 |
qDebug()<<("SmfServer::delegateToPluginManager"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
171 |
qDebug()<<(QString::number(requestID)); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
172 |
qDebug()<<(pluginID); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
173 |
qDebug()<<(interfaceID); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
174 |
qDebug()<<(QString::number(requestTypeID)); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
175 |
//TODO:-PM should take page info too |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
176 |
m_pluginManager->createRequest(requestID,pluginID,requestTypeID,dataForPlugin); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
177 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
178 |
SmfError SmfServer::sendToDSM(QByteArray qtdataForDSM,SmfRequestTypeID opcode,QByteArray& qtdataFromDSM) |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
179 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
180 |
DataStoreManager* dsm = DataStoreManager::getDataStoreManager(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
181 |
//Note:- deserialization and formation of user profile and social profile are done by server |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
182 |
QDataStream readStream(&qtdataForDSM,QIODevice::ReadOnly); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
183 |
QDataStream writeStream(&qtdataFromDSM,QIODevice::ReadOnly); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
184 |
switch(opcode) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
185 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
186 |
case SmfRelationCreate: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
187 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
188 |
//read the incoming data |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
189 |
SmfProvider provider; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
190 |
SmfContact contact; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
191 |
readStream>>provider; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
192 |
readStream>>contact; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
193 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
194 |
SmfRelationId relnId = dsm->create(&provider,&contact); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
195 |
writeStream<<relnId; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
196 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
197 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
198 |
case SmfRelationAssociate: |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
199 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
200 |
SmfRelationId relnId; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
201 |
SmfContact contact; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
202 |
SmfProvider provider; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
203 |
readStream>>relnId; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
204 |
readStream>>contact; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
205 |
readStream>>provider; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
206 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
207 |
SmfError err = dsm->associate(relnId,&contact,&provider); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
208 |
int errInt = err; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
209 |
writeStream<<errInt; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
210 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
211 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
212 |
case SmfRelationSearchById: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
213 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
214 |
SmfRelationId relnId; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
215 |
readStream>>relnId; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
216 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
217 |
SmfRelationItem* relnItem = dsm->searchById(relnId); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
218 |
writeStream<<*(relnItem); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
219 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
220 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
221 |
case SmfRelationCount: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
222 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
223 |
SmfRelationId relationId; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
224 |
readStream>>relationId; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
225 |
int cnt = dsm->count(relationId); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
226 |
writeStream<<cnt; |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
227 |
} |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
228 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
229 |
case SmfRelationGet: |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
230 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
231 |
SmfRelationId relationId; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
232 |
quint32 index; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
233 |
readStream>>relationId; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
234 |
readStream>>index; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
235 |
SmfRelationItem* relnItem = dsm->getContact(relationId,index); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
236 |
writeStream<<relnItem; |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
237 |
} |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
238 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
239 |
case SmfRelationGetAll: |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
240 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
241 |
SmfRelationId relationId; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
242 |
readStream>>relationId; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
243 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
244 |
QList<SmfRelationItem> relnIditemList = dsm->getAll(relationId); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
245 |
writeStream<<relnIditemList; |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
246 |
} |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
247 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
248 |
case SmfRelationGetAllRelations: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
249 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
250 |
QList<SmfRelationId> relnIdList = dsm->getAllRelations(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
251 |
writeStream<<relnIdList; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
252 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
253 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
254 |
default: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
255 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
256 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
257 |
return SmfNoError; |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
258 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
259 |
/** |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
260 |
* This slot is invoked when CM finishes the authorization of the client. |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
261 |
* @param authID As it contains the session ptr, sever directly invokes the session's API to notify success |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
262 |
*/ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
263 |
void SmfServer::clientAuthorizationFinished(bool success,SmfClientAuthID authID ) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
264 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
265 |
//TODO:- implement this api in session class |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
266 |
//note:- in case success is false client completes the request with SmfErrClientAuthFailed |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
267 |
//TODO:- define set of smf wide error after consulting with other module owners |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
268 |
authID.session->clientathorizationFinished(success); |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
269 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
270 |
/** |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
271 |
* This API is called by PM once its done with request and parsing |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
272 |
* @param requestID The request id which is completed |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
273 |
* @param parsedData Serialized data(as per request type) filled by PM |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
274 |
* @param error Error occured |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
275 |
* TODO:- should use smf wide global errors instead |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
276 |
*/ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
277 |
void SmfServer::resultsAvailable(int requestID,QByteArray* parsedData,SmfError error) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
278 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
279 |
qDebug()<<("SmfServer::resultsAvailable"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
280 |
qDebug()<<("requestID="); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
281 |
qDebug()<<(QString::number(requestID)); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
282 |
qDebug()<<("parsedData->size()="); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
283 |
qDebug()<<(QString::number(parsedData->size())); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
284 |
qDebug()<<("Error="); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
285 |
qDebug()<<(QString::number(error)); |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
286 |
//Serialize error followed by actual data |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
287 |
QByteArray dataWithError; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
288 |
QDataStream writer(&dataWithError,QIODevice::WriteOnly); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
289 |
writer<<error; |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
290 |
if(parsedData->size()) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
291 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
292 |
writer<<*(parsedData); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
293 |
} |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
294 |
//find out the appropriate session and request id and service that |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
295 |
m_SmfServerPrivate->findAndServiceclient(requestID,&dataWithError,error); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
296 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
297 |
/** |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
298 |
* Seems reduntant |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
299 |
*/ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
300 |
void SmfServer::serviceClient(QByteArray* parsedData) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
301 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
302 |
Q_UNUSED(parsedData) |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
303 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
304 |
/** |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
305 |
* This is called when CMclient notifies client expiry. |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
306 |
* @param type notification type, set of enums for future expansion |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
307 |
* @param id Plugin Id for which the authentication has expired |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
308 |
*/ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
309 |
void SmfServer::authenticationKeysExpired(NotificationType type,SmfPluginID id) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
310 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
311 |
Q_UNUSED(type) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
312 |
Q_UNUSED(id) |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
313 |
//resend the notify request |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
314 |
//CMclient->requestAuthExpiryNotify(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
315 |
} |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
316 |
/*void SmfServer::writeLog(QString log) const |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
317 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
318 |
#ifdef WRITE_LOG |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
319 |
QFile file("c:\\data\\SmfServerLogs.txt"); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
320 |
if (!file.open(QIODevice::Append | QIODevice::Text)) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
321 |
; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
322 |
QTextStream out(&file); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
323 |
out << log << "\n"; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
324 |
file.close(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
325 |
#else |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
326 |
Q_UNUSED(log) |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
327 |
#endif |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
328 |
}*/ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
329 |
//#ifdef CLIENT_SERVER_TEST |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
330 |
dummyPM::dummyPM(SmfServer* server,QObject* parent) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
331 |
: m_server(server),QObject(parent) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
332 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
333 |
m_timer = new QTimer(this); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
334 |
connect(m_timer, SIGNAL(timeout()), this, SLOT(responseAvailable())); |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
335 |
} |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
336 |
SmfError dummyPM::createRequest ( const quint32& aSessionID, |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
337 |
const QString& aPluginID, |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
338 |
const SmfRequestTypeID& aOperation, |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
339 |
QByteArray& aInputData ) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
340 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
341 |
qDebug()<<QString::number(aSessionID); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
342 |
qDebug()<<aPluginID; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
343 |
qDebug()<<QString::number(aOperation); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
344 |
qDebug()<<QString::number(aInputData.size()); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
345 |
m_timer->start(1000); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
346 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
347 |
void dummyPM::responseAvailable() |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
348 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
349 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
350 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
13
diff
changeset
|
351 |
//#endif |