Class JdoDataStoreFactory.JdoDataStore<V extends java.io.Serializable>
- java.lang.Object
-
- com.google.api.client.util.store.AbstractDataStore<V>
-
- com.google.api.client.extensions.jdo.JdoDataStoreFactory.JdoDataStore<V>
-
- All Implemented Interfaces:
DataStore<V>
- Enclosing class:
- JdoDataStoreFactory
static class JdoDataStoreFactory.JdoDataStore<V extends java.io.Serializable> extends AbstractDataStore<V>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.locks.Lock
lock
Lock on storing, loading and deleting a credential.private javax.jdo.PersistenceManagerFactory
persistenceManagerFactory
Persistence manager factory.
-
Constructor Summary
Constructors Constructor Description JdoDataStore(JdoDataStoreFactory dataStore, javax.jdo.PersistenceManagerFactory persistenceManagerFactory, java.lang.String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JdoDataStoreFactory.JdoDataStore<V>
clear()
Deletes all of the stored keys and values.DataStore<V>
delete(java.lang.String key)
Deletes the stored key and value based on the given key, or ignored if the key doesn't already exist.(package private) java.util.Collection<JdoDataStoreFactory.JdoValue>
executeAllKeysQuery(javax.jdo.Query allKeysQuery)
Executes the query for all keys.(package private) JdoDataStoreFactory.JdoValue
executeKeyQuery(javax.jdo.Query keyQuery, java.lang.String key)
Executes the query for a given key, and returns theJdoDataStoreFactory.JdoValue
.V
get(java.lang.String key)
Returns the stored value for the given key ornull
if not found.JdoDataStoreFactory
getDataStoreFactory()
Returns the data store factory.java.util.Set<java.lang.String>
keySet()
Returns the unmodifiable set of all stored keys.(package private) javax.jdo.Query
newAllKeysQuery(javax.jdo.PersistenceManager persistenceManager)
Returns a new query for all keys.(package private) javax.jdo.Query
newKeyQuery(javax.jdo.PersistenceManager persistenceManager)
Returns a new query for a given key.JdoDataStoreFactory.JdoDataStore<V>
set(java.lang.String key, V value)
Stores the given value for the given key (replacing any existing value).java.lang.String
toString()
java.util.Collection<V>
values()
Returns the unmodifiable collection of all stored values.-
Methods inherited from class com.google.api.client.util.store.AbstractDataStore
containsKey, containsValue, getId, isEmpty, size
-
-
-
-
Constructor Detail
-
JdoDataStore
JdoDataStore(JdoDataStoreFactory dataStore, javax.jdo.PersistenceManagerFactory persistenceManagerFactory, java.lang.String id)
-
-
Method Detail
-
keySet
public java.util.Set<java.lang.String> keySet() throws java.io.IOException
Description copied from interface:DataStore
Returns the unmodifiable set of all stored keys.Order of the keys is not specified.
- Throws:
java.io.IOException
-
values
public java.util.Collection<V> values() throws java.io.IOException
Description copied from interface:DataStore
Returns the unmodifiable collection of all stored values.- Throws:
java.io.IOException
-
get
public V get(java.lang.String key) throws java.io.IOException
Description copied from interface:DataStore
Returns the stored value for the given key ornull
if not found.- Parameters:
key
- key ornull
fornull
result- Throws:
java.io.IOException
-
set
public JdoDataStoreFactory.JdoDataStore<V> set(java.lang.String key, V value) throws java.io.IOException
Description copied from interface:DataStore
Stores the given value for the given key (replacing any existing value).- Parameters:
key
- keyvalue
- value object- Throws:
java.io.IOException
-
delete
public DataStore<V> delete(java.lang.String key) throws java.io.IOException
Description copied from interface:DataStore
Deletes the stored key and value based on the given key, or ignored if the key doesn't already exist.- Parameters:
key
- key ornull
to ignore- Throws:
java.io.IOException
-
clear
public JdoDataStoreFactory.JdoDataStore<V> clear() throws java.io.IOException
Description copied from interface:DataStore
Deletes all of the stored keys and values.- Throws:
java.io.IOException
-
getDataStoreFactory
public JdoDataStoreFactory getDataStoreFactory()
Description copied from class:AbstractDataStore
Returns the data store factory.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Specified by:
getDataStoreFactory
in interfaceDataStore<V extends java.io.Serializable>
- Overrides:
getDataStoreFactory
in classAbstractDataStore<V extends java.io.Serializable>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
newAllKeysQuery
javax.jdo.Query newAllKeysQuery(javax.jdo.PersistenceManager persistenceManager)
Returns a new query for all keys.- Parameters:
persistenceManager
- persistence manager- Returns:
- new query for all keys
-
executeAllKeysQuery
java.util.Collection<JdoDataStoreFactory.JdoValue> executeAllKeysQuery(javax.jdo.Query allKeysQuery)
Executes the query for all keys.- Parameters:
allKeysQuery
- query for all keys- Returns:
- query result
-
newKeyQuery
javax.jdo.Query newKeyQuery(javax.jdo.PersistenceManager persistenceManager)
Returns a new query for a given key.- Parameters:
persistenceManager
- persistence manager- Returns:
- new new query for a given key
-
executeKeyQuery
JdoDataStoreFactory.JdoValue executeKeyQuery(javax.jdo.Query keyQuery, java.lang.String key)
Executes the query for a given key, and returns theJdoDataStoreFactory.JdoValue
.- Parameters:
keyQuery
- query for a given keykey
- key- Returns:
- found
JdoDataStoreFactory.JdoValue
ornull
for none found
-
-