this.consumerKey = consumerKey;
this.consumerSecret = consumerSecret;
}
public OAuthConsumer createConsumer() {
CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(consumerKey, consumerSecret) {
private static final long serialVersionUID = 2077439267247908434L;
@Override
protected String generateNonce() {
// thread-safe nonce generation
// http://code.google.com/p/oauth-signpost/issues/detail?id=41
return Long.toString(RANDOM.nextLong());
}
};
consumer.setTokenWithSecret(token, tokenSecret);
return consumer;
}