smf/smfservermodule/smfserver/server/smfserversymbian.cpp
author cgandhi
Mon, 11 Oct 2010 21:59:54 +0530
changeset 26 83d6a149c755
parent 25 a180113055cb
permissions -rw-r--r--
Submitting following changes - AuthApps for Last.fm and Twitter added API for checking ServiceAuthorization added for SMFCredMgrClient API added for forcefully removing credential details from SMFCredMgr Extra argument checks in SMfClient APIs APIs for service login and logout from SMFClient Redundant members removed from SmfServerSymbian DSM bug fixes Test Apps included
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
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     5
 * under the terms of the "Eclipse Public License v1.0" 
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     6
 * which accompanies  this distribution, and is available
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html"
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     8
 *
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     9
 * Initial Contributors:
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    10
 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    11
 *
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    12
 * Contributors:
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    13
 * Manasij Roy, Nalina Hariharan
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    14
 * 
18
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 private implementation for Symbian
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    17
 *
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    18
 */
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    19
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    20
#include <QDataStream>
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    21
#include <QDebug>
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
    22
#include <smfrelationmgr.h>
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    23
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    24
#include "smfpluginmanager.h"
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    25
#include "smfserversymbian_p.h"
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    26
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    27
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    28
SmfServerSymbian* SmfServerSymbian::NewL(CActive::TPriority aActiveObjectPriority,SmfServer* aWrapper)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    29
	{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    30
	SmfServerSymbian* self = new(ELeave) SmfServerSymbian(aActiveObjectPriority,aWrapper);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    31
	CleanupStack::PushL(self);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    32
	self->ConstructL();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    33
	CleanupStack::Pop();
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    34
	return self;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    35
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    36
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    37
void SmfServerSymbian::ConstructL()
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    38
	{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    39
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    40
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    41
SmfServerSymbian::SmfServerSymbian( CActive::TPriority aActiveObjectPriority,SmfServer* aWrapper )
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    42
: CPolicyServer(0,myPolicy, ESharableSessions), iWrapper(aWrapper)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    43
	{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
    44
	Q_UNUSED(aActiveObjectPriority)
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    45
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    46
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    47
SmfServerSymbian::~SmfServerSymbian()
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    48
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    49
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    50
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    51
TInt SmfServerSymbian::addToSessionMap(SmfServerSymbianSession* aSession,const RMessage2& aMsg)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    52
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    53
	qDebug()<<"Inside SmfServerSymbian::addToSessionMap()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    54
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    55
	if(iSessionCount)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    56
		{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    57
		//The key generation 
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    58
		TInt key = qrand();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    59
		//in case qrand generates any duplicate key
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    60
		while(iMap.Find(key))
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    61
			{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    62
			key = qrand();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    63
			}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    64
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    65
		CSessionStruct session;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    66
		session.iMsg = aMsg;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    67
		session.iSession = aSession;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    68
		iMap.Insert(key,session); 
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
		return key;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    71
		}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    72
	
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    73
	return (-1);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    74
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    75
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    76
TInt SmfServerSymbian::removeFromSessionMap(SmfServerSymbianSession* aSession,RMessage2& aMsg)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    77
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    78
	//To be implemented
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
    79
	Q_UNUSED(aSession)
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    80
	Q_UNUSED(aMsg)
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    81
	return 0;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    82
	}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    83
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    84
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    85
SmfServer* SmfServerSymbian::wrapper()
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    86
	{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    87
	return iWrapper;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    88
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    89
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    90
CSession2* SmfServerSymbian::NewSessionL(const TVersion& aVersion, const RMessage2& /*aMessage*/) const
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    91
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    92
	qDebug()<<"Inside SmfServerSymbian::NewSessionL()";
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: 10
diff changeset
    94
	Q_UNUSED(aVersion)
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    95
	// Check that the version is OK
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    96
	//    TVersion v( 0, 1, 0 );
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    97
	//    if (!User::QueryVersionSupported( v, aVersion ))
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    98
	//        User::Leave( KErrNotSupported ); 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    99
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   100
	// Create the session.
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   101
	qDebug()<<"New session created";
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   102
	return new (ELeave) SmfServerSymbianSession( const_cast<SmfServerSymbian*>(this) );
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   103
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   104
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   105
SmfServerSymbianSession* SmfServerSymbian::findSession(TInt id)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   106
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   107
	qDebug()<<"Inside SmfServerSymbian::findSession()";
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   108
	CSessionStruct* sessionStruct = iMap.Find(id);	
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   109
	if(sessionStruct)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   110
		{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   111
		qDebug()<<"Session id found";
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   112
		return sessionStruct->iSession;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   113
		}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   114
	else
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   115
		{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   116
		qDebug()<<"Session id not found";
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   117
		return NULL;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   118
		}
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
TInt SmfServerSymbian::findAndServiceclient(TInt requestID,QByteArray* parsedData,SmfError error)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   122
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   123
	qDebug()<<"Inside SmfServerSymbian::findAndServiceclient()";
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   124
	SmfServerSymbianSession* sessionToservice = findSession(requestID);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   125
	if(sessionToservice)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   126
		{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   127
		sessionToservice->resultsAvailable(parsedData,error);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   128
		}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   129
	return 0;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   130
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   131
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   132
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   133
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   134
SmfServerSymbianSession::SmfServerSymbianSession(SmfServerSymbian* aServer):
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 25
diff changeset
   135
			iServer(aServer), iIntfNameSymbian8(NULL,0),
83d6a149c755 Submitting following changes -
cgandhi
parents: 25
diff changeset
   136
			iProviderSymbian8(NULL,0), iXtraDataPtr8(NULL,0), 
83d6a149c755 Submitting following changes -
cgandhi
parents: 25
diff changeset
   137
			iPtr8DataForDSM(NULL,0), iPtr8DataFromDSM(NULL,0), 
83d6a149c755 Submitting following changes -
cgandhi
parents: 25
diff changeset
   138
			iPtrToDataForClient(NULL,0)  
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   139
	{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   140
	iServer->iSessionCount++;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   141
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   142
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   143
SmfServerSymbianSession::~SmfServerSymbianSession()
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   144
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   145
	qDebug()<<"Inside SmfServerSymbianSession::~SmfServerSymbianSession()";
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   146
	//cleanup of client resources
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   147
	iServer->iSessionCount--;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   148
	}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   149
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 25
diff changeset
   150
#ifdef Q_FOR_FUTURE 
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   151
void SmfServerSymbianSession::clientAuthorizationFinished(bool success)
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   152
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   153
	qDebug()<<"Inside SmfServerSymbianSession::clientAuthorizationFinished() = "<<success;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   154
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   155
	//Client authorization failed
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   156
	if(!success)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   157
		{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   158
		//TODO:- Should use smf wide error instead
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   159
		iMessage.Complete(KErrPermissionDenied);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   160
		}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   161
	else
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   162
		{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   163
		HandleClientMessageL(iMessage);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   164
		}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   165
	}
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 25
diff changeset
   166
#endif
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   167
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   168
void SmfServerSymbianSession::resultsAvailable(QByteArray* parsedData,SmfError error)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   169
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   170
	qDebug()<<"Inside SmfServerSymbianSession::resultsAvailable()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   171
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   172
	//Note:- The order of serialization of parsedData - Error value followed by the data
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   173
	//parsedData is already serialized by PM
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   174
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   175
	//We should remove the request from the map as soon its no longer outstanding
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   176
	iServer->removeFromSessionMap(this,iMessage);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   177
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   178
	//Note:- Session must take the ownership of the data being passed to the client session
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   179
	if(iDataForClient)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   180
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   181
		delete iDataForClient;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   182
		iDataForClient = NULL;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   183
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   184
	iDataForClient = HBufC8::NewL(parsedData->size());
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   185
	iPtrToDataForClient.Set(iDataForClient->Des());
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   186
	iPtrToDataForClient.Copy(reinterpret_cast<const TText8*>(parsedData->constData()),parsedData->length());
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   187
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   188
	TInt writeErr = iMessage.Write(2,iPtrToDataForClient);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   189
	qDebug()<<"iMessage.Write() = "<<writeErr;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   190
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   191
	//signal completion for the last request
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   192
	iMessage.Complete(error);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   193
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   194
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   195
void SmfServerSymbianSession::ServiceL(const RMessage2& aMessage)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   196
	{    
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   197
	qDebug()<<"Inside SmfServerSymbianSession::ServiceL() = "<<iMessage.Function();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   198
	iMessage = aMessage;
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   199
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 25
diff changeset
   200
83d6a149c755 Submitting following changes -
cgandhi
parents: 25
diff changeset
   201
#ifdef Q_FOR_FUTURE 
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   202
	//construct the client auth id
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   203
	SmfClientAuthID clientAuthID;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   204
	clientAuthID.pid = aMessage.SecureId();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   205
	clientAuthID.session = this;
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 25
diff changeset
   206
#endif
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   207
	//TODO:- No client pid checking?No capability? So why symbian client-server?
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   208
	HandleClientMessageL(iMessage);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   209
	}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   210
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   211
void SmfServerSymbianSession::HandleClientMessageL(const RMessage2& aMessage)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   212
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   213
	qDebug()<<"Inside SmfServerSymbianSession::HandleClientMessageL() = "<<aMessage.Function();
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   214
	
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   215
	/**Note:- Only ESmfGetService needs to be taken care separately as it doesn't involve createrequest for PM
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   216
	 *See SmfRequestTypeID for list of opcodes
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   217
	 *
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   218
	 *Two cases,-
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   219
	 *1.for ESmfGetServices we donno the provider info
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   220
	 *2. for rest of the cases, we know the provider info
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   221
	 *so it seems PM needs to provide two overloaded getPlugins API But for every client intf instanciation
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   222
	 *we would execute the same things twice.
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   223
	 *TODO:- to be changed after GetServices returns SmfProvider+pluginID 
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 25
diff changeset
   224
	 * 
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   225
	 */
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   226
	if( (SmfGetService == aMessage.Function()) 			||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   227
		(SmfPostGetMaxCharsInPost == aMessage.Function())	||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   228
		(SmfPostGetMaxItems == aMessage.Function())		||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   229
		(SmfPostGetSupportedFormats == aMessage.Function())||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   230
		(SmfPostGetAppearanceSupport == aMessage.Function()))
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   231
			
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   232
		{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   233
		HandleSyncServiceL(aMessage);
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   234
		}
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   235
	else if (SmfCancelRequest == aMessage.Function())
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   236
		{
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   237
		HandleCancelRequest(aMessage);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   238
		}
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   239
	else if(aMessage.Function() == SmfRelationCreate ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   240
			aMessage.Function() == SmfRelationAssociate || 
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   241
			aMessage.Function() == SmfRelationSearchById ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   242
			aMessage.Function() == SmfRelationSearchByContact ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   243
			aMessage.Function() == SmfRelationCount ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   244
			aMessage.Function() == SmfRelationGet ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   245
			aMessage.Function() == SmfRelationGetAll ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   246
			aMessage.Function() == SmfRelationGetAllRelations ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   247
			aMessage.Function() == SmfRelationDeleteRelation ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   248
			aMessage.Function() == SmfRelationRemove
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   249
			)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   250
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   251
		HandleDSMServiceL(aMessage);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   252
		}
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   253
	else
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   254
		{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   255
		HandleCommonServiceL(aMessage);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   256
		}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   257
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   258
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   259
void SmfServerSymbianSession::HandleCancelRequest(const RMessage2 & aMessage)
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   260
	{
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   261
	SmfError err = SmfNoError;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   262
	// iLastRequest contains the last operations opcode, cwhich is to be cancelled.
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   263
	bool ret = SmfPluginManager::getInstance(iServer->wrapper())->cancelRequest(iLastRequest);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   264
	
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   265
	iErrBuf.Zero();
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   266
	iErrBuf.AppendNum(err);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   267
	iMessage.Write(2,iErrBuf);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   268
	aMessage.Complete(iLastRequest);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   269
	
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   270
	}
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   271
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   272
void SmfServerSymbianSession::HandleDSMServiceL(const RMessage2 & aMessage)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   273
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   274
	qDebug()<<"Inside SmfServerSymbianSession::HandleDSMServiceL()";
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   275
	iLastRequest = aMessage.Function();
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   276
	//TODO:-If DSM takes care of deserialization and formation of User and social 
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   277
	//profile from the params then switch case can be removed
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   278
	if(iData8ForDSM)
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   279
		{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   280
		delete iData8ForDSM;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   281
		iData8ForDSM = NULL;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   282
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   283
	
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   284
	switch(iLastRequest)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   285
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   286
		case SmfRelationCreate:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   287
			{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   288
			iData8ForDSM = HBufC8::New(maxSmfRelationIdSize);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   289
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   290
			TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); 
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   291
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   292
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   293
		case SmfRelationAssociate:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   294
			{
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   295
			int maxAlloc = 1000;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   296
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   297
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   298
			TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); 
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   299
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   300
			break;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   301
		case SmfRelationRemove:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   302
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   303
			iData8ForDSM = HBufC8::New(100);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   304
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   305
			TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   306
			break;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   307
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   308
		case SmfRelationSearchById:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   309
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   310
			int maxAlloc = MaxSmfContactSize;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   311
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   312
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   313
			TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   314
			}
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
		case SmfRelationSearchByContact:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   317
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   318
			int maxAlloc = 500; // hard coded in relation manager
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   319
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   320
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   321
			TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); 
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   322
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   323
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   324
		case SmfRelationCount:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   325
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   326
			int maxAlloc = 100;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   327
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   328
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   329
			TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM);
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   330
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   331
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   332
		case SmfRelationGet:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   333
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   334
			int maxAlloc = maxSmfRelationItemSize*maxRelationItems;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   335
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   336
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   337
			TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); 
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   338
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   339
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   340
		case SmfRelationGetAll:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   341
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   342
			int maxAlloc = maxSmfRelationItemSize*maxRelationItems;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   343
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   344
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   345
			TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); 
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   346
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   347
			break;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   348
		case SmfRelationGetAllRelations:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   349
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   350
			int maxAlloc = maxSmfRelationItemSize*maxRelationItems;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   351
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   352
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   353
			TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); 
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
			}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   356
		case SmfRelationDeleteRelation:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   357
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   358
			int maxAlloc = 100;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   359
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   360
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   361
			TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   362
			break;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   363
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   364
		default:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   365
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   366
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   367
	//Convert into QByteArray
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   368
	QByteArray qtdataForDSM(reinterpret_cast<const char*>(iPtr8DataForDSM.Ptr()),iPtr8DataForDSM.Length()) ;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   369
	QByteArray qtdataFromDSM;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   370
	SmfRequestTypeID opcode = (SmfRequestTypeID)iLastRequest;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   371
	SmfError dsmErr = iServer->wrapper()->sendToDSM(qtdataForDSM,opcode,qtdataFromDSM);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   372
	if(dsmErr == SmfNoError)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   373
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   374
		if(qtdataFromDSM.size())
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   375
			{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   376
			if(iData8FromDSM)
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   377
				{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   378
				delete iData8FromDSM;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   379
				iData8FromDSM = NULL;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   380
				}
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   381
			int siz = qtdataFromDSM.size();
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   382
			qDebug()<<"Size of Data to be sent back thru DSM Create : "<<siz;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   383
			iData8FromDSM = HBufC8::NewL(qtdataFromDSM.size());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   384
			iPtr8DataFromDSM.Set(iData8FromDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   385
			iPtr8DataFromDSM.Copy(reinterpret_cast<const TText8*>(qtdataFromDSM.constData()),qtdataFromDSM.length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   386
			TInt writeErr = aMessage.Write(1,iPtr8DataFromDSM);
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 25
diff changeset
   387
			iDSMErr.Zero();
83d6a149c755 Submitting following changes -
cgandhi
parents: 25
diff changeset
   388
			TInt errInt = dsmErr;
83d6a149c755 Submitting following changes -
cgandhi
parents: 25
diff changeset
   389
			iDSMErr.AppendNum(errInt);
83d6a149c755 Submitting following changes -
cgandhi
parents: 25
diff changeset
   390
			writeErr = aMessage.Write(2,iDSMErr);
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   391
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   392
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   393
	else
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   394
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   395
		iDSMErr.Zero();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   396
		TInt errInt = dsmErr;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   397
		iDSMErr.AppendNum(errInt);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   398
		TInt writeErr = aMessage.Write(2,iDSMErr);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   399
		}
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   400
	aMessage.Complete(iLastRequest);
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   401
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   402
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   403
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   404
void SmfServerSymbianSession::HandleSyncServiceL(const RMessage2 & aMessage)
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   405
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   406
	qDebug()<<"Inside SmfServerSymbianSession::HandleSyncServiceL()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   407
	
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   408
	iLastRequest = aMessage.Function();
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   409
	
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   410
	// Following is the data format sent by client
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   411
	// 1. SmfProvider +PageInfo flag+ aPageNum + aPerPage (if pageinfoflag is set) + XtraInfo flag(size of xtra data) Serialized 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   412
	// 2. Interface name as string ("org.symbian.smf.client.gallery")
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   413
	// 3. Data pointer to be filled by serialized data(eg: QList<smfProvider>)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   414
	// 4. Input Data if xtra flag is set
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   415
	
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   416
	TInt intfNameSize = aMessage.GetDesLength(1);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   417
	if(iIntfNameBuf8)
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
		delete iIntfNameBuf8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   420
		iIntfNameBuf8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   421
		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   422
	iIntfNameBuf8 = HBufC8::NewL(intfNameSize);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   423
	iIntfNameSymbian8.Set(iIntfNameBuf8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   424
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   425
	//read it into iIntfNameSymbian8
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   426
	aMessage.ReadL(1,iIntfNameSymbian8);
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   427
	
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   428
	QByteArray intfName(reinterpret_cast<const char*>(iIntfNameSymbian8.Ptr()),iIntfNameSymbian8.Length()) ;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   429
	QDataStream readIntfNameStream(&intfName,QIODevice::ReadOnly);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   430
	iInterfaceID.clear();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   431
	readIntfNameStream>>iInterfaceID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   432
	qDebug()<<"After de-serializing into iInterfaceID = "<<iInterfaceID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   433
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   434
	//Interface names are diff in client and plugin, replacing *.client.* with *.plugin.*
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   435
	iInterfaceID.replace(QString(".client"),QString(".plugin"));
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   436
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   437
	// for get services
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   438
	if(SmfGetService == aMessage.Function())
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   439
		HandleGetService(aMessage, iInterfaceID);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   440
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   441
	// for other services
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   442
	else
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   443
		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   444
		// read provider info
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   445
		TInt providerSize = aMessage.GetDesLength(0);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   446
		if(iProviderBuf8)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   447
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   448
			delete iProviderBuf8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   449
			iProviderBuf8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   450
			}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   451
		iProviderBuf8 = HBufC8::NewL(providerSize);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   452
		iProviderSymbian8.Set(iProviderBuf8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   453
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   454
		//read it into iProviderSymbian8
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   455
		aMessage.ReadL(0,iProviderSymbian8);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   456
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   457
		//convert SmfProvider info from Symbian into bytearray
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   458
		QByteArray providerBufQt(reinterpret_cast<const char*>(iProviderSymbian8.Ptr()),iProviderSymbian8.Length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   459
		qDebug()<<"providerBufQt.size = "<<providerBufQt.size();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   460
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   461
		//now de-serialize it
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   462
		QDataStream readProviderStream(&providerBufQt,QIODevice::ReadOnly);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   463
		SmfProvider provider;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   464
		readProviderStream>>provider;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   465
		QByteArray XtraBufQt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   466
		readProviderStream>>XtraBufQt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   467
		
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   468
		//Get the plugin ID who matches provider info for a given intf name
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   469
		SmfPluginID pluginID = iServer->wrapper()->getPlugin(iInterfaceID,provider);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   470
		qDebug()<<"pluginID from PM = "<<pluginID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   471
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   472
		//we need to check only this pluginID is authorized
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   473
		iPluginIDList.clear();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   474
		iPluginIDList<<pluginID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   475
		
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   476
		//iAuthList will contain pluginID for a successfull case
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   477
		iAuthList.clear();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   478
		iServer->wrapper()->getAuthorizedPlugins(iPluginIDList,iAuthList);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   479
		
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   480
		if(iAuthList.contains(pluginID))
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   481
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   482
			//Plugin ID is authorised, service the request
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   483
			//Generate request id only if the plugin ID is authorised
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   484
			//request PM to get the data
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   485
			SmfRequestTypeID opcode = (SmfRequestTypeID)aMessage.Function();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   486
			resultData.clear();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   487
			SmfError err = iServer->wrapper()->sendToPluginManager(pluginID,iInterfaceID,opcode,XtraBufQt, resultData);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   488
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   489
			if(resultData.size())
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   490
				{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   491
				TPtrC8 resultPtr8(reinterpret_cast<const TText8*>(resultData.constData()),resultData.length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   492
				
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   493
				TInt writeErr = aMessage.Write(2,resultPtr8);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   494
				qDebug()<<"aMessage.Write(2) = "<<writeErr;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   495
				}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   496
			else
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   497
				{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   498
				iErrBuf.Zero();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   499
				iErrBuf.AppendNum(err);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   500
				iMessage.Write(2,iErrBuf);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   501
				}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   502
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   503
			//signal completion
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   504
			aMessage.Complete(iLastRequest);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   505
			}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   506
		else
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   507
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   508
			SmfError err = SmfNoAuthorizedPlugin;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   509
			iErrBuf.Zero();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   510
			iErrBuf.AppendNum(err);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   511
			iMessage.Write(2,iErrBuf);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   512
			aMessage.Complete(iLastRequest);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   513
			}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   514
		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   515
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   516
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   517
void SmfServerSymbianSession::HandleGetService(const RMessage2 & aMessage, const SmfInterfaceID& aInterfaceID)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   518
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   519
	qDebug()<<"Inside SmfServerSymbianSession::HandleGetService()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   520
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   521
	iServer->wrapper()->getPlugins(aInterfaceID,iPluginIDMap);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   522
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   523
	//form the plugin id list from the map
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   524
	iPluginIDList.clear();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   525
	iPluginIDList = iPluginIDMap.uniqueKeys();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   526
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   527
	//iAuthList will be filled by credential manager
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   528
	iServer->wrapper()->getAuthorizedPlugins(iPluginIDList,iAuthList);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   529
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   530
	// iPluginIDMap now contains SmfProvider info to return to the client
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   531
	// No need to add this to session map, as we are not requesting PM for this
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   532
	QMap<SmfPluginID, SmfProvider> tempMap;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   533
	QMapIterator<SmfPluginID, SmfProvider> i(iPluginIDMap);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   534
	while(i.hasNext()) 
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   535
		{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   536
		i.next();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   537
		if(iAuthList.contains(i.key()))
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   538
			{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   539
			tempMap.insert(i.key(),i.value());
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   540
			}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   541
		}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   542
	//now tempMap contains the info to be passed to the client
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   543
	iPluginIDMap.clear();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   544
	iPluginIDMap = tempMap;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   545
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   546
	//form list of smfprovider from this map,-
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   547
	QList<SmfProvider> providerList = iPluginIDMap.values();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   548
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   549
	//now serialize this list into bytearray
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   550
	resultData.clear();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   551
	QDataStream stream(&resultData,QIODevice::WriteOnly);
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   552
	stream<<providerList;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   553
	qDebug()<<"providerList.count() = "<<providerList.count();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   554
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   555
	qDebug()<<"Before providerListSymbian";
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   556
	//now convert it into TPtr8
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   557
	TPtrC8 providerListSymbian(reinterpret_cast<const TText8*>(resultData.constData()),resultData.length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   558
	qDebug()<<"After providerListSymbian";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   559
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   560
	TInt writeErr = aMessage.Write(2,providerListSymbian);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   561
	qDebug()<<"aMessage.Write(2) = "<<writeErr;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   562
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   563
	//signal completion
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   564
	TInt completion = SmfGetService;
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   565
	aMessage.Complete(completion);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   566
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   567
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   568
void SmfServerSymbianSession::HandleCommonServiceL(const RMessage2& aMessage)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   569
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   570
	qDebug()<<"Inside SmfServerSymbianSession::HandleCommonServiceL() = "<<aMessage.Function();
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   571
	iLastRequest = aMessage.Function();
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   572
	/**
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   573
	 * Note:- client sends message in the following format,-
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   574
	 * Slot 0:- SmfProvider* serialized+Page info flag+page number+per page (if page info flag)+xtra info flag
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   575
	 * Slot 1:- Interface Name buffer
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   576
	 * Slot 2:- Ptr to data block to be filled
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   577
	 * Slot 3 :- Xtra Data if xtra data flag
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   578
	 */
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   579
	//TODO:- Use macro instead, shared betn client-server
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   580
	TInt providerSize = aMessage.GetDesLength(0);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   581
	if(iProviderBuf8)
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   582
		{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   583
		delete iProviderBuf8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   584
		iProviderBuf8 = NULL;
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   585
		}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   586
	iProviderBuf8 = HBufC8::NewL(providerSize);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   587
	iProviderSymbian8.Set(iProviderBuf8->Des());
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   588
	qDebug()<<"data info (0) size = "<<iProviderSymbian8.Size();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   589
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   590
	//read it into iProviderSymbian8
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   591
	aMessage.ReadL(0,iProviderSymbian8);
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   592
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   593
	//convert SmfProvider info from Symbian into bytearray
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   594
	QByteArray providerBufQt(reinterpret_cast<const char*>(iProviderSymbian8.Ptr()),iProviderSymbian8.Length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   595
	qDebug()<<"providerBufQt.size = "<<providerBufQt.size();
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   596
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   597
	//now de-serialize it
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   598
	QDataStream stream(&providerBufQt,QIODevice::ReadOnly);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   599
	SmfProvider provider;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   600
	stream>>provider;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   601
	QByteArray XtraBufQt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   602
	stream>>XtraBufQt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   603
	qDebug()<<"XtraBufQt size = "<<XtraBufQt.size();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   604
	TInt intfNameSize = aMessage.GetDesLength(1);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   605
	if(iIntfNameBuf8)
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   606
		{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   607
		delete iIntfNameBuf8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   608
		iIntfNameBuf8 = NULL;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   609
		}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   610
	iIntfNameBuf8 = HBufC8::NewL(intfNameSize);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   611
	iIntfNameSymbian8.Set(iIntfNameBuf8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   612
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   613
	//read it into iIntfNameSymbian8
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   614
	aMessage.ReadL(1,iIntfNameSymbian8);
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   615
	qDebug()<<"iIntfNameSymbian8 (1) .Size = "<<iIntfNameSymbian8.Size();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   616
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   617
	QByteArray bytearray(reinterpret_cast<const char*>(iIntfNameSymbian8.Ptr()),iIntfNameSymbian8.Length()) ;
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   618
	QDataStream intfNameStream(&bytearray,QIODevice::ReadOnly);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   619
	iInterfaceID.clear();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   620
	intfNameStream>>iInterfaceID;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   621
	qDebug()<<"Interface Name = "<<iInterfaceID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   622
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   623
	//Interface names are diff in client and plugin, replacing *.client.* with *.plugin.*
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   624
	iInterfaceID.replace(QString(".client"),QString(".plugin"));
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   625
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   626
	//Get the plugin ID who matches provider info for a given intf name
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   627
	SmfPluginID pluginID = iServer->wrapper()->getPlugin(iInterfaceID,provider);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   628
	qDebug()<<"pluginID from PM = "<<pluginID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   629
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   630
	//we need to check only this pluginID is authorized?
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   631
	iPluginIDList.clear();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   632
	iPluginIDList<<pluginID;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   633
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   634
	//iAuthList will contain pluginID for a successfull case
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   635
	iAuthList.clear();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   636
	iServer->wrapper()->getAuthorizedPlugins(iPluginIDList,iAuthList);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   637
	if(iAuthList.contains(pluginID))
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   638
		{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   639
		//Plugin ID is authorised, service the request
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   640
		//Gnerate request id only if the plugin ID is authorised
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   641
		TInt id = iServer->addToSessionMap(this,aMessage);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   642
		//request PM to get the data
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   643
		SmfRequestTypeID opcode = (SmfRequestTypeID)iLastRequest;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   644
		
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   645
		SmfError err = iServer->wrapper()->sendToPluginManager(id,pluginID,iInterfaceID,opcode,XtraBufQt);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   646
		if(SmfNoError != err)
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   647
			{
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   648
			iErrBuf.Zero();
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   649
			iErrBuf.AppendNum(err);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   650
			iMessage.Write(2,iErrBuf);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   651
			
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   652
			//signal completion for the last request
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   653
			iMessage.Complete(err);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   654
			}
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   655
		}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   656
	else
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   657
		{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   658
		SmfError err = SmfNoAuthorizedPlugin;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   659
		iErrBuf.Zero();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   660
		iErrBuf.AppendNum(err);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   661
		iMessage.Write(2,iErrBuf);
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   662
		
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   663
		//signal completion for the last request
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   664
		iMessage.Complete(err);
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   665
		}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   666
	}