Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Java library for the Pusher REST API (http://www.pusherapp.com)

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 Pusher.java
Octocat-spinner-32 PusherRequest.java
Octocat-spinner-32 README.md update docs March 08, 2011
README.md

Pusher Java classes

This Java classes can be used to communicate very easily with the Pusher REST API (http://www.pusherapp.com) from any Java application that uses Apache http-commons.

Get Started

Simply replace the Pusher specific constants in Pusher.java:

private final static String pusherApplicationId = "";

private final static String pusherApplicationKey = "";

private final static String pusherApplicationSecret = "";

Call one of the two available static methods called "triggerPush" and pass channel name, event name and the message body (JSON encoded data) as parameters:

Pusher.triggerPush("test_channel", "my_event", jsonData);

The second "triggerPush" method provides an additional parameter for the socket_id:

Pusher.triggerPush("test_channel", "my_event", jsonData, socketId);

That's it.

Default values

Sometimes it can be very convenient to prepulate a PusherRequest instance with default channel and/or event name:

PusherRequest p = new PusherRequest("test_channel","my_event");

To send a request to the Pusher API just call "triggerPush" on this instance:

p.triggerPush(jsondata);

License

Copyright 2010, Stephan Scheuermann. Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php

Something went wrong with that request. Please try again.