smf/smfservermodule/smfclient/common/smfpluginutil.cpp
changeset 14 a469c0e6e7fb
parent 7 be09cf1f39dd
equal deleted inserted replaced
13:b5d63d5fc252 14:a469c0e6e7fb
    52 	
    52 	
    53 	if(m_myInstance)
    53 	if(m_myInstance)
    54 		delete m_myInstance;
    54 		delete m_myInstance;
    55 	}
    55 	}
    56 	
    56 	
       
    57 
    57 /**
    58 /**
    58  * Method called by plugins to get the handle to QJson library 
    59 * Read JSON string from the I/O Device and converts it to a QVariant object
    59  * @return The QJson handle
    60 * @param io Input output device
       
    61 * @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true.
       
    62 * @returns a QVariant object generated from the JSON string
       
    63 */
       
    64 QVariant SmfPluginUtil::parse ( QIODevice* io, bool* ok )
       
    65 	{
       
    66 	return m_jsonParser->parse(io, ok);
       
    67 	}
       
    68 
       
    69 /**
       
    70 * This is a method provided for convenience.
       
    71 * @param jsonData data containing the JSON object representation
       
    72 * @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true.
       
    73 * @returns a QVariant object generated from the JSON string
       
    74 * @sa errorString
       
    75 * @sa errorLine
       
    76 */
       
    77 QVariant SmfPluginUtil::parse ( const QByteArray& jsonData, bool* ok )
       
    78 	{
       
    79 	return m_jsonParser->parse(jsonData, ok);
       
    80 	}
       
    81 
       
    82 /**
       
    83 * This method returns the error message tha ocuured during last parsing
       
    84 * @returns a QString object containing the error message of the last parse operation
       
    85 */
       
    86 QString SmfPluginUtil::errorString ( ) const
       
    87 	{
       
    88 	return m_jsonParser->errorString();
       
    89 	}
       
    90 
       
    91 /**
       
    92 * This method returns line number where the last QJson parsing error occurred
       
    93 * @returns the line number where the error occurred
    60  */
    94  */
    61 QJson::Parser* SmfPluginUtil::getJsonHandle( void )
    95 int SmfPluginUtil::errorLine ( ) const
    62 	{
    96 	{
    63 	return m_jsonParser;
    97 	return m_jsonParser->errorLine();
    64 	}
    98 	}
    65 
    99 
    66 /**
   100 /**
    67  * Method called by plugins to get the OAuth Keys. The PM sends the 
   101  * 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
   102  * keys only if the pluginID is that of a currently loaded plugin
    73  */
   107  */
    74 void SmfPluginUtil::getAuthKeys( QMap<QString, QString> &aKeys, 
   108 void SmfPluginUtil::getAuthKeys( QMap<QString, QString> &aKeys, 
    75 		const QString aRegToken, 
   109 		const QString aRegToken, 
    76 		const QString aPluginID )
   110 		const QString aPluginID )
    77 	{
   111 	{
       
   112 	Q_UNUSED(aKeys)
       
   113 	Q_UNUSED(aRegToken)
       
   114 	Q_UNUSED(aPluginID)
    78 	//// Call Credential manager function to get the keys passing the 
   115 	//// Call Credential manager function to get the keys passing the 
    79 	//// registration token and the plugin
   116 	//// registration token and the plugin
    80 	}
   117 	}
    81 
   118 
    82 /**
   119 /**
    83  * Method called by plugins to get the Nonce value
   120  * Method called by plugins to get the Nonce value
    84  * @param aNonceString [out] The Nonce string
   121  * @param aNonceString [out] The Nonce string
    85  */
   122  */
    86 void SmfPluginUtil::getNonce( QString &aNonceString )
   123 void SmfPluginUtil::getNonce( QString &aNonceString )
    87 	{
   124 	{
       
   125 	Q_UNUSED(aNonceString)
    88 	//// Call Credential manager function to get the nonce string
   126 	//// Call Credential manager function to get the nonce string
    89 	}
   127 	}
    90 
   128 
    91 /**
   129 /**
    92  * Method called by plugins to generate a parameters string required to 
   130  * Method called by plugins to generate a parameters string required to 
   106 		const QByteArray &aTokenSecret, 
   144 		const QByteArray &aTokenSecret, 
   107 		const SmfSignatureMethod aSignatureMethod, 
   145 		const SmfSignatureMethod aSignatureMethod, 
   108 		const QMultiMap<QByteArray, QByteArray> &aParams, 
   146 		const QMultiMap<QByteArray, QByteArray> &aParams, 
   109 		const SmfParsingMode aMode)
   147 		const SmfParsingMode aMode)
   110 	{
   148 	{
       
   149 	Q_UNUSED(aRequestUrl)
       
   150 	Q_UNUSED(aOperation)
       
   151 	Q_UNUSED(aToken)
       
   152 	Q_UNUSED(aTokenSecret)
       
   153 	Q_UNUSED(aSignatureMethod)
       
   154 	Q_UNUSED(aParams)
       
   155 	Q_UNUSED(aMode)
       
   156 	return QByteArray();
   111 	//// Call Credential manager function to create and sign the parameter string
   157 	//// Call Credential manager function to create and sign the parameter string
   112 	}
   158 	}
   113 
   159