1 /** |
|
2 * Copyright (c) 2010 Sasken Communication Technologies Ltd. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html" |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution |
|
11 * |
|
12 * Contributors: |
|
13 * Manasij Roy, Nalina Hariharan |
|
14 * |
|
15 * Description: |
|
16 * The Plugin util class provides the information required for the |
|
17 * plugins from Smf framework |
|
18 * |
|
19 */ |
|
20 |
|
21 #include <smfpluginutil.h> |
|
22 |
|
23 // Static data initialisation |
|
24 SmfPluginUtil* SmfPluginUtil::m_myInstance = NULL; |
|
25 |
|
26 /** |
|
27 * Method to get the instance of SmfPluginUtil class |
|
28 * @return The instance of SmfPluginUtil class |
|
29 */ |
|
30 SmfPluginUtil* SmfPluginUtil::getInstance ( ) |
|
31 { |
|
32 if(NULL == m_myInstance) |
|
33 m_myInstance = new SmfPluginUtil(); |
|
34 return m_myInstance; |
|
35 } |
|
36 |
|
37 /** |
|
38 * Constructor with default argument |
|
39 */ |
|
40 SmfPluginUtil::SmfPluginUtil ( ) |
|
41 { |
|
42 m_jsonParser = new QJson::Parser; |
|
43 } |
|
44 |
|
45 /** |
|
46 * Destructor |
|
47 */ |
|
48 SmfPluginUtil::~SmfPluginUtil ( ) |
|
49 { |
|
50 if(m_jsonParser) |
|
51 delete m_jsonParser; |
|
52 |
|
53 if(m_myInstance) |
|
54 delete m_myInstance; |
|
55 } |
|
56 |
|
57 /** |
|
58 * Method called by plugins to get the handle to QJson library |
|
59 * @return The QJson handle |
|
60 */ |
|
61 QJson::Parser* SmfPluginUtil::getJsonHandle( void ) |
|
62 { |
|
63 return m_jsonParser; |
|
64 } |
|
65 |
|
66 /** |
|
67 * Method called by plugins to get the OAuth Keys. The PM sends the |
|
68 * keys only if the pluginID is that of a currently loaded plugin |
|
69 * @param aKeys [out] The OAuth keys |
|
70 * @param aRegToken The plugin's registration token |
|
71 * @param aPluginID The ID of the plugin that requests for |
|
72 * the OAuth keys |
|
73 */ |
|
74 void SmfPluginUtil::getAuthKeys( QMap<QString, QString> &aKeys, |
|
75 const QString aRegToken, |
|
76 const QString aPluginID ) |
|
77 { |
|
78 //// Call Credential manager function to get the keys passing the |
|
79 //// registration token and the plugin |
|
80 } |
|
81 |
|
82 /** |
|
83 * Method called by plugins to get the Nonce value |
|
84 * @param aNonceString [out] The Nonce string |
|
85 */ |
|
86 void SmfPluginUtil::getNonce( QString &aNonceString ) |
|
87 { |
|
88 //// Call Credential manager function to get the nonce string |
|
89 } |
|
90 |
|
91 /** |
|
92 * Method called by plugins to generate a parameters string required to |
|
93 * access Protected Resources using OAuth authorization. |
|
94 * @param aRequestUrl The request URL |
|
95 * @param aOperation The type of http operation |
|
96 * @param aToken The access token |
|
97 * @param aTokenSecret The token secret |
|
98 * @param aSignatureMethod The signature method to be used |
|
99 * @param aParams A map of parameters to its values |
|
100 * @param aMode The mode of creation of the request |
|
101 * @return The cretd parameter string |
|
102 */ |
|
103 QByteArray SmfPluginUtil::createParameterString( const QString &aRequestUrl, |
|
104 QNetworkAccessManager::Operation aOperation, |
|
105 const QByteArray &aToken, |
|
106 const QByteArray &aTokenSecret, |
|
107 const SmfSignatureMethod aSignatureMethod, |
|
108 const QMultiMap<QByteArray, QByteArray> &aParams, |
|
109 const SmfParsingMode aMode) |
|
110 { |
|
111 //// Call Credential manager function to create and sign the parameter string |
|
112 } |
|
113 |
|