NetworkConfigurator. A programmatic interface to JXTA configuration

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:
  1. ext:config included several bug fixes, and improved stability, it also included additional configuration profiles.
  2. 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 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();
}
}

Comments:

It's great work, Mohamed. Thanks for inviting me to participate. Mark

Posted by Mark on June 24, 2006 at 08:32 AM PDT #

Post a Comment:
Comments are closed for this entry.
About

hamada

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today