iotcs.persistence module¶
-
class
iotcs.persistence.PersistenceStore¶ Bases:
abc.ABCPersistenceStore.
-
class
Transaction¶ Bases:
abc.ABCInterface for modifying values in a
PersistenceStore.The
PersistenceStoreitself is not updated untilcommit()is called.-
clear()¶ Mark all values to be removed from the
PersistenceStoreobject.When
commit()is called, values are removed before put methods are processed.:return this
Transactionobject
-
commit()¶ Commit this transaction.
This method persists the values to the backing store and replaces the values in the PersistenceStore} object. :return: True if the values were persisted
-
put(key, value)¶ Set a value for the key.
key is written back to the :class:.PersistenceStore` object when
commit()is called. :param key: a key to be used to retrieve the value :param value: the value :return: thisTransactionobject
-
remove(key)¶ Mark all values to be removed from the
PersistenceStoreobject.When
commit()is called, values are removed before put methods are processed.Parameters: key – a key whose value is to be removed Returns: this Transactionobject
-
-
contains(key)¶ Return True if this
PersistenceStorecontains the given key.Parameters: key – the key to search for Returns: True if this PersistenceStorecontains the given key
-
get(key, defaultValue=None)¶ Return a value for the given key. :param key: the key to search for :param defaultValue: the value to use if this
PersistenceStoredoesnot contain the keyReturns: the value for the key
-
getAll()¶ Return a map of all key/value pairs in this
PersistenceStore
-
getLock()¶ Return the lock for this PersistenceStore.
-
getName()¶ Return the name used by the
PersistenceManagerto reference thisPersistenceStore. :return The PersistenceStore} name.
-
openTransaction()¶ Open a
Transactionobject for modifying the values of thisPersistenceStore. :return: aTransactionobject
-
class
-
class
iotcs.persistence.PersistenceStoreManager¶ Bases:
objectPersistenceStoreManager.
-
class
InMemoryPersistenceStore(name)¶ Bases:
iotcs.persistence.PersistenceStoreAn in memory
PersistenceStore.Create an instance of InMemoryPersistenceStore.
-
class
Transaction(persistencestore)¶ Bases:
iotcs.persistence.TransactionA Transaction processing class.
Creat a Transaction instance.
Parameters: persistencestore – open a transaction on this PersistenceStoreRaise: Argumentif persistencestore is None-
clear()¶ Clear all entries in the transaction. :return: this instance
-
commit()¶ Commit the transaction. :return: True
-
map¶
-
maplock¶
-
peristencestore¶
-
put(key, value)¶ Add key and value to the current transaction. :return: this instance
-
remove(key)¶ Remove key from the transaction.
-
-
contains(key)¶ Return True if key is in this
PersistenceStore.
-
get(key, defaultValue=None)¶ Return the value for key or defaultValue from this
PersistenceStore.
-
getAll()¶ Return a copy of the map of persisted objects.
-
getLock()¶ Return the lock for this PersistenceStore.
-
getName()¶ Return the name of this
PersistenceStore.
-
map¶
-
maplock¶
-
name¶
-
openTransaction()¶ Open a transaction in this
PersistenceStore.
-
class
-
classmethod
getPersistenceStore(name)¶ Return the
PersistenceStorewith name.
-
class