|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shindig.gadgets.oauth.BasicOAuthStore
public class BasicOAuthStore
Simple implementation of the 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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.shindig.gadgets.oauth.OAuthStore |
|---|
OAuthStore.ConsumerInfo, OAuthStore.TokenInfo |
| Constructor Summary | |
|---|---|
BasicOAuthStore()
|
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BasicOAuthStore()
| Method Detail |
|---|
public void initFromConfigString(String oauthConfigStr)
throws GadgetException
GadgetExceptionpublic static String convertFromOpenSsl(String privateKey)
public 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
OAuthStore
getConsumerKeyAndSecret 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)
OAuthStore
getTokenInfo 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)
OAuthStore
setTokenInfo in interface OAuthStore
public void removeToken(SecurityToken securityToken,
OAuthStore.ConsumerInfo consumerInfo,
String serviceName,
String tokenName)
OAuthStore
removeToken in interface OAuthStorepublic int getConsumerKeyLookupCount()
public int getAccessTokenLookupCount()
public int getAccessTokenAddCount()
public int getAccessTokenRemoveCount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||