twistedsnmp.bsdoidstore
index
(compiled)

BSDDB BTree-based Shelve OID Storage

 
Modules
       
bsddb
twistedsnmp.errors
twistedsnmp.oidstore
shelve
struct
sys
traceback

 
Classes
       
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:
__del__(self)
Close the OID store (save to disk)
__init__(self, filename, OIDs=None)
Initialise the storage with appropriate OIDs
close(self)
Close the OIDStore
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
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)

 
Functions
       
oidToSortable(oid)
Convert a dotted-format OID to a sortable string
set_location(self, key)
Patched version of _DBWithCursor.set_location for Python 2.3.x
sortableToOID(sortable)
Convert sortable rep to a dotted-string representation