/**
  * Checks if the provided consumer key is valid and sets the corresponding
  * consumer secret. Used as a callback function.
  *
  * @static
  * @param 	$Provider
  * @return 	int
  */
 public static function consumerHandler($Provider)
 {
     try {
         $DataStore = Configuration::getDataStore();
     } catch (DataStoreConnectException $Exception) {
         // Ideally this exception should be rethrown here but the internals of PECL's OAuth class throw an exception
         // when a non-accepted return value (or no return value) is received. This seems to be winning from exceptions
         // thrown at this point.
         return OAUTH_CONSUMER_KEY_UNKNOWN;
     }
     try {
         $OAuthConsumer = OAuthConsumerModel::loadFromConsumerKey($Provider->consumer_key, $DataStore);
     } catch (DataStoreReadException $Exception) {
         return OAUTH_CONSUMER_KEY_UNKNOWN;
     }
     $Provider->consumer_secret = $OAuthConsumer->getConsumerSecret();
     return OAUTH_OK;
 }