Class OAuth2TokenStore
- java.lang.Object
-
- org.nuxeo.ecm.platform.oauth2.tokens.OAuth2TokenStore
-
- All Implemented Interfaces:
com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>
public class OAuth2TokenStore extends Object implements com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>
DataStorebacked by a Nuxeo Directory- Since:
- 7.3
-
-
Constructor Summary
Constructors Constructor Description OAuth2TokenStore(String serviceName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>clear()booleancontainsKey(String key)booleancontainsValue(com.google.api.client.auth.oauth2.StoredCredential value)com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>delete(String key)voiddelete(String token, String clientId)protected DocumentModelfind(Map<String,Serializable> filter)com.google.api.client.auth.oauth2.StoredCredentialget(String key)com.google.api.client.util.store.DataStoreFactorygetDataStoreFactory()StringgetId()NuxeoOAuth2TokengetToken(String token)Retrieves an entry by itsaccessToken.NuxeoOAuth2TokengetToken(String clientId, String userId)Retrieves an entry by itsclientIdandnuxeoLogin.protected NuxeoOAuth2TokengetTokenFromDirectoryEntry(DocumentModel entry)booleanisEmpty()Set<String>keySet()DocumentModelListquery()DocumentModelListquery(Map<String,Serializable> filter)DocumentModelListquery(Map<String,Serializable> filter, Set<String> fulltext, Map<String,String> orderBy)NuxeoOAuth2Tokenrefresh(String refreshToken, String clientId)NuxeoOAuth2Tokenrefresh(DocumentModel entry, NuxeoOAuth2Token token)com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>set(String key, com.google.api.client.auth.oauth2.StoredCredential credential)intsize()voidstore(String userId, NuxeoOAuth2Token token)protected NuxeoOAuth2TokenstoreTokenAsDirectoryEntry(NuxeoOAuth2Token aToken)booleanupdate(NuxeoOAuth2Token token)Collection<com.google.api.client.auth.oauth2.StoredCredential>values()
-
-
-
Field Detail
-
DIRECTORY_NAME
public static final String DIRECTORY_NAME
- See Also:
- Constant Field Values
-
ENTRY_ID
public static final String ENTRY_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OAuth2TokenStore
public OAuth2TokenStore(String serviceName)
-
-
Method Detail
-
set
public com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential> set(String key, com.google.api.client.auth.oauth2.StoredCredential credential) throws IOException
- Specified by:
setin interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>- Throws:
IOException
-
delete
public com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential> delete(String key) throws IOException
- Specified by:
deletein interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>- Throws:
IOException
-
get
public com.google.api.client.auth.oauth2.StoredCredential get(String key) throws IOException
- Specified by:
getin interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>- Throws:
IOException
-
getDataStoreFactory
public com.google.api.client.util.store.DataStoreFactory getDataStoreFactory()
- Specified by:
getDataStoreFactoryin interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>
-
getId
public final String getId()
- Specified by:
getIdin interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>
-
containsKey
public boolean containsKey(String key) throws IOException
- Specified by:
containsKeyin interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>- Throws:
IOException
-
containsValue
public boolean containsValue(com.google.api.client.auth.oauth2.StoredCredential value) throws IOException
- Specified by:
containsValuein interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>- Throws:
IOException
-
isEmpty
public boolean isEmpty() throws IOException
- Specified by:
isEmptyin interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>- Throws:
IOException
-
size
public int size() throws IOException
- Specified by:
sizein interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>- Throws:
IOException
-
keySet
public Set<String> keySet() throws IOException
- Specified by:
keySetin interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>- Throws:
IOException
-
values
public Collection<com.google.api.client.auth.oauth2.StoredCredential> values() throws IOException
- Specified by:
valuesin interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>- Throws:
IOException
-
clear
public com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential> clear() throws IOException
- Specified by:
clearin interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>- Throws:
IOException
-
store
public void store(String userId, NuxeoOAuth2Token token)
-
refresh
public NuxeoOAuth2Token refresh(String refreshToken, String clientId)
-
refresh
public NuxeoOAuth2Token refresh(DocumentModel entry, NuxeoOAuth2Token token)
-
update
public boolean update(NuxeoOAuth2Token token)
- Since:
- 9.10
-
getToken
public NuxeoOAuth2Token getToken(String token)
Retrieves an entry by itsaccessToken.
-
getToken
public NuxeoOAuth2Token getToken(String clientId, String userId)
Retrieves an entry by itsclientIdandnuxeoLogin.- Since:
- 9.10
-
query
public DocumentModelList query()
-
query
public DocumentModelList query(Map<String,Serializable> filter)
-
query
public DocumentModelList query(Map<String,Serializable> filter, Set<String> fulltext, Map<String,String> orderBy)
- Since:
- 9.10
-
getTokenFromDirectoryEntry
protected NuxeoOAuth2Token getTokenFromDirectoryEntry(DocumentModel entry)
-
storeTokenAsDirectoryEntry
protected NuxeoOAuth2Token storeTokenAsDirectoryEntry(NuxeoOAuth2Token aToken)
-
find
protected DocumentModel find(Map<String,Serializable> filter)
-
-