359 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Sorry, no records were found!
Latest 7 Posts
Staying in Wonderland
Thu, Oct 11th 2012 39
Dear Yancy Lent
Thu, Oct 11th 2012 32
Understanding Notes apps
Wed, Oct 10th 2012 11
Congratulations, Devin!
Thu, May 3rd 2012 36
Dear everyone in the HVAC industry...
Wed, May 2nd 2012 32
American Spring
Fri, Apr 27th 2012 44
Protect yourself, empower your audience
Thu, Apr 26th 2012 53
Top 10


More secret Java APIs for Domino
Nathan T Freeman    

While researching some tooling last week, I found myself wondering about the Java Server Addins that have been in Domino since version 6: Changeman and ISpy. These two Java addins do some very interesting stuff focused on monitoring server availability and resource load. But what's more interesting is that the packages for them can be found in notes.jar. And it turns out that those packages offer some surprisingly useful APIs.

Classes like lotus.notes.addins.JavaServerSession, lotus.notes.addins.SocketAddin, lotus.notes.internal.MessageQueue are... intriguing to say the least. But my personal favorite is the lotus.notes.addins.DominoServer class. Here's some sample code for you...

DominoServer myBlogServer = new DominoServer("CN=thentf/O=GBSBlogs"); // create DominoServer for my blog server
String timsName = "CN=Tim Tripcony/OU=NA/O=GBS";
Collection timsNames = myBlogServer.getNamesList(timsName); // get Tim's names list according to my blog server
Collection myNames = myBlogServer.getNamesList(curSession.getUserName()); // get my names list according to my blog server
Collection directoryPaths = myBlogServer.getInfo(ServerInfo.NABS); // get list of directories enabled by my blog server
boolean timHasUnrestricted = myBlogServer.checkServerAccess(timsName, ServerAccess.PROG_UNRESTRICTED); // whether Tim is
                                                                                                                        // included in
                                                                                                                        // unrestricted LS/Java
                                                                                                                        // agents list
Collection myServerNetAddresses = myBlogServer.lookupServerRecord("NetAddresses"); // returns the value of NetAddresses field                                                                                                                                                // from server doc for my blog server
Collection timsServerClusterName = myBlogServer.lookupServerRecord("CN=Xmage/O=GBSBlogs", "ClusterName"); // returns the value
                                                                                                                        // of cluster name
                                                                                                                        // for Tim's server
                                                                                                                        // *according to my
                                                                                                                        // blog server*
myBlogServer.refreshDesign("nathan/escape.nsf"); // starts design refresh of blog database
myBlogServer.sendConsoleCommand("tell http osgi ss"); // send console command to my blog server

You might be thinking "but these are part of the lotus.notes package, and that is deprecated" but it's only the *namespace* that's in the lotus.notes package. The classes themselves import the current lotus.domino packages.

Hope you find these useful!

---------------------
http://ntf.gbs.com/nathan/escape.nsf/d6plinks/NTFN-8TMHRP
Apr 23, 2012
41 hits



Sorry, no records were found!
Recent Blog Posts




Created and Maintained by Yancy Lent - About - Blog Submission - Suggestions - Change Log - Blog Widget - Advertising - Mobile Edition