Ales Novak's old blog

     
 

IdM, Jdic, JFreeChart, Jakarta


I created a simple IdM monitoring facility. The application has a Swing GUI, it connects to IdM through Apache/Jakarta HttpClient library. Application advertises itself only by an icon in the system tray. Currently the application monitors WorkItems. WorkItems data are reported for the currently logged in user as well as the total number of all WorkItems. There is also a possibility to view statistics about password activities. That includes password reset and password change. Data are presented as 3D charts using JFreeChart library.

Once the application is started, you will see a dialog asking for credentials first.

As you see, https is supported *). Url and user name are saved using Preferences API, so they popup next time the GUI is displayed.

After successful connect you can see data about WorkItems, you can also display data about password activity (last 5 days, this is hardcoded).

What caught me by surprise was the ability of JFreeChart library to scale data. If there is only one password reset, but 250 password changes, you cannot see values for password reset very well. What is supported, is that you select an area on the image. The image is then scaled:

On the IdM side, the hardest thing was probably finding out which APIs to use. What regards WorkItems I reused code from a former project, but password data - well LighthouseContext.countObject(Type.LOG, ...) is your friend.

The project took surprisingly short time to develope. HTTP communication is basically cut and pasted example from the HttpClient library. Connect dialog GUI was made in about 5 minutes using NetBeans form editor (Matisse). Password charts code is also greatly reused from an example. Finally, presenting the application in system tray is based on another example from JDIC project. I reused jsp serving data about WorkItems from a former project. I had to write a new jsp presenting password data. Rest of code is event handling, parsing data, bunch of requestFocus() calls. There are also some fancy features such as notifications of connectivity problems and automatic reconnect.

*) The only thing to make SSL work, you need to import the certificate to a truststore. I did something like:

/usr/sfw/bin/certutil -L -n s1as -d . -a
to export server's public certificate from Sun application server.

Then the certificate must be imported to JDK so that the certificate is trusted so the HTTPS connection can be successfully established.

C:\Program Files\Java\jdk1.6.0\jre\lib\security>keytool -import -file cert.pem -keystore cacerts
Enter keystore password:  changeit
xxx
Trust this certificate? [no]:  yes
Certificate was added to keystore
 
 
 
 
 

« březen 2007 »
PoÚtStČtSoNe
   
1
3
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
31
 
       
Today

[This is a Roller site]
Theme by Rowell Sotto.
 
© anovak