
If you are familiar with
JXTA configuration, you will surely appreciate the new bug fixes, and features added to the latest
JXTA platform release (2.4).
The latest release included significant fixes and features to deal with node configuration:
- ext:config included several bug fixes, and improved stability, it also included additional configuration profiles.
- A programmatic interface to node configuration (see NetworkConfigurator), by design, NetworkConfigurator is a JavaBean, allowing for declarative configuration deployment (see jxta-spring).
In addition NetworkConfigurator exposes API's (see load(uri), getPlatformConfig(), etc.), which would facilitate secure network based deployment services, as well as automate certificate, ID, and rendezvous/relay seed provisioning.
Special thanks to the community members who contributed and helped drive these new API's (especially vwilliams, ae6rt, bondolo, fdimglio, ibirrer)

Network Based Configuration Provisioning
NetworkConfigurator config = new NetworkConfigurator(); if (!config.exists()) { // Create a new configuration with a new name, principal, and pass config.setName("New Name"); config.setPrincipal("username"); config.setPassword("password"); try { //persist it config.save(); } catch (IOException io) { // deal with the io error } } else { // Load the pre-existing configuration File pc = new File(config.getHome(), "PlatformConfig"); try { config.load(pc.toURI()); // make changes if so desired .. .. // store the PlatformConfig under the default home config.save(); } catch (CertificateException ce) { // In case the root cert is invalid, this creates a new one try { //principal config.setPrincipal("principal"); //password to encrypt private key with config.setPassword("password"); config.save(); } catch (Exception e) { e.printStackTrace(); } } |
Posted by Mark on June 24, 2006 at 03:32 PM PDT #