smf/smfservermodule/smfserver/server/smfserver.cpp
author cgandhi
Thu, 23 Sep 2010 17:43:31 +0530
changeset 25 a180113055cb
parent 18 013a02bf2bb0
child 26 83d6a149c755
permissions -rw-r--r--
Music Events are now normal Fetcher APIs added All APIs now return SmfError Canceling Request now supported Music Search now based on category Providerinfo added in DSM Added secondary ID, count, location to SMFAlbum Tags for Artist added Get tracks for album and artist added Added URL to subtitle DSM Bug fixes Detailed debugging logs filtered in server, pluginmgr, transportmgr playlistsOf() method changed in smfclient and plugin interfaces. RVCT B686 compilation issues resolved.
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
	{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    70
	bool success = false;
18
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
	//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
    73
	SmfTransportInitializeResult networkStatus = prepareTransport();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    74
	
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
	m_pluginManager = SmfPluginManager::getInstance(this);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    76
	qDebug()<<"After m_pluginManager construction";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    77
	
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_dataStoreManager = new SmfDataStoreManager();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    79
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    80
#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
    81
	//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
    82
	TRAPD(err, m_SmfServerPrivate = SmfServerSymbian::NewL(CActive::EPriorityStandard,this));
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    83
	qDebug()<<"SmfServerSymbian::NewL() = "<<err;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    84
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
    85
	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
    86
		return success;
18
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
	TInt error = m_SmfServerPrivate->Start( KSmfServerName );
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    89
	qDebug()<<"m_SmfServerPrivate->Start = "<<error;
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
    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
    92
    User::LeaveIfError( semaphore.OpenGlobal( KSmfServerSemaphoreName ) );
18
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
    // 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
    95
    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
    96
    semaphore.Close();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    97
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
    98
	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
    99
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   100
		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
   101
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   102
	else 
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
		//error
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   105
		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
   106
		}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   107
#else
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   108
	// For non-symbian platforms
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   109
	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
   110
	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
   111
	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
   112
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   113
		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
   114
		}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   115
#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
   116
	
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   117
	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
   118
    return success;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   119
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   120
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   121
//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
   122
/**
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   123
 * 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
   124
 * @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
   125
 * @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
   126
 * 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
   127
 * 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
   128
 * 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
   129
 */
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   130
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
   131
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   132
	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
   133
	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
   134
	}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   135
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   136
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
   137
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   138
	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
   139
	SmfPluginID id;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   140
	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
   141
	return id;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   142
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   143
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   144
/**
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   145
 * 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
   146
 * @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
   147
 * @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
   148
 * 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
   149
 * 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
   150
 * 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
   151
 */
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   152
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
   153
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   154
	qDebug()<<"Inside SmfServer::getAuthorizedPlugins()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   155
	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
   156
	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
   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
		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
   159
		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
   160
			authList.append(list[i]);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   161
		}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   162
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   163
14
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 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
   165
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   166
	m_transportManager = SmfTransportManager::getInstance();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
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
	//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
   169
	SmfTransportInitializeResult networkStatus = m_transportManager->initializeTransport();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   170
	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
   171
	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
   172
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   173
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   174
SmfError SmfServer::sendToPluginManager ( int requestID, SmfPluginID pluginID, 
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   175
		SmfInterfaceID interfaceID, SmfRequestTypeID requestTypeID, 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   176
		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
   177
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   178
	qDebug()<<"Inside SmfServer::sendToPluginManager()";
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   179
	Q_UNUSED(interfaceID)
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   180
#ifdef DETAILEDDEBUGGING
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   181
	qDebug()<<"Request ID = "<<requestID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   182
	qDebug()<<"PluginID = "<<pluginID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   183
	qDebug()<<"Interface = "<<interfaceID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   184
	qDebug()<<"RequestType = "<<requestTypeID;
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   185
#endif
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   186
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   187
	//TODO:-PM should take page info too
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   188
	SmfError err = m_pluginManager->createRequest(requestID,pluginID,requestTypeID,dataForPlugin);
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   189
	qDebug()<<"m_pluginManager->createRequest() ret value = "<<err;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   190
	
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   191
	return 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
   192
	}
18
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
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   195
 * Request the Plugin manager to get the data.
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   196
 * @param requestID Corresponds to a client's session
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   197
 * @param pluginID Plugin for which the request is intended
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   198
 * @param interfaceID Interface name
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   199
 * @param dataForPlugin Data to be sent for this request
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   200
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   201
SmfError SmfServer::sendToPluginManager ( SmfPluginID pluginID, 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   202
		SmfInterfaceID interfaceID, SmfRequestTypeID requestTypeID,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   203
		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
   204
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   205
	qDebug()<<"Inside SmfServer::sendToPluginManager() for sync req";
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   206
	Q_UNUSED(interfaceID)
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   207
#ifdef DETAILEDDEBUGGING
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   208
	qDebug()<<"PluginID = "<<pluginID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   209
	qDebug()<<"Interface = "<<interfaceID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   210
	qDebug()<<"RequestType = "<<requestTypeID;
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   211
#endif
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   212
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   213
	//TODO:-PM should take page info too
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   214
	SmfError err = m_pluginManager->createSyncRequest(pluginID,requestTypeID,dataForPlugin, outputData);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   215
	qDebug()<<"m_pluginManager->createSyncRequest() = "<<err;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   216
	return err;
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
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   219
SmfError SmfServer::sendToDSM ( QByteArray qtdataForDSM, SmfRequestTypeID opcode,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   220
		QByteArray& qtdataFromDSM )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   221
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   222
	qDebug()<<"Inside SmfServer::sendToDSM()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   223
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   224
	DataStoreManager* dsm = DataStoreManager::getDataStoreManager();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   225
	
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
	//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
   227
	QDataStream readStream(&qtdataForDSM,QIODevice::ReadOnly);
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   228
	QDataStream writeStream(&qtdataFromDSM,QIODevice::WriteOnly);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   229
	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
   230
	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
   231
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   232
		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
   233
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   234
			//read the incoming data
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   235
			SmfProvider *provider = new SmfProvider();
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   236
			SmfContact *contact = new SmfContact();
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   237
			readStream>>flag;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   238
			if(flag)
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   239
				readStream>>*provider;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   240
			else 
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   241
				{
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   242
				delete provider;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   243
				provider = NULL;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   244
				}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   245
			readStream>>flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   246
			if(flag)
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   247
				readStream>>*contact;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   248
			else 
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   249
				{
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   250
				delete contact;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   251
				contact = NULL;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   252
				}
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   253
			SmfRelationId relnId = dsm->create(provider,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
   254
			writeStream<<relnId;
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   255
			if(provider != NULL)
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   256
				delete provider;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   257
			if(contact != NULL)
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   258
				delete 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
   259
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   260
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   261
		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
   262
			{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   263
			SmfRelationId relnId;
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   264
			SmfContact *contact = new SmfContact();
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   265
			SmfProvider *provider = new 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
   266
			readStream>>relnId;
18
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)
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   269
				readStream>>*contact;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   270
			else 
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   271
				{
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   272
				delete contact;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   273
				contact = NULL;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   274
				}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   275
			readStream>>flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   276
			if(flag)
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   277
				readStream>>*provider;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   278
			else 
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   279
				{
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   280
				delete provider;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   281
				provider = NULL;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   282
				}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   283
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   284
			QString snsName = provider->serviceName();
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   285
			QString snsUrl = (provider->serviceUrl()).toString();
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   286
			QString snsDesc = provider->description();
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   287
			
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   288
			SmfError err = dsm->associate(relnId,contact,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
   289
			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
   290
			writeStream<<errInt;
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   291
			if(contact != NULL)
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   292
				delete contact;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   293
			if(provider != NULL)
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   294
				delete 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
   295
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   296
			break;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   297
		case SmfRelationRemove:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   298
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   299
			SmfRelationId relnId;
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   300
			SmfContact *contact = new SmfContact();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   301
			readStream>>relnId;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   302
			readStream>>flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   303
			if(flag)
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   304
				readStream>>*contact;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   305
			else 
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   306
				{
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   307
				delete contact;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   308
				contact = NULL;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   309
				}
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   310
			SmfError err = dsm->remove(relnId, contact);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   311
			int errInt = err;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   312
			writeStream<<errInt;
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   313
			if(NULL != contact)
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   314
				delete contact;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   315
			break;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   316
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   317
		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
   318
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   319
			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
   320
			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
   321
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   322
			SmfRelationItem* relnItem = dsm->searchById(relnId);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   323
			quint8 flag = 1;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   324
			if(relnItem)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   325
				{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   326
				writeStream<<flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   327
				writeStream<<*(relnItem);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   328
				}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   329
			else
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   330
				{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   331
				flag = 0;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   332
				writeStream<<flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
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
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   335
			break;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   336
		case SmfRelationSearchByContact:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   337
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   338
			SmfContact contact;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   339
			readStream>>contact;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   340
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   341
			SmfRelationId relnId = dsm->searchByContact(contact);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   342
			writeStream<<relnId;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   343
			break;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   344
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   345
		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
   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
			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
   348
			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
   349
			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
   350
			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
   351
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   352
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   353
		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
   354
			{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   355
			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
   356
			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
   357
			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
   358
			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
   359
			SmfRelationItem* relnItem = dsm->getContact(relationId,index);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   360
			quint8 flag = 1;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   361
			if(relnItem)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   362
				{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   363
				writeStream<<flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   364
				writeStream<<*(relnItem);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   365
				}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   366
			else
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   367
				{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   368
				flag = 0;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   369
				writeStream<<flag;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   370
				}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   371
			break;
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   372
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   373
		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
   374
			{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   375
			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
   376
			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
   377
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   378
			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
   379
			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
   380
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   381
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   382
		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
   383
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   384
			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
   385
			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
   386
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   387
			break;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   388
		case SmfRelationDeleteRelation:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   389
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   390
			SmfRelationId relnId;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   391
			readStream>>relnId;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   392
			SmfError err = dsm->deleteRelation(relnId);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   393
			int errInt = err;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   394
			writeStream<<errInt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   395
			break;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   396
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   397
		default:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   398
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   399
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   400
	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
   401
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   402
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   403
/**
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   404
 * 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
   405
 * @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
   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::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
   408
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   409
	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
   410
	//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
   411
	//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
   412
	//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
   413
	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
   414
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   415
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   416
/**
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   417
 * 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
   418
 * @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
   419
 * @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
   420
 * @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
   421
 * 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
   422
 */
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   423
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
   424
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   425
	qDebug()<<"Inside SmfServer::resultsAvailable()";
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   426
#ifdef DETAILEDDEBUGGING
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   427
	qDebug()<<"requestID = "<<requestID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   428
	qDebug()<<"parsedData->size() = "<<parsedData->size();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   429
	qDebug()<<"Error = "<<error;
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   430
#endif
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   431
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   432
	//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
   433
	QByteArray dataWithError;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   434
	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
   435
	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
   436
	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
   437
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   438
		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
   439
		}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   440
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   441
	//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
   442
	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
   443
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   444
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   445
/**
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   446
 * 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
   447
 * @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
   448
 * @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
   449
 */
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   450
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
   451
	{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   452
	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
   453
	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
   454
	//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
   455
	//CMclient->requestAuthExpiryNotify();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   456
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   457
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   458
#ifdef CLIENT_SERVER_TEST
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   459
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   460
 * Seems reduntant
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   461
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   462
/*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
   463
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   464
	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
   465
	}*/
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   466
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   467
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
   468
: 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
   469
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   470
	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
   471
	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
   472
	}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   473
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
   474
		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
   475
		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
   476
		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
   477
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   478
	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
   479
	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
   480
	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
   481
	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
   482
	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
   483
	}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   484
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
   485
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   486
	
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 13
diff changeset
   487
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   488
#endif