smf/smfservermodule/smfserver/server/smfserversymbian.cpp
author cgandhi
Thu, 23 Sep 2010 17:43:31 +0530
changeset 25 a180113055cb
parent 18 013a02bf2bb0
child 26 83d6a149c755
permissions -rw-r--r--
Music Events are now normal Fetcher APIs added All APIs now return SmfError Canceling Request now supported Music Search now based on category Providerinfo added in DSM Added secondary ID, count, location to SMFAlbum Tags for Artist added Get tracks for album and artist added Added URL to subtitle DSM Bug fixes Detailed debugging logs filtered in server, pluginmgr, transportmgr playlistsOf() method changed in smfclient and plugin interfaces. RVCT B686 compilation issues resolved.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     1
/**
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     2
 * Copyright (c) 2010 Sasken Communication Technologies Ltd.
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     3
 * All rights reserved.
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
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):
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   135
			iServer(aServer),iPtrToBuf(NULL,0) ,
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   136
			iIntfNameSymbian8(NULL,0), iProviderSymbian8(NULL,0),
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   137
			iIntfNameSymbian(NULL,0) ,iXtraDataPtr8(NULL,0),
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   138
			iPtrToDataForClient(NULL,0) ,iPtr8DataForDSM(NULL,0),iPtr8DataFromDSM(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
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   150
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
   151
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   152
	qDebug()<<"Inside SmfServerSymbianSession::clientAuthorizationFinished() = "<<success;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   153
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   154
	//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
   155
	if(!success)
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   156
		{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   157
		//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
   158
		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
   159
		}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   160
	else
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   161
		{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   162
		HandleClientMessageL(iMessage);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   163
		}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   164
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   165
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   166
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
   167
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   168
	qDebug()<<"Inside SmfServerSymbianSession::resultsAvailable()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   169
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   170
	//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
   171
	//parsedData is already serialized by PM
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   172
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   173
	//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
   174
	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
   175
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   176
	//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
   177
	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
   178
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   179
		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
   180
		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
   181
		}
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 = 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
   183
	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
   184
	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
   185
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   186
	TInt writeErr = iMessage.Write(2,iPtrToDataForClient);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   187
	qDebug()<<"iMessage.Write() = "<<writeErr;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   188
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   189
	//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
   190
	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
   191
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   192
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   193
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
   194
	{    
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   195
	qDebug()<<"Inside SmfServerSymbianSession::ServiceL() = "<<iMessage.Function();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   196
	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
   197
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   198
	//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
   199
	SmfClientAuthID clientAuthID;
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   200
	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
   201
	clientAuthID.session = this;
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
	//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
   203
	HandleClientMessageL(iMessage);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   204
	}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   205
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   206
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
   207
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   208
	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
   209
	
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   210
	/**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
   211
	 *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
   212
	 *
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   213
	 *Two cases,-
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   214
	 *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
   215
	 *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
   216
	 *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
   217
	 *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
   218
	 *TODO:- to be changed after GetServices returns SmfProvider+pluginID 
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   219
	 * 
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   220
	 */
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   221
	if( (SmfGetService == aMessage.Function()) 			||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   222
		(SmfPostGetMaxCharsInPost == aMessage.Function())	||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   223
		(SmfPostGetMaxItems == aMessage.Function())		||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   224
		(SmfPostGetSupportedFormats == aMessage.Function())||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   225
		(SmfPostGetAppearanceSupport == aMessage.Function()))
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   226
			
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   227
		{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   228
		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
   229
		}
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   230
	else if (SmfCancelRequest == aMessage.Function())
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   231
		{
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   232
		HandleCancelRequest(aMessage);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   233
		}
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   234
	else if(aMessage.Function() == SmfRelationCreate ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   235
			aMessage.Function() == SmfRelationAssociate || 
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   236
			aMessage.Function() == SmfRelationSearchById ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   237
			aMessage.Function() == SmfRelationSearchByContact ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   238
			aMessage.Function() == SmfRelationCount ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   239
			aMessage.Function() == SmfRelationGet ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   240
			aMessage.Function() == SmfRelationGetAll ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   241
			aMessage.Function() == SmfRelationGetAllRelations ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   242
			aMessage.Function() == SmfRelationDeleteRelation ||
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   243
			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
   244
			)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   245
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   246
		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
   247
		}
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   248
	else
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   249
		{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   250
		HandleCommonServiceL(aMessage);
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   251
		}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   252
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   253
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   254
void SmfServerSymbianSession::HandleCancelRequest(const RMessage2 & aMessage)
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   255
	{
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   256
	SmfError err = SmfNoError;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   257
	// 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
   258
	bool ret = SmfPluginManager::getInstance(iServer->wrapper())->cancelRequest(iLastRequest);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   259
	
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   260
	iErrBuf.Zero();
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   261
	iErrBuf.AppendNum(err);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   262
	iMessage.Write(2,iErrBuf);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   263
	aMessage.Complete(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
	}
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   266
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   267
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
   268
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   269
	qDebug()<<"Inside SmfServerSymbianSession::HandleDSMServiceL()";
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   270
	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
   271
	//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
   272
	//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
   273
	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
   274
		{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   275
		delete iData8ForDSM;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   276
		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
   277
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   278
	
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   279
	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
   280
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   281
		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
   282
			{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   283
			iData8ForDSM = HBufC8::New(maxSmfRelationIdSize);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   284
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   285
			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
   286
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   287
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   288
		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
   289
			{
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   290
			int maxAlloc = 1000;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   291
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   292
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   293
			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
   294
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   295
			break;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   296
		case SmfRelationRemove:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   297
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   298
			iData8ForDSM = HBufC8::New(100);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   299
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   300
			TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   301
			break;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   302
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   303
		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
   304
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   305
			int maxAlloc = MaxSmfContactSize;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   306
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   307
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   308
			TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   309
			}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   310
			break;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   311
		case SmfRelationSearchByContact:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   312
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   313
			int maxAlloc = 500; // hard coded in relation manager
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   314
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   315
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   316
			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
   317
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   318
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   319
		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
   320
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   321
			int maxAlloc = 100;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   322
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   323
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   324
			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
   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
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   327
		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
   328
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   329
			int maxAlloc = maxSmfRelationItemSize*maxRelationItems;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   330
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   331
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   332
			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
   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
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   335
		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
   336
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   337
			int maxAlloc = maxSmfRelationItemSize*maxRelationItems;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   338
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   339
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   340
			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
   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
			break;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   343
		case SmfRelationGetAllRelations:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   344
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   345
			int maxAlloc = maxSmfRelationItemSize*maxRelationItems;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   346
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   347
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   348
			TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   349
			break;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   350
			}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   351
		case SmfRelationDeleteRelation:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   352
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   353
			int maxAlloc = 100;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   354
			iData8ForDSM = HBufC8::New(maxAlloc);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   355
			iPtr8DataForDSM.Set(iData8ForDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   356
			TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   357
			break;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   358
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   359
		default:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   360
			break;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   361
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   362
	//Convert into QByteArray
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   363
	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
   364
	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
   365
	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
   366
	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
   367
	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
   368
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   369
		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
   370
			{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   371
			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
   372
				{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   373
				delete iData8FromDSM;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   374
				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
   375
				}
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   376
			int siz = qtdataFromDSM.size();
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   377
			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
   378
			iData8FromDSM = HBufC8::NewL(qtdataFromDSM.size());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   379
			iPtr8DataFromDSM.Set(iData8FromDSM->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   380
			iPtr8DataFromDSM.Copy(reinterpret_cast<const TText8*>(qtdataFromDSM.constData()),qtdataFromDSM.length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   381
			TInt writeErr = aMessage.Write(1,iPtr8DataFromDSM);
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   382
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   383
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   384
	else
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   385
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   386
		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
   387
		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
   388
		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
   389
		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
   390
		}
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   391
	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
   392
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   393
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   394
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   395
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
   396
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   397
	qDebug()<<"Inside SmfServerSymbianSession::HandleSyncServiceL()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   398
	
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   399
	iLastRequest = aMessage.Function();
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   400
	
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   401
	// Following is the data format sent by client
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   402
	// 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
   403
	// 2. Interface name as string ("org.symbian.smf.client.gallery")
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   404
	// 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
   405
	// 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
   406
	
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   407
	TInt intfNameSize = aMessage.GetDesLength(1);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   408
	if(iIntfNameBuf8)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   409
		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   410
		delete iIntfNameBuf8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   411
		iIntfNameBuf8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   412
		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   413
	iIntfNameBuf8 = HBufC8::NewL(intfNameSize);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   414
	iIntfNameSymbian8.Set(iIntfNameBuf8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   415
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   416
	//read it into iIntfNameSymbian8
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   417
	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
   418
	
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   419
	QByteArray intfName(reinterpret_cast<const char*>(iIntfNameSymbian8.Ptr()),iIntfNameSymbian8.Length()) ;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   420
	QDataStream readIntfNameStream(&intfName,QIODevice::ReadOnly);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   421
	iInterfaceID.clear();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   422
	readIntfNameStream>>iInterfaceID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   423
	qDebug()<<"After de-serializing into iInterfaceID = "<<iInterfaceID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   424
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   425
	//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
   426
	iInterfaceID.replace(QString(".client"),QString(".plugin"));
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   427
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   428
	// for get services
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   429
	if(SmfGetService == aMessage.Function())
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   430
		HandleGetService(aMessage, iInterfaceID);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   431
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   432
	// for other services
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   433
	else
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   434
		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   435
		// read provider info
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   436
		TInt providerSize = aMessage.GetDesLength(0);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   437
		if(iProviderBuf8)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   438
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   439
			delete iProviderBuf8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   440
			iProviderBuf8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   441
			}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   442
		iProviderBuf8 = HBufC8::NewL(providerSize);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   443
		iProviderSymbian8.Set(iProviderBuf8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   444
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   445
		//read it into iProviderSymbian8
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   446
		aMessage.ReadL(0,iProviderSymbian8);
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
		//convert SmfProvider info from Symbian into bytearray
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   449
		QByteArray providerBufQt(reinterpret_cast<const char*>(iProviderSymbian8.Ptr()),iProviderSymbian8.Length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   450
		qDebug()<<"providerBufQt.size = "<<providerBufQt.size();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   451
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   452
		//now de-serialize it
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   453
		QDataStream readProviderStream(&providerBufQt,QIODevice::ReadOnly);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   454
		SmfProvider provider;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   455
		readProviderStream>>provider;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   456
		QByteArray XtraBufQt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   457
		readProviderStream>>XtraBufQt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   458
		
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   459
		//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
   460
		SmfPluginID pluginID = iServer->wrapper()->getPlugin(iInterfaceID,provider);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   461
		qDebug()<<"pluginID from PM = "<<pluginID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   462
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   463
		//we need to check only this pluginID is authorized
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   464
		iPluginIDList.clear();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   465
		iPluginIDList<<pluginID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   466
		
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   467
		//iAuthList will contain pluginID for a successfull case
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   468
		iAuthList.clear();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   469
		iServer->wrapper()->getAuthorizedPlugins(iPluginIDList,iAuthList);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   470
		
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   471
		if(iAuthList.contains(pluginID))
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   472
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   473
			//Plugin ID is authorised, service the request
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   474
			//Generate request id only if the plugin ID is authorised
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   475
			//request PM to get the data
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   476
			SmfRequestTypeID opcode = (SmfRequestTypeID)aMessage.Function();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   477
			resultData.clear();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   478
			SmfError err = iServer->wrapper()->sendToPluginManager(pluginID,iInterfaceID,opcode,XtraBufQt, resultData);
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(resultData.size())
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
				TPtrC8 resultPtr8(reinterpret_cast<const TText8*>(resultData.constData()),resultData.length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   483
				
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   484
				TInt writeErr = aMessage.Write(2,resultPtr8);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   485
				qDebug()<<"aMessage.Write(2) = "<<writeErr;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   486
				}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   487
			else
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
				iErrBuf.Zero();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   490
				iErrBuf.AppendNum(err);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   491
				iMessage.Write(2,iErrBuf);
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
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   494
			//signal completion
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   495
			aMessage.Complete(iLastRequest);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   496
			}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   497
		else
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   498
			{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   499
			SmfError err = SmfNoAuthorizedPlugin;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   500
			iErrBuf.Zero();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   501
			iErrBuf.AppendNum(err);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   502
			iMessage.Write(2,iErrBuf);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   503
			aMessage.Complete(iLastRequest);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   504
			}
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
	}
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
void SmfServerSymbianSession::HandleGetService(const RMessage2 & aMessage, const SmfInterfaceID& aInterfaceID)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   509
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   510
	qDebug()<<"Inside SmfServerSymbianSession::HandleGetService()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   511
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   512
	iServer->wrapper()->getPlugins(aInterfaceID,iPluginIDMap);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   513
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   514
	//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
   515
	iPluginIDList.clear();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   516
	iPluginIDList = iPluginIDMap.uniqueKeys();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   517
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   518
	//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
   519
	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
   520
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   521
	// iPluginIDMap now contains SmfProvider info to return to the client
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   522
	// 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
   523
	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
   524
	QMapIterator<SmfPluginID, SmfProvider> i(iPluginIDMap);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   525
	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
   526
		{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   527
		i.next();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   528
		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
   529
			{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   530
			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
   531
			}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   532
		}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   533
	//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
   534
	iPluginIDMap.clear();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   535
	iPluginIDMap = tempMap;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   536
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   537
	//form list of smfprovider from this map,-
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   538
	QList<SmfProvider> providerList = iPluginIDMap.values();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   539
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   540
	//now serialize this list into bytearray
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   541
	resultData.clear();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   542
	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
   543
	stream<<providerList;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   544
	qDebug()<<"providerList.count() = "<<providerList.count();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   545
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   546
	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
   547
	//now convert it into TPtr8
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   548
	TPtrC8 providerListSymbian(reinterpret_cast<const TText8*>(resultData.constData()),resultData.length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   549
	qDebug()<<"After providerListSymbian";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   550
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   551
	TInt writeErr = aMessage.Write(2,providerListSymbian);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   552
	qDebug()<<"aMessage.Write(2) = "<<writeErr;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   553
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   554
	//signal completion
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   555
	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
   556
	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
   557
	}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   558
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   559
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
   560
	{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   561
	qDebug()<<"Inside SmfServerSymbianSession::HandleCommonServiceL() = "<<aMessage.Function();
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   562
	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
   563
	/**
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   564
	 * 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
   565
	 * 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
   566
	 * 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
   567
	 * 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
   568
	 * 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
   569
	 */
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   570
	//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
   571
	TInt providerSize = aMessage.GetDesLength(0);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   572
	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
   573
		{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   574
		delete iProviderBuf8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   575
		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
   576
		}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   577
	iProviderBuf8 = HBufC8::NewL(providerSize);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   578
	iProviderSymbian8.Set(iProviderBuf8->Des());
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   579
	qDebug()<<"data info (0) size = "<<iProviderSymbian8.Size();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   580
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   581
	//read it into iProviderSymbian8
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   582
	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
   583
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   584
	//convert SmfProvider info from Symbian into bytearray
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   585
	QByteArray providerBufQt(reinterpret_cast<const char*>(iProviderSymbian8.Ptr()),iProviderSymbian8.Length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   586
	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
   587
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   588
	//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
   589
	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
   590
	SmfProvider provider;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   591
	stream>>provider;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   592
	QByteArray XtraBufQt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   593
	stream>>XtraBufQt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   594
	qDebug()<<"XtraBufQt size = "<<XtraBufQt.size();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   595
	TInt intfNameSize = aMessage.GetDesLength(1);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   596
	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
   597
		{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   598
		delete iIntfNameBuf8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   599
		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
   600
		}
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   601
	iIntfNameBuf8 = HBufC8::NewL(intfNameSize);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   602
	iIntfNameSymbian8.Set(iIntfNameBuf8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   603
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   604
	//read it into iIntfNameSymbian8
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   605
	aMessage.ReadL(1,iIntfNameSymbian8);
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   606
	qDebug()<<"iIntfNameSymbian8 (1) .Size = "<<iIntfNameSymbian8.Size();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   607
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   608
	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
   609
	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
   610
	iInterfaceID.clear();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   611
	intfNameStream>>iInterfaceID;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   612
	qDebug()<<"Interface Name = "<<iInterfaceID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   613
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   614
	//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
   615
	iInterfaceID.replace(QString(".client"),QString(".plugin"));
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   616
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   617
	//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
   618
	SmfPluginID pluginID = iServer->wrapper()->getPlugin(iInterfaceID,provider);
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   619
	qDebug()<<"pluginID from PM = "<<pluginID;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   620
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   621
	//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
   622
	iPluginIDList.clear();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   623
	iPluginIDList<<pluginID;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   624
	
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   625
	//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
   626
	iAuthList.clear();
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   627
	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
   628
	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
   629
		{
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   630
		//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
   631
		//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
   632
		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
   633
		//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
   634
		SmfRequestTypeID opcode = (SmfRequestTypeID)iLastRequest;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   635
		
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   636
		SmfError err = iServer->wrapper()->sendToPluginManager(id,pluginID,iInterfaceID,opcode,XtraBufQt);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   637
		if(SmfNoError != err)
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   638
			{
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   639
			iErrBuf.Zero();
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   640
			iErrBuf.AppendNum(err);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   641
			iMessage.Write(2,iErrBuf);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   642
			
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   643
			//signal completion for the last request
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   644
			iMessage.Complete(err);
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   645
			}
7
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   646
		}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   647
	else
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   648
		{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 10
diff changeset
   649
		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
   650
		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
   651
		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
   652
		iMessage.Write(2,iErrBuf);
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   653
		
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   654
		//signal completion for the last request
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   655
		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
   656
		}
be09cf1f39dd Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   657
	}