smf/smfservermodule/smfserver/server/smfserver.cpp
author cgandhi
Thu, 05 Aug 2010 16:48:48 +0530
changeset 18 013a02bf2bb0
parent 14 a469c0e6e7fb
child 25 a180113055cb
permissions -rw-r--r--
pushing changes for common libs and trace messages
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
     5
 * under the terms of the "Eclipse Public License v1.0"
7
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
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    14
 * 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    15
 * Description:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    16
 * SMF Server component which handles the client requests and delegates 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    17
 * them properly to the appropriate component
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    18
 * 
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    19
 */
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    20
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    21
#include <QDebug>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    22
#include <qglobal.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    23
#include <smfcontact.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    24
#include <smfgroup.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    25
#include <smfpost.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    26
#include <smflocation.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    27
#include <smfpicture.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    28
#include <smfcomment.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    29
#include <smfcredmgrclient.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    30
#include <smfrelationmgr.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    31
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    32
#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
    33
#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
    34
#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
    35
#include "dsm.h"
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    36
#ifdef Q_OS_SYMBIAN
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    37
	#include "smfserversymbian_p.h"
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    38
#else
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    39
	#include "smfserverqt_p.h"
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    40
	#include "smfserverqtsession.h"
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    41
#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
    42
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    43
13
b5d63d5fc252 Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents: 10
diff changeset
    44
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
    45
    : 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
    46
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    47
	m_transportManager = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    48
	m_pluginManager = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    49
	m_credentialMngr = NULL;
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    50
	}
13
b5d63d5fc252 Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents: 10
diff changeset
    51
b5d63d5fc252 Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents: 10
diff changeset
    52
SmfServer::~SmfServer()
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    53
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    54
	qDebug()<<"Inside Smfserver::~SmfServer()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    55
	if(m_transportManager)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    56
		delete m_transportManager;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    57
	if(m_pluginManager)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    58
		delete m_pluginManager;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    59
	if(m_credentialMngr)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    60
		delete m_credentialMngr;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
    61
	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
    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
		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
    64
		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
    65
		}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    66
	}
13
b5d63d5fc252 Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents: 10
diff changeset
    67
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    68
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
    69
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    70
	qDebug()<<"Inside SmfServer::startServer()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    71
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    72
	bool success = false;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    73
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    74
	//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
    75
	SmfTransportInitializeResult networkStatus = prepareTransport();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    76
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    77
	qDebug()<<"Before m_pluginManager construction";
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
    78
	m_pluginManager = SmfPluginManager::getInstance(this);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    79
	qDebug()<<"After m_pluginManager construction";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    80
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
    81
	//	m_dataStoreManager = new SmfDataStoreManager();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    82
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    83
#ifdef Q_OS_SYMBIAN
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
    84
	//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
    85
	TRAPD(err, m_SmfServerPrivate = SmfServerSymbian::NewL(CActive::EPriorityStandard,this));
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    86
	qDebug()<<"SmfServerSymbian::NewL() = "<<err;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    87
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
    88
	if( KErrNone != err )
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
    89
		return success;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    90
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
    91
	TInt error = m_SmfServerPrivate->Start( KSmfServerName );
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    92
	qDebug()<<"m_SmfServerPrivate->Start = "<<error;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    93
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
    94
    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
    95
    User::LeaveIfError( semaphore.OpenGlobal( KSmfServerSemaphoreName ) );
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    96
    
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
    97
    // 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
    98
    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
    99
    semaphore.Close();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   100
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   101
	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
   102
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   103
		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
   104
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   105
	else 
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   106
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   107
		//error
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   108
		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
   109
		}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   110
#else
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   111
	// For non-symbian platforms
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   112
	m_SmfServerPrivate = new SmfServerQt(this);
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   113
	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
   114
	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
   115
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   116
		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
   117
		}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   118
#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
   119
	
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   120
	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
   121
    return success;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   122
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   123
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   124
//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
   125
/**
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   126
 * 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
   127
 * @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
   128
 * @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
   129
 * 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
   130
 * 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
   131
 * 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
   132
 */
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   133
void SmfServer::getPlugins(const SmfInterfaceID& interfaceID, QMap<SmfPluginID,SmfProvider>& pluginIDMap)
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   134
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   135
	qDebug()<<"Inside SmfServer::getPlugins()";
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   136
	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
   137
	}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   138
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   139
SmfPluginID SmfServer::getPlugin(const SmfInterfaceID& interfaceID,SmfProvider provider)
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   140
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   141
	qDebug()<<"Inside SmfServer::getPlugin()";
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   142
	SmfPluginID id;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   143
	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
   144
	return id;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   145
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   146
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   147
/**
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   148
 * 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
   149
 * @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
   150
 * @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
   151
 * 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
   152
 * 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
   153
 * 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
   154
 */
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   155
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
   156
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   157
	qDebug()<<"Inside SmfServer::getAuthorizedPlugins()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   158
	authList.clear();
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   159
	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
   160
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   161
		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
   162
		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
   163
			authList.append(list[i]);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   164
		}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   165
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   166
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   167
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
   168
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   169
	qDebug()<<"Inside SmfServer::prepareTransport()";
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   170
	m_transportManager = SmfTransportManager::getInstance();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   171
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   172
	//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
   173
	SmfTransportInitializeResult networkStatus = m_transportManager->initializeTransport();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   174
	qDebug()<<"m_transportManager->initializeTransport() return = "<<networkStatus;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   175
	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
   176
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   177
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   178
void SmfServer::sendToPluginManager ( int requestID, SmfPluginID pluginID, 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   179
		SmfInterfaceID interfaceID, SmfRequestTypeID requestTypeID, 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   180
		QByteArray dataForPlugin )
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   181
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   182
	qDebug()<<"Inside SmfServer::sendToPluginManager()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   183
	qDebug()<<"Request ID = "<<requestID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   184
	qDebug()<<"PluginID = "<<pluginID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   185
	qDebug()<<"Interface = "<<interfaceID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   186
	qDebug()<<"RequestType = "<<requestTypeID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   187
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   188
	//TODO:-PM should take page info too
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   189
	SmfError err = m_pluginManager->createRequest(requestID,pluginID,requestTypeID,dataForPlugin);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   190
	qDebug()<<"m_pluginManager->createRequest() = "<<err;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   191
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   192
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   193
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   194
 * Request the Plugin manager to get the data.
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   195
 * @param requestID Corresponds to a client's session
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   196
 * @param pluginID Plugin for which the request is intended
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   197
 * @param interfaceID Interface name
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   198
 * @param dataForPlugin Data to be sent for this request
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   199
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   200
SmfError SmfServer::sendToPluginManager ( SmfPluginID pluginID, 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   201
		SmfInterfaceID interfaceID, SmfRequestTypeID requestTypeID,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   202
		QByteArray dataForPlugin, QByteArray &outputData)
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   203
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   204
	qDebug()<<"Inside SmfServer::sendToPluginManager() for sync req";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   205
	qDebug()<<"PluginID = "<<pluginID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   206
	qDebug()<<"Interface = "<<interfaceID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   207
	qDebug()<<"RequestType = "<<requestTypeID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   208
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   209
	//TODO:-PM should take page info too
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   210
	SmfError err = m_pluginManager->createSyncRequest(pluginID,requestTypeID,dataForPlugin, outputData);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   211
	qDebug()<<"m_pluginManager->createSyncRequest() = "<<err;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   212
	return err;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   213
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   214
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   215
SmfError SmfServer::sendToDSM ( QByteArray qtdataForDSM, SmfRequestTypeID opcode,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   216
		QByteArray& qtdataFromDSM )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   217
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   218
	qDebug()<<"Inside SmfServer::sendToDSM()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   219
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   220
	DataStoreManager* dsm = DataStoreManager::getDataStoreManager();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   221
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   222
	//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
   223
	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
   224
	QDataStream writeStream(&qtdataFromDSM,QIODevice::ReadOnly);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   225
	quint8 flag = 0;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   226
	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
   227
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   228
		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
   229
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   230
			//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
   231
			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
   232
			SmfContact contact;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   233
			readStream>>flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   234
			if(flag)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   235
				readStream>>provider;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   236
			readStream>>flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   237
			if(flag)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   238
				readStream>>contact;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   239
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   240
			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
   241
			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
   242
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   243
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   244
		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
   245
			{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   246
			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
   247
			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
   248
			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
   249
			readStream>>relnId;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   250
			readStream>>flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   251
			if(flag)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   252
				readStream>>contact;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   253
			readStream>>flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   254
			if(flag)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   255
				readStream>>provider;
14
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
			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
   258
			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
   259
			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
   260
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   261
			break;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   262
		case SmfRelationRemove:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   263
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   264
			SmfRelationId relnId;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   265
			SmfContact contact;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   266
			readStream>>relnId;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   267
			readStream>>flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   268
			if(flag)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   269
				readStream>>contact;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   270
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   271
			SmfError err = dsm->remove(relnId, &contact);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   272
			int errInt = err;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   273
			writeStream<<errInt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   274
			break;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   275
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   276
		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
   277
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   278
			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
   279
			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
   280
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   281
			SmfRelationItem* relnItem = dsm->searchById(relnId);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   282
			quint8 flag = 1;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   283
			if(relnItem)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   284
				{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   285
				writeStream<<flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   286
				writeStream<<*(relnItem);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   287
				}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   288
			else
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   289
				{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   290
				flag = 0;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   291
				writeStream<<flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   292
				}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   293
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   294
			break;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   295
		case SmfRelationSearchByContact:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   296
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   297
			SmfContact contact;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   298
			readStream>>contact;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   299
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   300
			SmfRelationId relnId = dsm->searchByContact(contact);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   301
			writeStream<<relnId;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   302
			break;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   303
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   304
		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
   305
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   306
			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
   307
			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
   308
			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
   309
			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
   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
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   312
		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
   313
			{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   314
			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
   315
			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
   316
			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
   317
			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
   318
			SmfRelationItem* relnItem = dsm->getContact(relationId,index);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   319
			quint8 flag = 1;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   320
			if(relnItem)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   321
				{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   322
				writeStream<<flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   323
				writeStream<<*(relnItem);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   324
				}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   325
			else
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   326
				{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   327
				flag = 0;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   328
				writeStream<<flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   329
				}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   330
			break;
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   331
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   332
		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
   333
			{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   334
			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
   335
			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
   336
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   337
			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
   338
			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
   339
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   340
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   341
		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
   342
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   343
			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
   344
			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
   345
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   346
			break;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   347
		case SmfRelationDeleteRelation:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   348
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   349
			SmfRelationId relnId;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   350
			readStream>>relnId;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   351
			SmfError err = dsm->deleteRelation(relnId);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   352
			int errInt = err;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   353
			writeStream<<errInt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   354
			break;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   355
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   356
		default:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   357
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   358
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   359
	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
   360
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   361
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   362
/**
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   363
 * 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
   364
 * @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
   365
 */
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   366
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
   367
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   368
	qDebug()<<"Inside SmfServer::clientAuthorizationFinished()";
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   369
	//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
   370
	//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
   371
	//TODO:- define set of smf wide error after consulting with other module owners
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   372
	authID.session->clientAuthorizationFinished(success);
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   373
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   374
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   375
/**
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   376
 * 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
   377
 * @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
   378
 * @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
   379
 * @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
   380
 * 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
   381
 */
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   382
void SmfServer::resultsAvailable ( int requestID, QByteArray* parsedData, SmfError error )
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   383
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   384
	qDebug()<<"Inside SmfServer::resultsAvailable()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   385
	qDebug()<<"requestID = "<<requestID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   386
	qDebug()<<"parsedData->size() = "<<parsedData->size();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   387
	qDebug()<<"Error = "<<error;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   388
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   389
	//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
   390
	QByteArray dataWithError;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   391
	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
   392
	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
   393
	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
   394
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   395
		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
   396
		}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   397
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   398
	//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
   399
	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
   400
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   401
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   402
/**
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   403
 * 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
   404
 * @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
   405
 * @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
   406
 */
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   407
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
   408
	{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   409
	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
   410
	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
   411
	//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
   412
	//CMclient->requestAuthExpiryNotify();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   413
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   414
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   415
#ifdef CLIENT_SERVER_TEST
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   416
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   417
 * Seems reduntant
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   418
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   419
/*void SmfServer::serviceClient(QByteArray* parsedData)
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   420
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   421
	Q_UNUSED(parsedData)
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   422
	}*/
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   423
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   424
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
   425
: 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
   426
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   427
	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
   428
	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
   429
	}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   430
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
   431
		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
   432
		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
   433
		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
   434
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   435
	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
   436
	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
   437
	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
   438
	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
   439
	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
   440
	}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   441
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
   442
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   443
	
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   444
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   445
#endif