com.google.api.client.auth.oauth2
Class MemoryCredentialStore

java.lang.Object
  extended by com.google.api.client.auth.oauth2.MemoryCredentialStore
All Implemented Interfaces:
CredentialStore

public class MemoryCredentialStore
extends Object
implements CredentialStore

Thread-safe in-memory implementation of a credential store.

Since:
1.7
Author:
Yaniv Inbar

Constructor Summary
MemoryCredentialStore()
           
 
Method Summary
 void delete(String userId, Credential credential)
          Deletes the credential of the given user ID.
 boolean load(String userId, Credential credential)
          Loads the credential for the given user ID.
 void store(String userId, Credential credential)
          Stores the credential of the given user ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryCredentialStore

public MemoryCredentialStore()
Method Detail

store

public void store(String userId,
                  Credential credential)
Description copied from interface: CredentialStore
Stores the credential of the given user ID.

Specified by:
store in interface CredentialStore
Parameters:
userId - user ID whose credential needs to be stored
credential - credential whose access token, refresh token, and expiration time need to be stored

delete

public void delete(String userId,
                   Credential credential)
Description copied from interface: CredentialStore
Deletes the credential of the given user ID.

Specified by:
delete in interface CredentialStore
Parameters:
userId - user ID whose credential needs to be deleted
credential - credential to be deleted

load

public boolean load(String userId,
                    Credential credential)
Description copied from interface: CredentialStore
Loads the credential for the given user ID.

Specified by:
load in interface CredentialStore
Parameters:
userId - user ID whose credential needs to be loaded
credential - credential whose access token, refresh token, and expiration time need to be set if the credential already exists in storage
Returns:
true if the credential has been successfully found and loaded or false otherwise


Copyright © 2011-2012 Google. All Rights Reserved.