| |
- object
-
- Closer
- OIDStore(object)
-
- BSDOIDStore
class BSDOIDStore(OIDStore) |
|
OIDStore implemented using (on-disk) BSDDB files
This OID store is appropriate for middle-sized OID
tables which require persistence across Python sessions.
The store uses a BSDDB BTree database provided by the
Python optional bsddb module wrapped by the standard
shelve module. |
|
- Method resolution order:
- BSDOIDStore
- OIDStore
- object
Methods defined here:
- __init__(self, filename, OIDs=None)
- Initialise the storage with appropriate OIDs
- firstOID(self)
- Retrieve the first OID,value pair for the storage
Raises OIDNameError if there are no pairs available
- getExactOID(self, base)
- Get the given OID,value pair for the given base
This method is responsible for implementing the GET
request, (or a GETBULK request which specifies
inclusive operation).
- nextOID(self, base)
- Get next OID,value pair after given base OID
This method is responsible for implementing GETNEXT,
and GETBULK requests.
- setValue(self, oid, value)
- Set the given oid,value pair, returning old value
This method is responsible for implementing the SET
request.
Class methods defined here:
- open(self, filename, mode='c') from type
- Open the given shelf as a BSDDB btree shelf
XXX patches bug in Python 2.3.x set_location for
bsddb objects as a side-effect
Methods inherited from OIDStore:
- __iter__(self)
- Create an iterator object for this OIDStore
- close(self)
- Close the OIDStore
- update(self, valueSet)
- Given a valueSet, load given values into storage
valueSet -- A set of OID:value mappings in these forms
{ rootOID : { oid : value }}
OIDStore instance -- iterable as a (key,value) producing sequence
[ (oid,value) ] # value can also be a dictionary or OIDStore (as seen above)
[ dict, OIDStore, ... ] # i.e. just a sequence of dicts or storages
XXX Should allow for passing in another OIDStore, but that
Will require a first() method for all OIDStores
- validateSetValue(self, oid, value, request, address, implementation)
- Validate that given oid & value can be set
returns 0 on success, returns errorID on failure
This implementation just returns 0 in all cases
Data and other attributes inherited from OIDStore:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'OIDStore' objects>
- list of weak references to the object (if defined)
|
class Closer(object) |
|
Close the OIDStore
This object avoids having a __del__ method defined on the
OIDStore object, which avoids the potential for memory
leaks. |
|
Methods defined here:
- __call__(self)
- Close and cleanup to prevent multiple calls
- __del__(self)
- Handle deletion of the closer object (close btree if necessary)
- __init__(self, client)
- Initialise the closer object
Data and other attributes defined here:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Closer' objects>
- list of weak references to the object (if defined)
| |