Introduction to the google wave federation protocol - the short and sweet version

In this post, we are going to install the google wave protocol reference implementation, further explore its mechanisms, and most importantly, learn something new and exciting (I hope) and, not least of all, have fun in the process.

I did this on a linux machine, ubuntu 9.04. All the steps described herein should also be adaptable to whatever OS you happen to be using, easily.

Required tools

To install java 6 on an ubuntu box, just type in the following command in your favorite shell.

sudo aptitude install sun-java6-jre sun-java6-fonts

Mercurial is a distributed SCM and it is needed to pull the code base from the google code repository. To install mercurial, issue the following command:

sudo aptitude install mercurial

Ant is needed to build the code base that we are going to pull from the google code repository. To install ant, type the following command in your favorite shell:

sudo aptitude install ant

Installing the openfire XMPP server

Now, we need to install the openfire XMPP server. First we need to download it with the following command, to get the *.deb file. Or the *.rpm if you are on a redhat linux based system.

wget http://www.igniterealtime.com/downloadServlet?filename=openfire/openfire_3.6.4_all.deb

This will download the file into your current directory. Once that's done, you can, optionally, issue an "ls *.deb" command to insure that it is there. To install it, issue

sudo dpkg -i openfire_3.6.4_all.deb

One other option is to install it manually. Either way works fine. If you are using a different platform, you can get a distribution for your platform here. After downloading the proper version for your platform, follow the installation instructions. Under the "openfire_version/documentation" directory, you should find the configuration instructions.

Configuring Openfire

Switch to a web browser and type in the URL "http://localhost:9090". You should be redirected to the setup page. In the options, you can safely stick to the default values. Click the "save settings" button and restart openfire:

sudo /ect/init.d/openfire restart

Once the server restart, go back to the "http://localhost:9090". This time, you should be presented with a login screen. The username is "admin" and the password is one that you selected in the set-up screen.

Once you have logged into the server, on the secondary menu, select the "server settings" menu and on the left hand submenu, select "external components". We need to configure the google reference implementation, because it is precisely that-an external server component. From there, select "enabled" to allow external components to connect to this server and choose a shared secret. Click "save settings".

Once that is done, you should have another box show below that says "Allowed to connect", in the subdomain box enter "wave" and the shared secret, enter your shared secret, that you chose in the previous step.

At this point, you should have something that looks like this

Then click the "save settings" button.

Once that is done, again in the left hand submenu, click the "security settings". In the "Server Connection Security", you can keep the default values as is, but make sure you enable "accept self signed certificates" and then click the "save the settings" button.

Generating certificates

To generate the key and certificate, here is a little shell script to help quickly generate them.

#!/bin/bash

NAME=$1

if ["$NAME" == '']
then
    echo "$0 " 1>&2
    exit 1
fi

openssl genrsa 1024 | openssl pkcs8 -topk8 -nocrypt -out $NAME.key
openssl req -new -x509 -nodes -sha1 -days 365 -key $NAME.key -out $NAME.cert

To use this script, just invoke it with the name of your localhost machine as a parameter. If you don't know what your machine is called issue: "hostname" on the command line. At this point, configuration of the openfire XMPP server is complete.

Getting the google wave protocol reference implementation

Earlier on, we installed mercurial. We are going to use it to fetch a copy of the reference implementation from the google code repository with the following command:

hg clone https://wave-protocol.googlecode.com/hg wave-protocol

Once that is done, go into the "wave-protocol" directory and run "ant". This will build everything and create a "$HOME/whereveryoupulledthewavesource/dist" directory with the jars that resulted from the build. There should be 2 jar files in there.

Now, go back one directory up and you should have 2 script files. One, run-server.sh is to launch the server and the other run-client.sh is to launch to client. Obvious enough!

Before launching the server, we need to modify to the run-server.sh file to

  • comment out the echo statement
  • add the absolute paths to the key and certificate
  • add your hostname for CERTIFICATE_DOMAIN_NAME
  • and finally, add the shared secret, you configured earlier for openfire, for the XMPP_SERVER_SECRET

And now, we can run the run-server.sh script and it will launch the server. You should see server log info in shell (CLI-Command Line Interface). That is all for the server.

Okay, so now, before launching the client, open the run-client.sh file in your favorite editor and:

  • comment out the echo statement
  • add your hostname to WAVE_SERVER_DOMAIN_NAME

and now, you can invoke the script with a username (any name you choose) as a parameter. You should now see a 2 pane window. You can type "/help" to see all the commands that you can use.

For more info, have a look at the source code in the "wave-protocol/src" directory! For further reading, I highly recommend the following:

Happy discovery!

Checking out IntelliJ IDEA 8.1

First impressions

After installation, the first launch (after a first failed attempt...more on that below) took some time (about a 1 min and half) just to load everything and get going. I have no idea what it's loading or doing and why it takes so freaking long. To it's credit, my girlfriend takes, on average, an hour and a half to get ready before we leave to whatever function we are attending...But that's another story.

User Interface

The interface looks crowded. Since it is the first time that it gets fired up, I would except to see some kind of "start" or "welcome" page that would give some kind of orientation of what is where. If not, at least give an overview of what to expect. Eclipse does an excellent job at that. Netbeans does that too. What's neat, in the case of Netbeans, the "start page" links to the NetBeans portal which contains blogs, documentation, tutorials and more...on the web. If you are not connected, it will still pop-up. However, the "start page" can be disabled.

Diving in...

Okay, let's check it a little more, I select "start a project from scratch", and select a "maven type project". To my surprise, it does not detect the location of the default maven local repository (the $HOME/.m2 directory), nor does it ask to be supplied with a path to the repository. It just goes off and tries to download libraries from external repositories (on the web); despite the fact, that I haven't even defined any dependencies in the pom file, yet.

Very odd...and annoying. This is the type of things that annoyed the hell out of me with ivy. Ivy can't seem to work offline. This annoyance is not unlike that of Netbeans "scanning" for tasks on startup, even though I have no tasks defined, for any of the projects I have "open" in the IDE. In all fairness, Netbeans does not seems to try to go online, but it does lock up the IDE while it's "scanning" and I have to wait, for it to finish before I can start coding...It does take some time, a lot more than just a minute. It takes much less time with version 6.5. There is an "x" button next to the progress bar indicator. It leads to assume that one can use it to kill the "scan" process, but it doesn't do jack. This type of cognitive friction (when a UI element fails to do what you would expect it to do) is probably one of the most unpleasant. Note to jetbrains: "don't annoy your users.".

Also when IntelliJ's editor starts up, it indicates that it is "parsing the libraries". I don't know what that means exactly, or why it is consuming some much cpu cycles in the process. This takes a little bit of time to complete. It does so every time the editor fires up. It is much more of a puzzle than a real annoyance.

Other glitches

It failed to show anything at the first run. I got stuck on a blank window, with a title of the window that seem to suggest that I am at the "accepting license page". Never mind, that I just did that 2 steps ago. Solution: kill the process from the console, wipe out the install directory, re-install and start over!

Another puzzle, the IDE periodically prints on the console "Warning: The encoding 'UTF-8' is not supported by the Java runtime". I wonder what runtime it's referring to. On closing the IDE, the same warning is displayed again. One other unpleasant thing is that IntelliJ does not have an installer of any sort. It comes bundled in a tarball. Upon "untaring", a directory is creating, and one can find the idea.sh startup script in the /bin sub-directory. Sure, one can create a "shortcut launcher" anywhere (on the desktop or task bar are the most common). Same goes for Eclipse (for the packaging, installer and the startup script bit). Contrary to Netbeans which does have an installer and allows one to skip the "shortcut launcher" fiddling step.

Look & Feel

IntelliJ seems to lack native GTK support; at least on Ubuntu 8.10. On Ubuntu, its L&F looks a lot like the pre-JDK 6 versions default java L&F; as did Netbeans for all previous versions to version 6. Before version 6, the L&F integration used the default java L&F and it sucked. Even though it was possible to specify a different L&F in its config file. However, at the time (with previous version 5 and below), most other L&F still sucked, with the exception of incors.com's Kunstoff L&F. Now NB6 has a much nicer L&F, thanks to better L&F in JDK 6. Eclipse has had a far better integration with the native GUI since the earliest versions.

The help system

The help system is nothing particularly special. In fact, it suspiciously looks like that of Netbeans; same layout, same icons, same fonts, same L&F. One exception for the scrollbars, they seem to have applied their specific look and feel only their. In this respect, Eclipse's help and documentation system is second to none.

Sure, there exist worst IDEs out there...Most notably JDeveloper, fondly referred to, by some of my colleagues, as: "fucking Jdev sucks ass!". Although, to be fair, it is a lot much better now; since version 11, which incorporates some of the designs and technologies from BEA.

Digression: Ah yes! Larry bought the company!.

Here is a few of the, first glance, improvements: it does not look so fiendishly ugly (granted this is largely subjective), it's a bit faster (though, a lot faster would be better) and a bit less memory hungry than it predecessors.

Conclusion

IntelliJ boasts a impressive array of plugins. For instance, IntelliJ's plugin for GWT is pretty good. However, google recently released Eclipse plugins for GWT and Google App Engine along with the "early look" of their support for Java. Eclipse does also have a pretty impressive "eco-system" of plugins and so does Netbeans.

All other things being equal, I do not see the compelling, extra value that IntelliJ provides for the money that Netbeans and Eclipse don't provide already, for free. The last two being free (as in open-source) does also weigh in their favor. IntelliJ offers free licenses to educational institutions and individual committers to open source projects. But it is not open-source. Over all, IntelliJ seems to be a feature rich tool. However, I just couldn't get pass the initial irritations with the tool.

note: The 30 day trial version of IntelliJ was run on a Dell Dimension 3100 box, running ubuntu 8.10 (intrepid), with 3G of ram.