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>
DataStore
backed 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()
boolean
containsKey(String key)
boolean
containsValue(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)
void
delete(String token, String clientId)
protected DocumentModel
find(Map<String,Serializable> filter)
com.google.api.client.auth.oauth2.StoredCredential
get(String key)
com.google.api.client.util.store.DataStoreFactory
getDataStoreFactory()
String
getId()
NuxeoOAuth2Token
getToken(String token)
Retrieves an entry by itsaccessToken
.NuxeoOAuth2Token
getToken(String clientId, String userId)
Retrieves an entry by itsclientId
andnuxeoLogin
.protected NuxeoOAuth2Token
getTokenFromDirectoryEntry(DocumentModel entry)
boolean
isEmpty()
Set<String>
keySet()
DocumentModelList
query()
DocumentModelList
query(Map<String,Serializable> filter)
DocumentModelList
query(Map<String,Serializable> filter, Set<String> fulltext, Map<String,String> orderBy)
NuxeoOAuth2Token
refresh(String refreshToken, String clientId)
NuxeoOAuth2Token
refresh(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)
int
size()
void
store(String userId, NuxeoOAuth2Token token)
protected NuxeoOAuth2Token
storeTokenAsDirectoryEntry(NuxeoOAuth2Token aToken)
boolean
update(NuxeoOAuth2Token token)
Collection<com.google.api.client.auth.oauth2.StoredCredential>
values()
-
-
-
Field Detail
-
log
protected static final Log log
-
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:
set
in 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:
delete
in 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:
get
in 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:
getDataStoreFactory
in interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>
-
getId
public final String getId()
- Specified by:
getId
in interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>
-
containsKey
public boolean containsKey(String key) throws IOException
- Specified by:
containsKey
in 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:
containsValue
in interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>
- Throws:
IOException
-
isEmpty
public boolean isEmpty() throws IOException
- Specified by:
isEmpty
in interfacecom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>
- Throws:
IOException
-
size
public int size() throws IOException
- Specified by:
size
in 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:
keySet
in 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:
values
in 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:
clear
in 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 itsclientId
andnuxeoLogin
.- 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)
-
-