public class JSONOAuth2Persister extends Object implements OAuth2Persister
config/oauth2.json on startup| Constructor and Description |
|---|
JSONOAuth2Persister(OAuth2Encrypter encrypter,
Authority authority,
String globalRedirectUri,
String contextRoot) |
JSONOAuth2Persister(OAuth2Encrypter encrypter,
Authority authority,
String globalRedirectUri,
String contextRoot,
JSONObject configFile) |
| Modifier and Type | Method and Description |
|---|---|
OAuth2Token |
createToken() |
static OAuth2Client |
findClient(Integer index) |
OAuth2Client |
findClient(String providerName,
String gadgetUri)
Retrieves a client from the persistence layer.
|
static OAuth2Provider |
findProvider(Integer index) |
static OAuth2Provider |
findProvider(String providerName) |
static OAuth2Token |
findToken(Integer index) |
OAuth2Token |
findToken(String providerName,
String gadgetUri,
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.
|
protected Map<String,OAuth2GadgetBinding> |
loadGadgetBindings() |
protected Map<String,OAuth2Provider> |
loadProviders() |
Set<OAuth2Token> |
loadTokens()
Load all the tokens from the persistence layer.
|
static boolean |
removeToken(Integer index) |
boolean |
removeToken(String providerName,
String gadgetUri,
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. |
@Inject public JSONOAuth2Persister(OAuth2Encrypter encrypter, Authority authority, String globalRedirectUri, String contextRoot) throws OAuth2PersistenceException
OAuth2PersistenceExceptionpublic JSONOAuth2Persister(OAuth2Encrypter encrypter, Authority authority, String globalRedirectUri, String contextRoot, JSONObject configFile)
public OAuth2Token createToken()
public static OAuth2Client findClient(Integer index)
public OAuth2Client findClient(String providerName, String gadgetUri) throws OAuth2PersistenceException
OAuth2Persisternull if not found.findClient in interface OAuth2Persisternull if the client is not
foundOAuth2PersistenceExceptionpublic static OAuth2Provider findProvider(Integer index)
public static OAuth2Provider findProvider(String providerName)
public static OAuth2Token findToken(Integer index)
public OAuth2Token findToken(String providerName, String gadgetUri, String user, String scope, OAuth2Token.Type type) throws OAuth2PersistenceException
findToken in interface OAuth2PersisterOAuth2PersistenceExceptionpublic void insertToken(OAuth2Token token)
OAuth2PersisterOAuth2Token into the persistence layer.insertToken in interface OAuth2Persisterpublic Set<OAuth2Client> loadClients() throws OAuth2PersistenceException
OAuth2PersisterBasicOAuth2Store.init() method
will call this to prepopulate the cache.loadClients in interface OAuth2PersisterOAuth2PersistenceExceptionprotected Map<String,OAuth2GadgetBinding> loadGadgetBindings() throws OAuth2PersistenceException
OAuth2PersistenceExceptionprotected Map<String,OAuth2Provider> loadProviders() throws OAuth2PersistenceException
OAuth2PersistenceExceptionpublic Set<OAuth2Token> loadTokens() throws OAuth2PersistenceException
OAuth2PersisterBasicOAuth2Store.init() method will
call this to prepopulate the cache.loadTokens in interface OAuth2PersisterOAuth2PersistenceExceptionpublic static boolean removeToken(Integer index)
public boolean removeToken(String providerName, String gadgetUri, String user, String scope, OAuth2Token.Type type)
OAuth2PersisterremoveToken in interface OAuth2Persisterpublic void updateToken(OAuth2Token token)
OAuth2PersisterOAuth2Token in the persistence layer.updateToken in interface OAuth2PersisterCopyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.