Overview of netd.jar


The purpose of netdb.jar is to present coherent view of the database to the programmer, which is done by means of instantiating public interface NetDBpi through call to NetDBHook.createInstance(...). For detailed description of each method in NetDBpi please go to javadoc pages, while bellow is a brief list all methods accessible to user. In general whenever complex data-structure passed to or returned from a method is wrapped into Hashtable, for which detailed description is available elsewhere.
  NetDBpi
    cancelIP           (String ip)
    cancelName         (String fqdnName, String nameType)
    cancelSearch       (String searchID)
    checkAccess        (int objectType)
    checkGroupAccess   (Hashtable object)
    createSearchID     ()
    delete             (Hashtable obj)
    delete             (int what, String oid)
    dirSearch          (int byWhat, String sString)
    finalize           ()
    findIPAddrSpace    (String ip)
    fullSearch         (Hashtable search_params, String searchID)
    fullSearch         (int what, Hashtable search_params, String searchID)
    generateHexName    (String ip, int salt)
    getCurrentUser     ()
    getDefaultDomain   ()
    getGlobalDefaults  ()
    getInfo            (int what, String handle)
    getInfo            (int what, int oid)
    getState           ()
    getUser            ()
    insert             (Hashtable obj)
    isTimeout          ()
    listAddrSpaces     () throws Exception
    listDHCPServices   () throws Exception
    listMyAddrSpaces   () throws Exception
    listMyDomains      () throws Exception
    listMyGroups       (String filter) throws Exception, NetDBException
    listMyNetworks     () throws Exception
    listMyStates       (String filter) throws Exception
    listRecords        () throws Exception
    listStates         () throws Exception
    lock               (int what, String handle)
    lock               (int what, int oid)
    moveAS             (Vector asList, String targetNetFQDN)
    reloadConfig       ()
    reserveIP          (String asPrefix, String ip, int count)
    reserveName        (String fqdnName, String nameType)
    simpleSearch       (int what, String searchStr)
    simpleSearch       (int what, String searchStr, String searchID)
    simpleSearch       (int what, String searchStr, String searchID, StringBuffer sstype)
    simpleSearch       (int what, String searchStr, StringBuffer sstype)
    splitAS            (Hashtable as)
    unlock             (int what, String handle, Timestamp tm)
    unlock             (int what, int oid, Timestamp tm)
    update             (Hashtable oldObj, Hashtable newObj)
    verifyAddressSpace (String prefix, Integer idNet)
  

Normal mode of interaction with NetDB database when modifying object would involve following steps:

    lock netdb record foo
    get info for record foo, which would be returned as a hashtable ( let us call it old_record )
    make copy of old_record hashtable into new_record one
    modify desired fields in new_record
    call update(old_record, new_record)
    unlock record
  
Note that small details are omitted here and there numerous helper methods and classes available to programmer in stanford.netdb.utils.* package to facilitate easy manipulation of NetDB data-structures.