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
  • Field Details

  • Constructor Details

    • OAuth2TokenStore

      public OAuth2TokenStore(String serviceName)
  • Method Details

    • 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 interface com.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 interface com.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 interface com.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 interface com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>
    • getId

      public final String getId()
      Specified by:
      getId in interface com.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 interface com.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 interface com.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 interface com.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 interface com.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 interface com.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 interface com.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 interface com.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
    • delete

      public void delete(String token, String clientId)
    • getToken

      public NuxeoOAuth2Token getToken(String token)
      Retrieves an entry by its accessToken.
    • getToken

      public NuxeoOAuth2Token getToken(String clientId, String userId)
      Retrieves an entry by its clientId and nuxeoLogin.
      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)