Created
September 14, 2020 23:05
-
-
Save mlescaille/92ddb6a1b5594d7649893333c17c1032 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tutorial.googleeoauth | |
import com.google.api.client.util.store.DataStore | |
import com.google.api.client.util.store.DataStoreFactory | |
import com.tutorial.googleeoauth.repository.GoogleCredentialDetailsRepository | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.stereotype.Component | |
/** | |
* Data store factory class required for implementing a custom data store to store credential | |
* details in Google OAuth Authentication process. | |
* @see {@link DbDataStore} | |
*/ | |
@Component | |
class DbDataStoreFactory implements DataStoreFactory { | |
GoogleCredentialDetailsRepository repository | |
public DbDataStoreFactory(@Autowired GoogleCredentialDetailsRepository repository) { | |
this.repository = repository | |
} | |
@Override | |
def <V extends Serializable> DataStore<V> getDataStore(String id) throws IOException { | |
return new DbDataStore(this, id, repository) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment