| |
- object
-
- OIDStore
class OIDStore(object) |
|
Interface for the OID Storage mechanism
The role of this mechanism is to store and retrieve
OID: value pairs. Since most of the common queries
involve finding, not a specific OID, but rather the
next OID following a given OID, it is necessary for
OID stores to use an ordered storage format with
fast retrieval characteristics, such as a bisect list,
or a BSDDB BTree database. |
|
Methods defined here:
- __iter__(self)
- Create an iterator object for this OIDStore
- 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.
- 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 defined here:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'OIDStore' objects>
- list of weak references to the object (if defined)
| |