public class BasicOAuthStore extends Object implements OAuthStore
OAuthStore interface. We use a
in-memory hash map. If initialized with a private key, then the store will
return an OAuthAccessor in getOAuthAccessor that uses that private
key if no consumer key and secret could be found.OAuthStore.ConsumerInfo, OAuthStore.TokenInfo| Constructor and Description |
|---|
BasicOAuthStore() |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertFromOpenSsl(String privateKey) |
int |
getAccessTokenAddCount() |
int |
getAccessTokenLookupCount() |
int |
getAccessTokenRemoveCount() |
OAuthStore.ConsumerInfo |
getConsumerKeyAndSecret(SecurityToken securityToken,
String serviceName,
net.oauth.OAuthServiceProvider provider)
Retrieve OAuth consumer to use for requests.
|
int |
getConsumerKeyLookupCount() |
OAuthStore.TokenInfo |
getTokenInfo(SecurityToken securityToken,
OAuthStore.ConsumerInfo consumerInfo,
String serviceName,
String tokenName)
Retrieve OAuth access token to use for the request.
|
void |
initFromConfigString(String oauthConfigStr) |
void |
removeToken(SecurityToken securityToken,
OAuthStore.ConsumerInfo consumerInfo,
String serviceName,
String tokenName)
Remove the access token for the given user/gadget/service/token
|
void |
setConsumerKeyAndSecret(BasicOAuthStoreConsumerIndex providerKey,
BasicOAuthStoreConsumerKeyAndSecret keyAndSecret) |
void |
setDefaultCallbackUrl(String defaultCallbackUrl) |
void |
setDefaultKey(BasicOAuthStoreConsumerKeyAndSecret defaultKey) |
void |
setTokenInfo(SecurityToken securityToken,
OAuthStore.ConsumerInfo consumerInfo,
String serviceName,
String tokenName,
OAuthStore.TokenInfo tokenInfo)
Set the access token for the given user/gadget/service/token
|
public void initFromConfigString(String oauthConfigStr) throws GadgetException
GadgetExceptionpublic void setDefaultKey(BasicOAuthStoreConsumerKeyAndSecret defaultKey)
public void setDefaultCallbackUrl(String defaultCallbackUrl)
public void setConsumerKeyAndSecret(BasicOAuthStoreConsumerIndex providerKey, BasicOAuthStoreConsumerKeyAndSecret keyAndSecret)
public OAuthStore.ConsumerInfo getConsumerKeyAndSecret(SecurityToken securityToken, String serviceName, net.oauth.OAuthServiceProvider provider) throws GadgetException
OAuthStoregetConsumerKeyAndSecret in interface OAuthStoresecurityToken - token for user/gadget making request.serviceName - gadget's nickname for the service being accessed.provider - OAuth service provider info to be inserted into the returned consumer.GadgetException - if no OAuth consumer can be found (e.g. no consumer key can be used.)public OAuthStore.TokenInfo getTokenInfo(SecurityToken securityToken, OAuthStore.ConsumerInfo consumerInfo, String serviceName, String tokenName)
OAuthStoregetTokenInfo in interface OAuthStoresecurityToken - token for user/gadget making request.consumerInfo - OAuth consumer that will be used for the request.serviceName - gadget's nickname for the service being accessed.tokenName - gadget's nickname for the token to use.public void setTokenInfo(SecurityToken securityToken, OAuthStore.ConsumerInfo consumerInfo, String serviceName, String tokenName, OAuthStore.TokenInfo tokenInfo)
OAuthStoresetTokenInfo in interface OAuthStorepublic void removeToken(SecurityToken securityToken, OAuthStore.ConsumerInfo consumerInfo, String serviceName, String tokenName)
OAuthStoreremoveToken in interface OAuthStorepublic int getConsumerKeyLookupCount()
public int getAccessTokenLookupCount()
public int getAccessTokenAddCount()
public int getAccessTokenRemoveCount()
Copyright © 2007-2012. All Rights Reserved.