Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Certiorem is a PubSubHubub (PSH) implementation for ROME. It isn't an application, but an API for building each of the three components (Publisher, Subscriber and Hub) into your web apps.

You can see an example webapp here: https://rometools.jira.com/source/browse/INCUBATOR/trunk/pubsubhubub/webapp

Creating a Hub

Hubs take notifications, or "Pings" that tell it the content of a feed has been updated, fetch the feed, then notify each of the subscribers of the change. As you will begin to see, Certiorem is very much about "Composition" of classes. The Hub class is a prime example of this.

...

Code Block
 subs.subscribe("http://localhost/webapp/hub", "http://localhost/webapp/research-atom.xml", true, -1, null, new SubscriptionCallback(){

            public void onFailure(Exception e) {
                e.printStackTrace();
            }

            public void onSubscribe(Subscription subscribed) {
                System.out.println("Subscribed "+subscribed.getId() +" "+subscribed.getSourceUrl());
            }

        });

Here we pass in the URL of the Hub, the URL of the feed, a boolean indicating we want to make the subscription request synchronously, the lease seconds we want to keep the subscription for, a null cryptographic secret, and a Callback invoked when the subscribe request completes.