Which confd java api to used for configuration data update


Which confd java api to used for configuration data update. I guess, CDB is used only for operation data update (config false)…not for configuration data update.


I’m not sure what means “configuration data update”. If it listening (susbscription) to the changes in configuration, then you use CDB API, class CdbSubscription

e.g.: (based on javadoc)

 Socket sock = new Socket("localhost", Conf.PORT);
  Cdb cdb2 = new Cdb("test",sock);
  // create new CdbSubscription instance
  final CdbSubscription sub2= cdb2.newSubscription();
  // subscribe on a path
  int subid2 = sub2.subscribe(1,new mtest(), "/mtest/servers");
  // tell CDB we are ready for notifications

See Javadoc information for CdbSubscription for more details.

“configuration data update” means CdbDBType.CDB_RUNNING…
I am using

Cdb cdbReadSocket = new Cdb ( "dummySocket24",new Socket ( "" ,3565) );

        // Start Cdb session against running
        CdbSession cdbSession =cdbReadSocket.startSession ( CdbDBType.CDB_RUNNING );

        // read some values from CDB .
        ConfPath path = new ConfPath("/SNMP-NOTIFICATION-MIB/snmpNotifyTable/snmpNotifyEntry{%s}/",
                   new Object[] { new String("234435") });
        ConfValue[] confValue = {new ConfBuf("sdsd"),new ConfBuf("sdsd"),new ConfBuf("sdsd")};
        cdbSession.setObject(confValue, path);
        /* int i = 0;

But it is showing the error update in configuration data

Configuration data can only be modified through the northbound interfaces in a transaction, such as through MAAPI, NETCONF, CLI, etc.

See ConfD 6.3 UG “Chapter 23. The Management Agent API” , examples.confd/misc/maapi_cli, and confd_lib_maapi(3) man page