public interface OAuth2Persister
OAuth2Store, to manage OAuth2Accessor and
OAuth2Token storage.
An OAuth2Accessor has the same basic information as the OAuth2Client, merged with
gadget spec and request prefs.
OAuth2Accessor is short lived, for the life of one request.
OAuth2Clients is intended to be persisted and cached.
The default persister for shindig is JSONOAuth2Persister| Modifier and Type | Method and Description |
|---|---|
OAuth2Client |
findClient(String gadgetUri,
String serviceName)
Retrieves a client from the persistence layer.
|
OAuth2Token |
findToken(String gadgetUri,
String serviceName,
String user,
String scope,
OAuth2Token.Type type) |
void |
insertToken(OAuth2Token token)
Inserts a new
OAuth2Token into the persistence layer. |
Set<OAuth2Client> |
loadClients()
Load all the clients from the persistence layer.
|
Set<OAuth2Token> |
loadTokens()
Load all the tokens from the persistence layer.
|
boolean |
removeToken(String gadgetUri,
String serviceName,
String user,
String scope,
OAuth2Token.Type type)
Removes a token from the persistence layer.
|
void |
updateToken(OAuth2Token token)
Updates an existing
OAuth2Token in the persistence layer. |
OAuth2Client findClient(String gadgetUri, String serviceName) throws OAuth2PersistenceException
null if not found.gadgetUri - serviceName - null if the client is not
foundOAuth2PersistenceExceptionOAuth2Token findToken(String gadgetUri, String serviceName, String user, String scope, OAuth2Token.Type type) throws OAuth2PersistenceException
gadgetUri - serviceName - user - scope - type - OAuth2PersistenceExceptionvoid insertToken(OAuth2Token token) throws OAuth2PersistenceException
OAuth2Token into the persistence layer.token - OAuth2PersistenceExceptionSet<OAuth2Client> loadClients() throws OAuth2PersistenceException
BasicOAuth2Store.init() method
will call this to prepopulate the cache.OAuth2PersistenceExceptionSet<OAuth2Token> loadTokens() throws OAuth2PersistenceException
BasicOAuth2Store.init() method will
call this to prepopulate the cache.OAuth2PersistenceExceptionboolean removeToken(String gadgetUri, String serviceName, String user, String scope, OAuth2Token.Type type) throws OAuth2PersistenceException
gadgetUri - serviceName - user - scope - type - OAuth2PersistenceExceptionvoid updateToken(OAuth2Token token) throws OAuth2PersistenceException
OAuth2Token in the persistence layer.token - OAuth2PersistenceExceptionCopyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.