diff --git a/.directory b/.directory new file mode 100644 index 000000000..455d8a3ed --- /dev/null +++ b/.directory @@ -0,0 +1,7 @@ +[Dolphin] +Timestamp=2013,5,31,1,23,30 +Version=3 +ViewMode=2 + +[Settings] +HiddenFilesShown=true diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..641ab5991 --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +# built application files +*.apk +*.ap_ + +# files for the dex VM +*.dex + +# Java class files +*.class + +# generated files +bin/ +gen/ + +# Local configuration file (sdk path, etc) +local.properties + +# Eclipse project files +.classpath +.project + +# Proguard folder generated by Eclipse +proguard/ + +# Intellij project files +*.iml +*.ipr +*.iws +.idea/ + +*.class + +# gwt caches and compiled units # +war/gwt_bree/ +gwt-unitCache/ + +# boilerplate generated classes # +.apt_generated/ + +# more caches and things from deploy # +war/WEB-INF/deploy/ +war/WEB-INF/classes/ + + diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 000000000..5d1693980 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,4 @@ +06-07-13 +. better handling in multithreaded environments +. better debug log handling + diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..3efa3922e --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +PubNub Real-time Cloud-Hosted Push API and Push Notification Client Frameworks +Copyright (c) 2013 PubNub Inc. +http://www.pubnub.com/ +http://www.pubnub.com/terms + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +PubNub Real-time Cloud-Hosted Push API and Push Notification Client Frameworks +Copyright (c) 2013 PubNub Inc. +http://www.pubnub.com/ +http://www.pubnub.com/terms diff --git a/README.md b/README.md new file mode 100644 index 000000000..42fa521a9 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +#PubNub Java-based APIs for core Java, Android, J2ME, BlackBerry. +Learn more at http://www.pubnub.com + +## Subdirectory Description +This repo contains the following platform-specific subdirectories: + +### Android +Client for the Mobile Android OS + +### GWT +Client for the GWT Platform + +### J2ME +Client for the J2ME Mobile Platform + +### Blackberry +Client for the Blackberry Mobile Platform + +### Java +Everything else! Java development for POJOs, J2EE, J2SE, etc. diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..0062ac971 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +5.0.0 diff --git a/android/CHANGELOG b/android/CHANGELOG new file mode 100644 index 000000000..f1febed1b --- /dev/null +++ b/android/CHANGELOG @@ -0,0 +1,5 @@ +03-18-13 +Fixing URL encoding bug in Android + +02-19-13 - ff0bf5d8cf5402983072e6f1666b6eb4e1a58926 +Moving 3.4 code into a new repo from the old repository @ cf8baca03090b6052fb11625e15bb0fb75d39fe3 diff --git a/android/Pubnub-Android-3.5.1.jar b/android/Pubnub-Android-3.5.1.jar new file mode 100644 index 000000000..5693cb9df Binary files /dev/null and b/android/Pubnub-Android-3.5.1.jar differ diff --git a/android/Pubnub-Android-3.6.0.jar b/android/Pubnub-Android-3.6.0.jar new file mode 100644 index 000000000..2749b5bd5 Binary files /dev/null and b/android/Pubnub-Android-3.6.0.jar differ diff --git a/android/Pubnub-Android-3.6.1.jar b/android/Pubnub-Android-3.6.1.jar new file mode 100644 index 000000000..3f1ab7651 Binary files /dev/null and b/android/Pubnub-Android-3.6.1.jar differ diff --git a/android/Pubnub-Android-3.6.2.jar b/android/Pubnub-Android-3.6.2.jar new file mode 100644 index 000000000..e68c3d90c Binary files /dev/null and b/android/Pubnub-Android-3.6.2.jar differ diff --git a/android/Pubnub-Android-3.6.3.jar b/android/Pubnub-Android-3.6.3.jar new file mode 100644 index 000000000..ca1d7209f Binary files /dev/null and b/android/Pubnub-Android-3.6.3.jar differ diff --git a/android/Pubnub-Android-3.7.0.jar b/android/Pubnub-Android-3.7.0.jar new file mode 100644 index 000000000..e24607779 Binary files /dev/null and b/android/Pubnub-Android-3.7.0.jar differ diff --git a/android/Pubnub-Android-3.8.0.jar b/android/Pubnub-Android-3.8.0.jar new file mode 100644 index 000000000..1f1b007ef Binary files /dev/null and b/android/Pubnub-Android-3.8.0.jar differ diff --git a/android/Pubnub-Android-3.8.1.jar b/android/Pubnub-Android-3.8.1.jar new file mode 100644 index 000000000..1c396f7d6 Binary files /dev/null and b/android/Pubnub-Android-3.8.1.jar differ diff --git a/android/Pubnub-Android-3.9.0.jar b/android/Pubnub-Android-3.9.0.jar new file mode 100644 index 000000000..d394cc1ec Binary files /dev/null and b/android/Pubnub-Android-3.9.0.jar differ diff --git a/android/Pubnub-Android-4.0.0.jar b/android/Pubnub-Android-4.0.0.jar new file mode 100644 index 000000000..4e54f9bbd Binary files /dev/null and b/android/Pubnub-Android-4.0.0.jar differ diff --git a/android/Pubnub-Android-5.0.0.jar b/android/Pubnub-Android-5.0.0.jar new file mode 100644 index 000000000..992c096d2 Binary files /dev/null and b/android/Pubnub-Android-5.0.0.jar differ diff --git a/android/README.md b/android/README.md new file mode 100644 index 000000000..7f6d3a594 --- /dev/null +++ b/android/README.md @@ -0,0 +1,221 @@ +##### VIDEO - ANDROID + PUBNUB +[http://www.youtube.com/watch?v=pkxUYYhwb04](http://www.youtube.com/watch?v=pkxUYYhwb04) + +##### YOU MUST HAVE A PUBNUB ACCOUNT TO USE THE API. + +http://www.pubnub.com/account + +## PubNub 3.5 Real-time Cloud Push API - ANDROID + +PubNub is a Massively Scalable Real-time Service for Web and Mobile Games. +This is a cloud-based service for broadcasting Real-time messages +to thousands of web and mobile clients simultaneously. + +The PubNub Android client provides a superior alternative to C2DM for broadcasting messages to entire user base. +C2DM is hard to implement, and it imposes artificial limits for you to reach your users quickly. +C2DM is not recommended as it is a "broadcast" mechanism according to Google. C2DM is Slow, and limited to 1 message at a time. +Use PubNub Instead! + +### Getting started with Pubnub in your app +To use Pubnub, simply copy the Pubnub-Android-3.4.jar and bcprov-jdk15on-1.47.jar files in to your project's libs directory. +These files can be found at pubnub/java/android/3.4/Pubnub-Android-3.4.jar and pubnub/java/java/3.4/libs/bcprov-jdk15on-1.47.jar. + +## Checkout the demo apps for examples on how to use the Android API! + +### PubNub Android Sample App + +This app demonstrates all PubNub features and functionality. It can be found in 3.4/examples/PubnubExample directory. + +### Pubnub Auto-subscribing, Auto-startup App +This is a sample app which subscribes to channel **"hello_world"** on receiving the **android.intent.action.BOOT_COMPLETED** intent. +The user is alerted about events like connect, message received etc. via notifications. + +Code for this app can be found in the 3.4/examples/SubscribeAtBoot directory. + +## Building the Pubnub library jar + +Pubnub library jar can be built by running following commands. ( Jar is already present in repository ) +``` +$ ant clean +$ ant +``` + +Pubnub library jar with debug messages enabled can be built by running following commands +``` +$ ant clean +$ and debug-build +``` + +##Connection Durability: Reconnecting & Resuming when a connection is lost or changed + +As a mobile device may lose its connection under many different circumstances (IP change, roaming, etc), any current in-process subscribe operations can be forced +to reconnect (and optionally catchup where left off) when any change has occured in the network environment. This is done by calling the +**disconnectAndResubscribe()** method on the PubNub instance. + +The demo application has examples of setting up a broadcast receiver for the **ConnectivityManager.CONNECTIVITY_ACTION**. +The **onReceive()** method is where it checks for certain (or any) network change conditions, and +calls **disconnectAndResubscribe()** as needed. + +```java + @Override + protected void onCreate(Bundle savedInstanceState) { + + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + this.registerReceiver(new BroadcastReceiver() { + @Override + public void onReceive(Context arg0, Intent intent) { + pubnub.disconnectAndResubscribe(); + } + + }, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION )); +``` + +This logic has been purposely left out of the core and documented in the example application, so that if you wish to +add additional tests for monitoring a potential zombied subscribe connection, it is very easy to add your own custom logic within this +given receiver template. + +When **disconnectAndResubscribe()** is called, either via the broadcast receiver or otherwise, it will retry maxRetries times +to reconnect ever retryInterval seconds. You can set these variables with the **setRetryInterval(int milliseconds)** and **setMaxRetries** methods. + +If it **not able** to recover network within the given constraints, it will return an error response of [0, ERROR_MSG_STRING]. + +**setResumeOnReconnect()** allows you to define the behaviour upon successful reconnect. + +If it **is able** to recover network, then the subscribe will "catchup", or resume where it left off before the interruption +if isResumeOnReconnect() is true, otherwise, it will restart and grab only new messages since it reconnected. + + +##Client API Summary + +###Init +```java +Pubnub pubnub = new Pubnub( + "demo", // PUBLISH_KEY (Optional, supply "" to disable) + "demo", // SUBSCRIBE_KEY (Required) + "", // SECRET_KEY (Optional, supply "" to disable) + "", // CIPHER_KEY (Optional, supply "" to disable) + false // SSL_ON? +); +``` + +###Publish +```java + +// Setup the argument Hash object to set the message and channel name + +Hashtable args = new Hashtable(2); + +String message = "Hello PubNub!"; +String message = "hello_world"; + +args.put("message", message); +args.put("channel", channel); + +// Publish It! + +pubnub.publish(args, new Callback() { + public void successCallback(String channel, Object message) { + notifyUser(message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(channel + " : " + message.toString()); + } +}); + +``` + +###Subscribe and Presence +```java + +// Regular Subscribe + +Hashtable args = new Hashtable(1); + +args.put("channel", channel); + +pubnub.subscribe(args, new Callback() { + public void connectCallback(String channel) { + notifyUser("CONNECT on channel:" + channel); + } + + public void disconnectCallback(String channel) { + notifyUser("DISCONNECT on channel:" + channel); + } + + public void reconnectCallback(String channel) { + notifyUser("RECONNECT on channel:" + channel); + } + + public void successCallback(String channel, Object message) { + notifyUser(channel + " " + message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(channel + " " + message.toString()); + } +}); + +// Presence + +pubnub.presence(channel, new Callback() { + public void successCallback(String channel, Object message) { + notifyUser(message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(channel + " : " + message.toString()); + } +}); + +``` + +###History +```java +pubnub.detailedHistory(channel, 2, new Callback() { + public void successCallback(String channel, Object message) { + notifyUser(message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(channel + " : " + message.toString()); + } +}); +``` + +###Unsubscribe +```java +String channel = "goodbye_world"; +pubnub.unsubscribe(channel); +``` + +###Time +```java + // Get server time + double time = pubnub.time(); + System.out.println("Time : "+time); +``` + +###UUID +```java + // Get UUID + System.out.println("UUID : "+Pubnub.uuid()); +``` + +###Here Now + +```java +pubnub.hereNow(channel, new Callback() { + public void successCallback(String channel, Object message) { + notifyUser(message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(channel + " : " + message.toString()); + } +}); +``` + + diff --git a/android/build.xml b/android/build.xml new file mode 100644 index 000000000..220684e4f --- /dev/null +++ b/android/build.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/examples/PubnubExample/AndroidManifest.xml b/android/examples/PubnubExample/AndroidManifest.xml new file mode 100644 index 000000000..816d1992e --- /dev/null +++ b/android/examples/PubnubExample/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/examples/PubnubExample/ic_launcher-web.png b/android/examples/PubnubExample/ic_launcher-web.png new file mode 100644 index 000000000..424f26042 Binary files /dev/null and b/android/examples/PubnubExample/ic_launcher-web.png differ diff --git a/android/examples/PubnubExample/libs/Pubnub-Android-3.5.1.jar b/android/examples/PubnubExample/libs/Pubnub-Android-3.5.1.jar new file mode 100644 index 000000000..5693cb9df Binary files /dev/null and b/android/examples/PubnubExample/libs/Pubnub-Android-3.5.1.jar differ diff --git a/android/examples/PubnubExample/libs/Pubnub-Android-3.6.0.jar b/android/examples/PubnubExample/libs/Pubnub-Android-3.6.0.jar new file mode 100644 index 000000000..2749b5bd5 Binary files /dev/null and b/android/examples/PubnubExample/libs/Pubnub-Android-3.6.0.jar differ diff --git a/android/examples/PubnubExample/libs/Pubnub-Android-3.6.1.jar b/android/examples/PubnubExample/libs/Pubnub-Android-3.6.1.jar new file mode 100644 index 000000000..3f1ab7651 Binary files /dev/null and b/android/examples/PubnubExample/libs/Pubnub-Android-3.6.1.jar differ diff --git a/android/examples/PubnubExample/libs/Pubnub-Android-3.6.2.jar b/android/examples/PubnubExample/libs/Pubnub-Android-3.6.2.jar new file mode 100644 index 000000000..e68c3d90c Binary files /dev/null and b/android/examples/PubnubExample/libs/Pubnub-Android-3.6.2.jar differ diff --git a/android/examples/PubnubExample/libs/Pubnub-Android-3.6.3.jar b/android/examples/PubnubExample/libs/Pubnub-Android-3.6.3.jar new file mode 100644 index 000000000..ca1d7209f Binary files /dev/null and b/android/examples/PubnubExample/libs/Pubnub-Android-3.6.3.jar differ diff --git a/android/examples/PubnubExample/libs/Pubnub-Android-3.7.0.jar b/android/examples/PubnubExample/libs/Pubnub-Android-3.7.0.jar new file mode 100644 index 000000000..e24607779 Binary files /dev/null and b/android/examples/PubnubExample/libs/Pubnub-Android-3.7.0.jar differ diff --git a/android/examples/PubnubExample/libs/Pubnub-Android-3.8.0.jar b/android/examples/PubnubExample/libs/Pubnub-Android-3.8.0.jar new file mode 100644 index 000000000..1f1b007ef Binary files /dev/null and b/android/examples/PubnubExample/libs/Pubnub-Android-3.8.0.jar differ diff --git a/android/examples/PubnubExample/libs/Pubnub-Android-3.8.1.jar b/android/examples/PubnubExample/libs/Pubnub-Android-3.8.1.jar new file mode 100644 index 000000000..1c396f7d6 Binary files /dev/null and b/android/examples/PubnubExample/libs/Pubnub-Android-3.8.1.jar differ diff --git a/android/examples/PubnubExample/libs/Pubnub-Android-3.9.0.jar b/android/examples/PubnubExample/libs/Pubnub-Android-3.9.0.jar new file mode 100644 index 000000000..d394cc1ec Binary files /dev/null and b/android/examples/PubnubExample/libs/Pubnub-Android-3.9.0.jar differ diff --git a/android/examples/PubnubExample/libs/Pubnub-Android-4.0.0.jar b/android/examples/PubnubExample/libs/Pubnub-Android-4.0.0.jar new file mode 100644 index 000000000..4e54f9bbd Binary files /dev/null and b/android/examples/PubnubExample/libs/Pubnub-Android-4.0.0.jar differ diff --git a/android/examples/PubnubExample/libs/Pubnub-Android-5.0.0.jar b/android/examples/PubnubExample/libs/Pubnub-Android-5.0.0.jar new file mode 100644 index 000000000..992c096d2 Binary files /dev/null and b/android/examples/PubnubExample/libs/Pubnub-Android-5.0.0.jar differ diff --git a/android/examples/PubnubExample/libs/android-support-v4.jar b/android/examples/PubnubExample/libs/android-support-v4.jar new file mode 100644 index 000000000..6080877d4 Binary files /dev/null and b/android/examples/PubnubExample/libs/android-support-v4.jar differ diff --git a/android/examples/PubnubExample/libs/bcprov-jdk15on-1.47.jar b/android/examples/PubnubExample/libs/bcprov-jdk15on-1.47.jar new file mode 100644 index 000000000..0b80922e6 Binary files /dev/null and b/android/examples/PubnubExample/libs/bcprov-jdk15on-1.47.jar differ diff --git a/android/examples/PubnubExample/proguard-project.txt b/android/examples/PubnubExample/proguard-project.txt new file mode 100644 index 000000000..5b89420db --- /dev/null +++ b/android/examples/PubnubExample/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} \ No newline at end of file diff --git a/android/examples/PubnubExample/project.properties b/android/examples/PubnubExample/project.properties new file mode 100644 index 000000000..0c9830a3b --- /dev/null +++ b/android/examples/PubnubExample/project.properties @@ -0,0 +1,14 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=Google Inc.:Google APIs:17 diff --git a/android/examples/PubnubExample/res/drawable-hdpi/ic_launcher.png b/android/examples/PubnubExample/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 000000000..0e79b184f Binary files /dev/null and b/android/examples/PubnubExample/res/drawable-hdpi/ic_launcher.png differ diff --git a/android/examples/PubnubExample/res/drawable-hdpi/ic_launcher_pubnub.png b/android/examples/PubnubExample/res/drawable-hdpi/ic_launcher_pubnub.png new file mode 100644 index 000000000..dae531896 Binary files /dev/null and b/android/examples/PubnubExample/res/drawable-hdpi/ic_launcher_pubnub.png differ diff --git a/android/examples/PubnubExample/res/drawable-hdpi/pubnub_large.png b/android/examples/PubnubExample/res/drawable-hdpi/pubnub_large.png new file mode 100644 index 000000000..231910435 Binary files /dev/null and b/android/examples/PubnubExample/res/drawable-hdpi/pubnub_large.png differ diff --git a/android/examples/PubnubExample/res/drawable-ldpi/ic_launcher.png b/android/examples/PubnubExample/res/drawable-ldpi/ic_launcher.png new file mode 100644 index 000000000..ebfac7d78 Binary files /dev/null and b/android/examples/PubnubExample/res/drawable-ldpi/ic_launcher.png differ diff --git a/android/examples/PubnubExample/res/drawable-ldpi/pubnub_large.png b/android/examples/PubnubExample/res/drawable-ldpi/pubnub_large.png new file mode 100644 index 000000000..231910435 Binary files /dev/null and b/android/examples/PubnubExample/res/drawable-ldpi/pubnub_large.png differ diff --git a/android/examples/PubnubExample/res/drawable-mdpi/ic_launcher.png b/android/examples/PubnubExample/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 000000000..118344193 Binary files /dev/null and b/android/examples/PubnubExample/res/drawable-mdpi/ic_launcher.png differ diff --git a/android/examples/PubnubExample/res/drawable-mdpi/ic_launcher_pubnub.png b/android/examples/PubnubExample/res/drawable-mdpi/ic_launcher_pubnub.png new file mode 100644 index 000000000..94ca3a50f Binary files /dev/null and b/android/examples/PubnubExample/res/drawable-mdpi/ic_launcher_pubnub.png differ diff --git a/android/examples/PubnubExample/res/drawable-mdpi/pubnub_large.png b/android/examples/PubnubExample/res/drawable-mdpi/pubnub_large.png new file mode 100644 index 000000000..231910435 Binary files /dev/null and b/android/examples/PubnubExample/res/drawable-mdpi/pubnub_large.png differ diff --git a/android/examples/PubnubExample/res/drawable-xhdpi/ic_launcher.png b/android/examples/PubnubExample/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 000000000..c8ab2a114 Binary files /dev/null and b/android/examples/PubnubExample/res/drawable-xhdpi/ic_launcher.png differ diff --git a/android/examples/PubnubExample/res/drawable-xhdpi/ic_launcher_pubnub.png b/android/examples/PubnubExample/res/drawable-xhdpi/ic_launcher_pubnub.png new file mode 100644 index 000000000..1ed434174 Binary files /dev/null and b/android/examples/PubnubExample/res/drawable-xhdpi/ic_launcher_pubnub.png differ diff --git a/android/examples/PubnubExample/res/drawable-xhdpi/pubnub_large.png b/android/examples/PubnubExample/res/drawable-xhdpi/pubnub_large.png new file mode 100644 index 000000000..231910435 Binary files /dev/null and b/android/examples/PubnubExample/res/drawable-xhdpi/pubnub_large.png differ diff --git a/android/examples/PubnubExample/res/drawable-xxhdpi/ic_launcher_pubnub.png b/android/examples/PubnubExample/res/drawable-xxhdpi/ic_launcher_pubnub.png new file mode 100644 index 000000000..290fc06b6 Binary files /dev/null and b/android/examples/PubnubExample/res/drawable-xxhdpi/ic_launcher_pubnub.png differ diff --git a/android/examples/PubnubExample/res/drawable/icon.png b/android/examples/PubnubExample/res/drawable/icon.png new file mode 100644 index 000000000..08ee50da9 Binary files /dev/null and b/android/examples/PubnubExample/res/drawable/icon.png differ diff --git a/android/examples/PubnubExample/res/layout/usage.xml b/android/examples/PubnubExample/res/layout/usage.xml new file mode 100644 index 000000000..a5a8f6754 --- /dev/null +++ b/android/examples/PubnubExample/res/layout/usage.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/examples/PubnubExample/res/menu/activity_main.xml b/android/examples/PubnubExample/res/menu/activity_main.xml new file mode 100644 index 000000000..41be348fa --- /dev/null +++ b/android/examples/PubnubExample/res/menu/activity_main.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/examples/PubnubExample/res/values-v11/styles.xml b/android/examples/PubnubExample/res/values-v11/styles.xml new file mode 100644 index 000000000..541752f6e --- /dev/null +++ b/android/examples/PubnubExample/res/values-v11/styles.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/android/examples/PubnubExample/res/values-v14/styles.xml b/android/examples/PubnubExample/res/values-v14/styles.xml new file mode 100644 index 000000000..f20e01501 --- /dev/null +++ b/android/examples/PubnubExample/res/values-v14/styles.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/android/examples/PubnubExample/res/values/dimens.xml b/android/examples/PubnubExample/res/values/dimens.xml new file mode 100644 index 000000000..a67ff7099 --- /dev/null +++ b/android/examples/PubnubExample/res/values/dimens.xml @@ -0,0 +1,12 @@ + + + 300dip + 150dip + 100dip + 20dip + 30dip + 15dip + 11dip + 10dip + 20dip + diff --git a/android/examples/PubnubExample/res/values/strings.xml b/android/examples/PubnubExample/res/values/strings.xml new file mode 100644 index 000000000..356a8ab1c --- /dev/null +++ b/android/examples/PubnubExample/res/values/strings.xml @@ -0,0 +1,39 @@ + + + + PubnubExample + Pubnub + Hello world! + Settings + History + Presence + Subscribe + Publish + History + Disconnect and Resubscribe + History + Toggle Catchup + Here Now + Message to Publish + Publish/Subscribe Test + Unsubscribe All + Welcome to the Pubnub Demo Console + Click Menu and select an action: + Subscribe + Publish + Presence + Detailed History + Here Now + Unsubscribe + Presence-Unsubscribe + Time + Disconnect-And-Resubscribe + Disconnect-And-Resubscribe with timetoken + Toggle Resume On Reconnect + Set MAX Retries + Set Retry Interval + Set Subscribe Timeout + Set Non Subscribe Timeout + + + \ No newline at end of file diff --git a/android/examples/PubnubExample/res/values/styles.xml b/android/examples/PubnubExample/res/values/styles.xml new file mode 100644 index 000000000..4a10ca492 --- /dev/null +++ b/android/examples/PubnubExample/res/values/styles.xml @@ -0,0 +1,20 @@ + + + + + + + + + \ No newline at end of file diff --git a/android/examples/PubnubExample/src/com/pubnub/examples/pubnubExample/MainActivity.java b/android/examples/PubnubExample/src/com/pubnub/examples/pubnubExample/MainActivity.java new file mode 100644 index 000000000..d269e606f --- /dev/null +++ b/android/examples/PubnubExample/src/com/pubnub/examples/pubnubExample/MainActivity.java @@ -0,0 +1,606 @@ +package com.pubnub.examples.pubnubExample; + +import java.util.Hashtable; + +import org.json.JSONArray; +import org.json.JSONObject; + +import android.app.Activity; +import android.app.AlertDialog; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.IntentFilter; +import android.net.ConnectivityManager; +import android.os.Bundle; +import android.text.InputType; +import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; +import android.widget.EditText; +import android.widget.Toast; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class MainActivity extends Activity { + /* + * //Noise Test Pubnub pubnub = new + * Pubnub("pub-c-87f96934-8c44-4f8d-a35f-deaa2753f083", + * "sub-c-3a693cf8-7401-11e2-8b02-12313f022c90", "", false); String channel + * = "noise"; String channel = "a"; + */ + + Pubnub pubnub = new Pubnub("demo", "demo", "", false); + + private void notifyUser(Object message) { + try { + if (message instanceof JSONObject) { + final JSONObject obj = (JSONObject) message; + this.runOnUiThread(new Runnable() { + public void run() { + Toast.makeText(getApplicationContext(), obj.toString(), + Toast.LENGTH_LONG).show(); + + Log.i("Received msg : ", String.valueOf(obj)); + } + }); + + } else if (message instanceof String) { + final String obj = (String) message; + this.runOnUiThread(new Runnable() { + public void run() { + Toast.makeText(getApplicationContext(), obj, + Toast.LENGTH_LONG).show(); + Log.i("Received msg : ", obj.toString()); + } + }); + + } else if (message instanceof JSONArray) { + final JSONArray obj = (JSONArray) message; + this.runOnUiThread(new Runnable() { + public void run() { + Toast.makeText(getApplicationContext(), obj.toString(), + Toast.LENGTH_LONG).show(); + Log.i("Received msg : ", obj.toString()); + } + }); + } + + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + + super.onCreate(savedInstanceState); + + setContentView(R.layout.usage); + this.registerReceiver(new BroadcastReceiver() { + @Override + public void onReceive(Context arg0, Intent intent) { + pubnub.disconnectAndResubscribe(); + + } + + }, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); + + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.activity_main, menu); + + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle item selection + switch (item.getItemId()) { + + case R.id.option1: + subscribe(); + return true; + + case R.id.option2: + publish(); + return true; + + case R.id.option3: + presence(); + return true; + + case R.id.option4: + detailedHistory(); + return true; + + case R.id.option5: + hereNow(); + return true; + + case R.id.option6: + unsubscribe(); + return true; + + case R.id.option7: + presenceUnsubscribe(); + return true; + + case R.id.option8: + time(); + return true; + + case R.id.option9: + disconnectAndResubscribe(); + return true; + + case R.id.option10: + disconnectAndResubscribeWithTimetoken(); + return true; + + case R.id.option11: + toggleResumeOnReconnect(); + return true; + + case R.id.option12: + setMaxRetries(); + return true; + + case R.id.option13: + setRetryInterval(); + return true; + + case R.id.option14: + setSubscribeTimeout(); + return true; + + case R.id.option15: + setNonSubscribeTimeout(); + return true; + default: + return super.onOptionsItemSelected(item); + } + } + + private void setNonSubscribeTimeout() { + + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Set Non Subscribe Timeout"); + builder.setMessage("Enter timeout value in milliseconds"); + final EditText edTimeout = new EditText(this); + edTimeout.setInputType(InputType.TYPE_CLASS_NUMBER); + builder.setView(edTimeout); + builder.setPositiveButton("Done", + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + pubnub.setNonSubscribeTimeout(Integer + .parseInt(edTimeout.getText().toString())); + } + }); + AlertDialog alert = builder.create(); + alert.show(); + } + + private void subscribe() { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Subscribe"); + builder.setMessage("Enter channel name"); + final EditText input = new EditText(this); + builder.setView(input); + builder.setPositiveButton("Subscribe", + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + + Hashtable args = new Hashtable(1); + + String message = input.getText().toString(); + args.put("channel", message); + + try { + pubnub.subscribe(args, new Callback() { + public void connectCallback(String channel, + Object message) { + notifyUser("SUBSCRIBE : CONNECT on channel:" + + channel + + " : " + + message.getClass() + + " : " + + message.toString()); + } + + public void disconnectCallback(String channel, + Object message) { + notifyUser("SUBSCRIBE : DISCONNECT on channel:" + + channel + + " : " + + message.getClass() + + " : " + + message.toString()); + } + + @Override + public void reconnectCallback(String channel, + Object message) { + notifyUser("SUBSCRIBE : RECONNECT on channel:" + + channel + + " : " + + message.getClass() + + " : " + + message.toString()); + } + + public void successCallback(String channel, + Object message) { + notifyUser("SUBSCRIBE : " + channel + " : " + + message.getClass() + " : " + + message.toString()); + } + + public void errorCallback(String channel, + Object message) { + notifyUser("SUBSCRIBE : ERROR on channel " + + channel + " : " + + message.getClass() + " : " + + message.toString()); + } + }); + + } catch (Exception e) { + + } + } + + }); + AlertDialog alert = builder.create(); + alert.show(); + + } + + private void _publish(final String channel) { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Publish"); + builder.setMessage("Enter message"); + final EditText etMessage = new EditText(this); + builder.setView(etMessage); + builder.setPositiveButton("Publish", + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + Hashtable args = new Hashtable(2); + + String message = etMessage.getText().toString(); + + if (args.get("message") == null) { + try { + Integer i = Integer.parseInt(message); + args.put("message", i); + } catch (Exception e) { + + } + } + if (args.get("message") == null) { + try { + Double d = Double.parseDouble(message); + args.put("message", d); + } catch (Exception e) { + + } + } + if (args.get("message") == null) { + try { + JSONArray js = new JSONArray(message); + args.put("message", js); + } catch (Exception e) { + + } + } + if (args.get("message") == null) { + try { + JSONObject js = new JSONObject(message); + args.put("message", js); + } catch (Exception e) { + + } + } + if (args.get("message") == null) { + args.put("message", message); + } + + // Publish Message + + args.put("channel", channel); // Channel Name + + pubnub.publish(args, new Callback() { + public void successCallback(String channel, + Object message) { + notifyUser("PUBLISH : " + message); + } + + public void errorCallback(String channel, + Object message) { + notifyUser("PUBLISH : " + message); + } + }); + } + + }); + AlertDialog alert = builder.create(); + alert.show(); + + } + + private void publish() { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Publish "); + builder.setMessage("Enter channel name"); + final EditText etChannel = new EditText(this); + builder.setView(etChannel); + builder.setPositiveButton("Done", + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + _publish(etChannel.getText().toString()); + } + + }); + AlertDialog alert = builder.create(); + alert.show(); + } + + private void presence() { + + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Presence"); + builder.setMessage("Enter channel name"); + final EditText input = new EditText(this); + builder.setView(input); + builder.setPositiveButton("Subscribe For Presence", + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + String channel = input.getText().toString(); + + try { + pubnub.presence(channel, new Callback() { + + public void successCallback(String channel, + Object message) { + notifyUser("PRESENCE : " + channel + " : " + + message.getClass() + " : " + + message.toString()); + } + + public void errorCallback(String channel, + Object message) { + notifyUser("PRESENCE : ERROR on channel " + + channel + " : " + + message.getClass() + " : " + + message.toString()); + } + }); + + } catch (Exception e) { + + } + } + + }); + AlertDialog alert = builder.create(); + alert.show(); + } + + private void detailedHistory() { + + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Detailed History"); + builder.setMessage("Enter channel name"); + final EditText input = new EditText(this); + builder.setView(input); + builder.setPositiveButton("Get detailed history", + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + String channel = input.getText().toString(); + pubnub.detailedHistory(channel, 2, new Callback() { + public void successCallback(String channel, + Object message) { + notifyUser("DETAILED HISTORY : " + message); + } + + public void errorCallback(String channel, + Object message) { + notifyUser("DETAILED HISTORY : " + message); + } + }); + } + + }); + AlertDialog alert = builder.create(); + alert.show(); + } + + private void hereNow() { + + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Here Now"); + builder.setMessage("Enter channel name"); + final EditText input = new EditText(this); + builder.setView(input); + builder.setPositiveButton("Get Here Now", + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + String channel = input.getText().toString(); + pubnub.hereNow(channel, new Callback() { + public void successCallback(String channel, + Object message) { + notifyUser("HERE NOW : " + message); + } + + public void errorCallback(String channel, + Object message) { + notifyUser("HERE NOW : " + message); + } + }); + } + + }); + AlertDialog alert = builder.create(); + alert.show(); + } + + private void unsubscribe() { + + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Unsubscribe"); + builder.setMessage("Enter channel name"); + final EditText input = new EditText(this); + builder.setView(input); + builder.setPositiveButton("Unsubscribe", + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + String channel = input.getText().toString(); + pubnub.unsubscribe(channel); + } + }); + AlertDialog alert = builder.create(); + alert.show(); + } + + private void presenceUnsubscribe() { + + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Unsubscribe Presence"); + builder.setMessage("Enter channel name"); + final EditText input = new EditText(this); + builder.setView(input); + builder.setPositiveButton("Unsubscribe Presence", + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + String channel = input.getText().toString(); + pubnub.unsubscribePresence(channel); + } + }); + AlertDialog alert = builder.create(); + alert.show(); + } + + private void time() { + pubnub.time(new Callback() { + public void successCallback(String channel, Object message) { + notifyUser("TIME : " + message); + } + + public void errorCallback(String channel, Object message) { + notifyUser("TIME : " + message); + } + }); + + } + + private void disconnectAndResubscribe() { + pubnub.disconnectAndResubscribe("Disconnect and Resubscribe Sent from Demo Console"); + + } + + private void setSubscribeTimeout() { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Set Subscribe Timeout"); + builder.setMessage("Enter timeout value in milliseconds"); + final EditText edTimeout = new EditText(this); + edTimeout.setInputType(InputType.TYPE_CLASS_NUMBER); + builder.setView(edTimeout); + builder.setPositiveButton("Done", + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + pubnub.setSubscribeTimeout(Integer.parseInt(edTimeout + .getText().toString())); + } + + }); + AlertDialog alert = builder.create(); + alert.show(); + + } + + private void setRetryInterval() { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Set Retry Interval"); + builder.setMessage("Enter retry interval in milliseconds"); + final EditText edInterval = new EditText(this); + edInterval.setInputType(InputType.TYPE_CLASS_NUMBER); + builder.setView(edInterval); + builder.setPositiveButton("Done", + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + pubnub.setRetryInterval(Integer.parseInt(edInterval + .getText().toString())); + } + + }); + AlertDialog alert = builder.create(); + alert.show(); + } + + private void toggleResumeOnReconnect() { + pubnub.setResumeOnReconnect(pubnub.isResumeOnReconnect() ? false : true); + notifyUser("RESUME ON RECONNECT : " + pubnub.isResumeOnReconnect()); + } + + private void setMaxRetries() { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Set Max Retries"); + builder.setMessage("Enter Max Retries"); + final EditText edRetries = new EditText(this); + edRetries.setInputType(InputType.TYPE_CLASS_NUMBER); + builder.setView(edRetries); + builder.setPositiveButton("Done", + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + pubnub.setMaxRetries(Integer.parseInt(edRetries + .getText().toString())); + } + }); + AlertDialog alert = builder.create(); + alert.show(); + } + + private void disconnectAndResubscribeWithTimetoken() { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Disconnect and Resubscribe with timetoken"); + builder.setMessage("Enter Timetoken"); + final EditText edTimetoken = new EditText(this); + builder.setView(edTimetoken); + builder.setPositiveButton("Done", + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + pubnub.disconnectAndResubscribeWithTimetoken( + edTimetoken.getText().toString(), + "Disconnect and Resubscribe Sent from Demo Console"); + } + }); + AlertDialog alert = builder.create(); + alert.show(); + } +} diff --git a/android/examples/SubscribeAtBoot/AndroidManifest.xml b/android/examples/SubscribeAtBoot/AndroidManifest.xml new file mode 100644 index 000000000..feb2252c6 --- /dev/null +++ b/android/examples/SubscribeAtBoot/AndroidManifest.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/examples/SubscribeAtBoot/ic_launcher-web.png b/android/examples/SubscribeAtBoot/ic_launcher-web.png new file mode 100644 index 000000000..a18cbb48c Binary files /dev/null and b/android/examples/SubscribeAtBoot/ic_launcher-web.png differ diff --git a/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.4.jar b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.4.jar new file mode 100644 index 000000000..9b47d2613 Binary files /dev/null and b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.4.jar differ diff --git a/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.5.1.jar b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.5.1.jar new file mode 100644 index 000000000..5693cb9df Binary files /dev/null and b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.5.1.jar differ diff --git a/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.6.0.jar b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.6.0.jar new file mode 100644 index 000000000..2749b5bd5 Binary files /dev/null and b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.6.0.jar differ diff --git a/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.6.1.jar b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.6.1.jar new file mode 100644 index 000000000..3f1ab7651 Binary files /dev/null and b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.6.1.jar differ diff --git a/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.6.2.jar b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.6.2.jar new file mode 100644 index 000000000..e68c3d90c Binary files /dev/null and b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.6.2.jar differ diff --git a/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.6.3.jar b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.6.3.jar new file mode 100644 index 000000000..ca1d7209f Binary files /dev/null and b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.6.3.jar differ diff --git a/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.7.0.jar b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.7.0.jar new file mode 100644 index 000000000..e24607779 Binary files /dev/null and b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.7.0.jar differ diff --git a/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.8.0.jar b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.8.0.jar new file mode 100644 index 000000000..1f1b007ef Binary files /dev/null and b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.8.0.jar differ diff --git a/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.8.1.jar b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.8.1.jar new file mode 100644 index 000000000..1c396f7d6 Binary files /dev/null and b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.8.1.jar differ diff --git a/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.9.0.jar b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.9.0.jar new file mode 100644 index 000000000..d394cc1ec Binary files /dev/null and b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.9.0.jar differ diff --git a/android/examples/SubscribeAtBoot/libs/Pubnub-Android-4.0.0.jar b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-4.0.0.jar new file mode 100644 index 000000000..4e54f9bbd Binary files /dev/null and b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-4.0.0.jar differ diff --git a/android/examples/SubscribeAtBoot/libs/Pubnub-Android-5.0.0.jar b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-5.0.0.jar new file mode 100644 index 000000000..992c096d2 Binary files /dev/null and b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-5.0.0.jar differ diff --git a/android/examples/SubscribeAtBoot/libs/android-support-v4.jar b/android/examples/SubscribeAtBoot/libs/android-support-v4.jar new file mode 100644 index 000000000..6080877d4 Binary files /dev/null and b/android/examples/SubscribeAtBoot/libs/android-support-v4.jar differ diff --git a/android/examples/SubscribeAtBoot/proguard-project.txt b/android/examples/SubscribeAtBoot/proguard-project.txt new file mode 100644 index 000000000..f2fe1559a --- /dev/null +++ b/android/examples/SubscribeAtBoot/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/android/examples/SubscribeAtBoot/project.properties b/android/examples/SubscribeAtBoot/project.properties new file mode 100644 index 000000000..0c9830a3b --- /dev/null +++ b/android/examples/SubscribeAtBoot/project.properties @@ -0,0 +1,14 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=Google Inc.:Google APIs:17 diff --git a/android/examples/SubscribeAtBoot/res/drawable-hdpi/ic_launcher.png b/android/examples/SubscribeAtBoot/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 000000000..131c6370a Binary files /dev/null and b/android/examples/SubscribeAtBoot/res/drawable-hdpi/ic_launcher.png differ diff --git a/android/examples/SubscribeAtBoot/res/drawable-hdpi/pubnub_large.png b/android/examples/SubscribeAtBoot/res/drawable-hdpi/pubnub_large.png new file mode 100644 index 000000000..231910435 Binary files /dev/null and b/android/examples/SubscribeAtBoot/res/drawable-hdpi/pubnub_large.png differ diff --git a/android/examples/SubscribeAtBoot/res/drawable-ldpi/pubnub_large.png b/android/examples/SubscribeAtBoot/res/drawable-ldpi/pubnub_large.png new file mode 100644 index 000000000..231910435 Binary files /dev/null and b/android/examples/SubscribeAtBoot/res/drawable-ldpi/pubnub_large.png differ diff --git a/android/examples/SubscribeAtBoot/res/drawable-mdpi/ic_launcher.png b/android/examples/SubscribeAtBoot/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 000000000..068d9e4cb Binary files /dev/null and b/android/examples/SubscribeAtBoot/res/drawable-mdpi/ic_launcher.png differ diff --git a/android/examples/SubscribeAtBoot/res/drawable-mdpi/pubnub_large.png b/android/examples/SubscribeAtBoot/res/drawable-mdpi/pubnub_large.png new file mode 100644 index 000000000..231910435 Binary files /dev/null and b/android/examples/SubscribeAtBoot/res/drawable-mdpi/pubnub_large.png differ diff --git a/android/examples/SubscribeAtBoot/res/drawable-xhdpi/ic_launcher.png b/android/examples/SubscribeAtBoot/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 000000000..2e9dc7df7 Binary files /dev/null and b/android/examples/SubscribeAtBoot/res/drawable-xhdpi/ic_launcher.png differ diff --git a/android/examples/SubscribeAtBoot/res/drawable-xhdpi/pubnub_large.png b/android/examples/SubscribeAtBoot/res/drawable-xhdpi/pubnub_large.png new file mode 100644 index 000000000..231910435 Binary files /dev/null and b/android/examples/SubscribeAtBoot/res/drawable-xhdpi/pubnub_large.png differ diff --git a/android/examples/SubscribeAtBoot/res/drawable-xxhdpi/ic_launcher.png b/android/examples/SubscribeAtBoot/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..783cd2c9b Binary files /dev/null and b/android/examples/SubscribeAtBoot/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/android/examples/SubscribeAtBoot/res/drawable/icon.png b/android/examples/SubscribeAtBoot/res/drawable/icon.png new file mode 100644 index 000000000..08ee50da9 Binary files /dev/null and b/android/examples/SubscribeAtBoot/res/drawable/icon.png differ diff --git a/android/examples/SubscribeAtBoot/res/values-v11/styles.xml b/android/examples/SubscribeAtBoot/res/values-v11/styles.xml new file mode 100644 index 000000000..541752f6e --- /dev/null +++ b/android/examples/SubscribeAtBoot/res/values-v11/styles.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/android/examples/SubscribeAtBoot/res/values-v14/styles.xml b/android/examples/SubscribeAtBoot/res/values-v14/styles.xml new file mode 100644 index 000000000..f20e01501 --- /dev/null +++ b/android/examples/SubscribeAtBoot/res/values-v14/styles.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/android/examples/SubscribeAtBoot/res/values/strings.xml b/android/examples/SubscribeAtBoot/res/values/strings.xml new file mode 100644 index 000000000..ef18a1bcc --- /dev/null +++ b/android/examples/SubscribeAtBoot/res/values/strings.xml @@ -0,0 +1,4 @@ + + + SubscribeAtBoot + \ No newline at end of file diff --git a/android/examples/SubscribeAtBoot/res/values/styles.xml b/android/examples/SubscribeAtBoot/res/values/styles.xml new file mode 100644 index 000000000..4a10ca492 --- /dev/null +++ b/android/examples/SubscribeAtBoot/res/values/styles.xml @@ -0,0 +1,20 @@ + + + + + + + + + \ No newline at end of file diff --git a/android/examples/SubscribeAtBoot/src/com/pubnub/examples/subscribeAtBoot/BootReceiver.java b/android/examples/SubscribeAtBoot/src/com/pubnub/examples/subscribeAtBoot/BootReceiver.java new file mode 100644 index 000000000..e0a44bbe8 --- /dev/null +++ b/android/examples/SubscribeAtBoot/src/com/pubnub/examples/subscribeAtBoot/BootReceiver.java @@ -0,0 +1,18 @@ +package com.pubnub.examples.subscribeAtBoot; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.util.Log; + +public class BootReceiver extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent arg1) { + Log.i("PubnubService", "PubNub BootReceiver Starting"); + Intent intent = new Intent(context, PubnubService.class); + context.startService(intent); + Log.i("PubnubService", "PubNub BootReceiver Started"); + } + +} diff --git a/android/examples/SubscribeAtBoot/src/com/pubnub/examples/subscribeAtBoot/HelloWorldActivity.java b/android/examples/SubscribeAtBoot/src/com/pubnub/examples/subscribeAtBoot/HelloWorldActivity.java new file mode 100644 index 000000000..021083b30 --- /dev/null +++ b/android/examples/SubscribeAtBoot/src/com/pubnub/examples/subscribeAtBoot/HelloWorldActivity.java @@ -0,0 +1,23 @@ +package com.pubnub.examples.subscribeAtBoot; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; + + +public class HelloWorldActivity extends Activity { + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // In new versions of Android, the service may not be activated unless an + // associated activity is run at least once. This empty activity serves + // that purpose + + Intent serviceIntent = new Intent(this, PubnubService.class); + startService(serviceIntent); + + Log.i("HelloWorldActivity", "PubNub Activity Started!"); + + } +} \ No newline at end of file diff --git a/android/examples/SubscribeAtBoot/src/com/pubnub/examples/subscribeAtBoot/PubnubService.java b/android/examples/SubscribeAtBoot/src/com/pubnub/examples/subscribeAtBoot/PubnubService.java new file mode 100644 index 000000000..cabc11674 --- /dev/null +++ b/android/examples/SubscribeAtBoot/src/com/pubnub/examples/subscribeAtBoot/PubnubService.java @@ -0,0 +1,98 @@ +package com.pubnub.examples.subscribeAtBoot; + +import android.os.Handler; +import android.os.Message; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; +import com.pubnub.api.PubnubException; + + +import android.app.Service; +import android.content.Intent; +import android.os.IBinder; +import android.util.Log; +import android.widget.Toast; + +public class PubnubService extends Service { + + String channel = "hello_world"; + Pubnub pubnub = new Pubnub("demo", "demo", false); + + private final Handler handler = new Handler() { + public void handleMessage(Message msg) { + String pnMsg = msg.obj.toString(); + + final Toast toast = Toast.makeText(getApplicationContext(), pnMsg, Toast.LENGTH_SHORT); + toast.show(); + + Handler handler = new Handler(); + handler.postDelayed(new Runnable() { + @Override + public void run() { + toast.cancel(); + } + }, 200); + + } + }; + + private void notifyUser(Object message) { + + Message msg = handler.obtainMessage(); + + try { + final String obj = (String) message; + msg.obj = obj; + handler.sendMessage(msg); + Log.i("Received msg : ", obj.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void onCreate() { + super.onCreate(); + Toast.makeText(this, "PubnubService created...", Toast.LENGTH_LONG).show(); + Log.i("PUBNUB", "PubnubService created..."); + try { + pubnub.subscribe(new String[]{channel}, new Callback() { + public void connectCallback(String channel) { + notifyUser("CONNECT on channel:" + channel); + } + + public void disconnectCallback(String channel) { + notifyUser("DISCONNECT on channel:" + channel); + } + + public void reconnectCallback(String channel) { + notifyUser("RECONNECT on channel:" + channel); + } + + public void successCallback(String channel, Object message) { + notifyUser(channel + " " + message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(channel + " " + message.toString()); + } + }); + } catch (PubnubException e) { + + } + } + + @Override + public void onDestroy() { + super.onDestroy(); + Toast.makeText(this, "PubnubService destroyed...", Toast.LENGTH_LONG).show(); + } + + @Override + public IBinder onBind(Intent intent) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/android/libs/android-8.jar b/android/libs/android-8.jar new file mode 100644 index 000000000..24ae5637d Binary files /dev/null and b/android/libs/android-8.jar differ diff --git a/android/res/drawable/icon.png b/android/res/drawable/icon.png new file mode 100644 index 000000000..08ee50da9 Binary files /dev/null and b/android/res/drawable/icon.png differ diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml new file mode 100644 index 000000000..6a2f2b38c --- /dev/null +++ b/android/res/values/strings.xml @@ -0,0 +1,4 @@ + + + threefour + \ No newline at end of file diff --git a/android/src/com/pubnub/api/Pubnub.java b/android/src/com/pubnub/api/Pubnub.java new file mode 100644 index 000000000..32b3bd092 --- /dev/null +++ b/android/src/com/pubnub/api/Pubnub.java @@ -0,0 +1,124 @@ +package com.pubnub.api; + +import java.util.UUID; + +/** + * Pubnub object facilitates querying channels for messages and listening on + * channels for presence/message events + * + * @author Pubnub + * + */ + +public class Pubnub extends PubnubCore { + /** + * Pubnub Constructor + * + * @param publish_key + * Publish Key + * @param subscribe_key + * Subscribe Key + * @param secret_key + * Secret Key + * @param cipher_key + * Cipher Key + * @param ssl_on + * SSL on ? + */ + public Pubnub(String publish_key, String subscribe_key, String secret_key, + String cipher_key, boolean ssl_on) { + super(publish_key, subscribe_key, secret_key, cipher_key, ssl_on); + } + + /** + * Pubnub Constructor + * + * @param publish_key + * Publish key + * @param subscribe_key + * Subscribe Key + * @param secret_key + * Secret Key + * @param ssl_on + * SSL on ? + */ + public Pubnub(String publish_key, String subscribe_key, String secret_key, + boolean ssl_on) { + super(publish_key, subscribe_key, secret_key, "", ssl_on); + } + + /** + * Pubnub Constructor + * + * @param publish_key + * Publish Key + * @param subscribe_key + * Subscribe Key + */ + public Pubnub(String publish_key, String subscribe_key) { + super(publish_key, subscribe_key, "", "", false); + } + + /** + * @param publish_key + * Publish Key + * @param subscribe_key + * Subscribe Key + * @param ssl + */ + public Pubnub(String publish_key, String subscribe_key, boolean ssl) { + super(publish_key, subscribe_key, "", "", ssl); + } + + /** + * @param publish_key + * @param subscribe_key + * @param secret_key + */ + public Pubnub(String publish_key, String subscribe_key, String secret_key) { + super(publish_key, subscribe_key, secret_key, "", false); + } + + /** + * Sets value for UUID + * + * @param uuid + * UUID value for Pubnub client + */ + public void setUUID(UUID uuid) { + this.UUID = uuid.toString(); + } + + protected String uuid() { + return java.util.UUID.randomUUID().toString(); + } + + /** + * This method sets timeout value for subscribe/presence. Default value is + * 310000 milliseconds i.e. 310 seconds + * + * @param timeout + * Timeout value in milliseconds for subscribe/presence + */ + public void setSubscribeTimeout(int timeout) { + super.setSubscribeTimeout(timeout); + } + + /** + * This method set timeout value for non subscribe operations like publish, + * history, hereNow. Default value is 15000 milliseconds i.e. 15 seconds. + * + * @param timeout + * Timeout value in milliseconds for Non subscribe operations + * like publish, history, hereNow + */ + public void setNonSubscribeTimeout(int timeout) { + super.setNonSubscribeTimeout(timeout); + } + + protected String getUserAgent() { + return "(Android " + android.os.Build.VERSION.RELEASE + + "; " + android.os.Build.MODEL + + " Build) PubNub-Java/Android/3.4.0"; + } +} diff --git a/android/srcLogging/com/pubnub/api/Logger.java b/android/srcLogging/com/pubnub/api/Logger.java new file mode 100644 index 000000000..983c3fdb0 --- /dev/null +++ b/android/srcLogging/com/pubnub/api/Logger.java @@ -0,0 +1,24 @@ +package com.pubnub.api; + +import android.util.Log; + +public class Logger extends AbstractLogger { + Class _class; + public Logger(Class _class) { + super(); + this._class = _class; + } + + protected void nativeDebug(String s) { + Log.d(_class.getName(), s); + } + protected void nativeVerbose(String s) { + Log.v(_class.getName(), s); + } + protected void nativeError(String s) { + Log.e(_class.getName(), s); + } + protected void nativeInfo(String s) { + Log.i(_class.getName(), s ); + } +} diff --git a/blackberry/CHANGELOG b/blackberry/CHANGELOG new file mode 100644 index 000000000..1d3845441 --- /dev/null +++ b/blackberry/CHANGELOG @@ -0,0 +1,8 @@ +CHANGELOG + +02-12-2013 - 89e2be5e5f0fa872fcdf617a6c9af9ce30ae7807 +. client is now fully asyncronous +. added enhanced multiplexed subscribe support +. better error handling added to example app +. improved keep-alive handling +. support for chunked responses diff --git a/blackberry/Pubnub-BlackBerry-3.5.1.jar b/blackberry/Pubnub-BlackBerry-3.5.1.jar new file mode 100644 index 000000000..472b71e58 Binary files /dev/null and b/blackberry/Pubnub-BlackBerry-3.5.1.jar differ diff --git a/blackberry/Pubnub-BlackBerry-3.6.0.jar b/blackberry/Pubnub-BlackBerry-3.6.0.jar new file mode 100644 index 000000000..3a0eda7ad Binary files /dev/null and b/blackberry/Pubnub-BlackBerry-3.6.0.jar differ diff --git a/blackberry/Pubnub-BlackBerry-3.6.1.jar b/blackberry/Pubnub-BlackBerry-3.6.1.jar new file mode 100644 index 000000000..1aad2cbab Binary files /dev/null and b/blackberry/Pubnub-BlackBerry-3.6.1.jar differ diff --git a/blackberry/Pubnub-BlackBerry-3.6.2.jar b/blackberry/Pubnub-BlackBerry-3.6.2.jar new file mode 100644 index 000000000..dc7d244f2 Binary files /dev/null and b/blackberry/Pubnub-BlackBerry-3.6.2.jar differ diff --git a/blackberry/Pubnub-BlackBerry-3.6.3.jar b/blackberry/Pubnub-BlackBerry-3.6.3.jar new file mode 100644 index 000000000..0e01dd73f Binary files /dev/null and b/blackberry/Pubnub-BlackBerry-3.6.3.jar differ diff --git a/blackberry/Pubnub-BlackBerry-3.7.0.jar b/blackberry/Pubnub-BlackBerry-3.7.0.jar new file mode 100644 index 000000000..dd4190c5b Binary files /dev/null and b/blackberry/Pubnub-BlackBerry-3.7.0.jar differ diff --git a/blackberry/Pubnub-BlackBerry-3.8.0.jar b/blackberry/Pubnub-BlackBerry-3.8.0.jar new file mode 100644 index 000000000..1f4fe1240 Binary files /dev/null and b/blackberry/Pubnub-BlackBerry-3.8.0.jar differ diff --git a/blackberry/Pubnub-BlackBerry-3.8.1.jar b/blackberry/Pubnub-BlackBerry-3.8.1.jar new file mode 100644 index 000000000..410c84315 Binary files /dev/null and b/blackberry/Pubnub-BlackBerry-3.8.1.jar differ diff --git a/blackberry/Pubnub-BlackBerry-3.9.0.jar b/blackberry/Pubnub-BlackBerry-3.9.0.jar new file mode 100644 index 000000000..cb97db69f Binary files /dev/null and b/blackberry/Pubnub-BlackBerry-3.9.0.jar differ diff --git a/blackberry/Pubnub-BlackBerry-4.0.0.jar b/blackberry/Pubnub-BlackBerry-4.0.0.jar new file mode 100644 index 000000000..fb67582b1 Binary files /dev/null and b/blackberry/Pubnub-BlackBerry-4.0.0.jar differ diff --git a/blackberry/Pubnub-BlackBerry-5.0.0.jar b/blackberry/Pubnub-BlackBerry-5.0.0.jar new file mode 100644 index 000000000..714d328af Binary files /dev/null and b/blackberry/Pubnub-BlackBerry-5.0.0.jar differ diff --git a/blackberry/README.md b/blackberry/README.md new file mode 100644 index 000000000..bdeb630fa --- /dev/null +++ b/blackberry/README.md @@ -0,0 +1,104 @@ +##### YOU MUST HAVE A PUBNUB ACCOUNT TO USE THE API. +##### http://www.pubnub.com/account + +## PubNub 3.5 Real-time Cloud Push API - BlackBerry + +www.pubnub.com - PubNub Real-time Push Service in the Cloud. + +Please reference the demo app source code for examples of supercharging your Blackberry app with PubNub! + +## Hello PubNub Demo App HOWTO + +Follow this HOWTO step-by-step to setup the demo PubNub app for Blackberry from within Eclipse. + +a. Open the Eclipse (Blackberry Java Plugin) + +b. Goto File -> New -> Blackberry Project + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/1.png) + +c. Enter a project name ( for this example, we'll use PubnubExample ) and click Next + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/2.png) + +Your screen should look similar to: + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/3.png) + +d. Click "Link additional Source" + +e. Browse to and select ```java/blackberry/3.4/examples/PubnubExample/src``` and enter Folder name as src1 + +Your screen should look similar to: + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/4.png) + +f. Click "Finish" + +g. Select the Libraries tab + +h. Click "Add External JARs" + +i. Select ```bouncycastle.jar``` and ```Pubnub-Microedition-3.4.jar``` from ```pubnub-api/blackberry/3.4/libs``` + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/5.png) + +Your screen should look similar to: + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/6.png) + +j. Go to the "Order and Export" tab and check the boxes against **bouncycastle.jar** and **Pubnub-Microedition-3.4.jar**. + +k. Click "Finish" + +Your screen should look similar to: + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/7.png) + +and the "Project View" should look like this when "src1" and "Referenced Libraries" are expanded: + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/8.png) + +l. Create a Run Configuration by clicking Run -> Run Configurations from the menu + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/9.png) + +m. Select **Blackberry Simulator**, right-click, and select **New** + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/10.png) + +You will now have access to some new tabs. + +n. Click the "Projects" tab + +o. Check the box against PubnubExample + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/11.png) + +p. Click the "Simulator" tab, and confirm the **Launch Mobile Data System Connection Service (MDS-CS) with simulator** checkbox is selected + +q. Change the configuration name to PubnubExample + +r. Click "Apply" + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/12.png) + +s. Right click PubnubExample in package explorer. + +t. Select **Run As** -> **Blackberry Simulator** + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/14.png) + +This will start MDS on command prompt and Blackberry Simulator + +**NOTE**: MDS may need to be manually started by running run.bat located at ```Eclipse\plugins\net.rim.ejde.componentpack7.1.0_7.1.0.10\components\MDS``` + +u. The MDS console will display debug information as the simulator phone boots. + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/15.png) + +v. Once the simulator has booted, scroll to and select **PubnubExample** (it will have the default “App Window” icon) + +w. Run it, and select the menu button to see it run various PubNub for Blackberry API methods. + +![File New](https://s3.amazonaws.com/pubnub-readme/blackberry/17.png) diff --git a/blackberry/build.xml b/blackberry/build.xml new file mode 100644 index 000000000..36f6c946d --- /dev/null +++ b/blackberry/build.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blackberry/examples/PubnubExample/PubnubExample.cod b/blackberry/examples/PubnubExample/PubnubExample.cod new file mode 100644 index 000000000..e66be6916 Binary files /dev/null and b/blackberry/examples/PubnubExample/PubnubExample.cod differ diff --git a/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/DetailedHistory.java b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/DetailedHistory.java new file mode 100644 index 000000000..49526cffd --- /dev/null +++ b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/DetailedHistory.java @@ -0,0 +1,45 @@ +package com.pubnub.examples.blackberry; + +import net.rim.device.api.ui.Field; +import net.rim.device.api.ui.FieldChangeListener; +import net.rim.device.api.ui.component.BasicEditField; +import net.rim.device.api.ui.component.ButtonField; +import net.rim.device.api.ui.container.MainScreen; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class DetailedHistory extends PubnubCommand { + + public DetailedHistory(Pubnub pubnub) { + super(pubnub, "Detailed History"); + } + + protected void initScreen() { + final BasicEditField txtChannel = new BasicEditField("Channel : ", "", 256, BasicEditField.FILTER_DEFAULT); + final BasicEditField txtCount = new BasicEditField("Count : ", "",20, BasicEditField.FILTER_INTEGER); + screen = new MainScreen(); + screen.add(txtChannel); + screen.add(txtCount); + + ButtonField btn = new ButtonField(); + btn.setLabel("Get Detailed History"); + screen.add(btn); + + btn.setChangeListener(new FieldChangeListener() { + + public void fieldChanged(Field field, int context) { + _pubnub.detailedHistory(txtChannel.toString(), Integer.parseInt(txtCount.toString()), new Callback() { + public void successCallback(String channel, Object message) { + notifyUser(message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(channel + " : " + message.toString()); + } + }); + close(); + }}); + } + +} diff --git a/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/DisconnectAndResubscribe.java b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/DisconnectAndResubscribe.java new file mode 100644 index 000000000..1d057b755 --- /dev/null +++ b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/DisconnectAndResubscribe.java @@ -0,0 +1,18 @@ +package com.pubnub.examples.blackberry; + +import com.pubnub.api.Pubnub; + +public class DisconnectAndResubscribe extends PubnubCommand { + + public DisconnectAndResubscribe(Pubnub pubnub) { + super(pubnub, "Disconnect & Resubscribe"); + } + + protected void initScreen() { + + } + public void handler() { + _pubnub.disconnectAndResubscribe(); + } + +} diff --git a/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/HereNow.java b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/HereNow.java new file mode 100644 index 000000000..7945b6864 --- /dev/null +++ b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/HereNow.java @@ -0,0 +1,43 @@ +package com.pubnub.examples.blackberry; + +import net.rim.device.api.ui.Field; +import net.rim.device.api.ui.FieldChangeListener; +import net.rim.device.api.ui.component.BasicEditField; +import net.rim.device.api.ui.component.ButtonField; +import net.rim.device.api.ui.container.MainScreen; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class HereNow extends PubnubCommand { + + public HereNow(Pubnub pubnub) { + super(pubnub, "Here Now"); + } + + protected void initScreen() { + final BasicEditField txtChannel = new BasicEditField("Channel : ", "", 256, BasicEditField.FILTER_DEFAULT); + screen = new MainScreen(); + screen.add(txtChannel); + + ButtonField btn = new ButtonField(); + btn.setLabel("Get Here Now Data"); + screen.add(btn); + + btn.setChangeListener(new FieldChangeListener() { + + public void fieldChanged(Field field, int context) { + _pubnub.hereNow(txtChannel.toString(), new Callback() { + public void successCallback(String channel, Object message) { + notifyUser(message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(channel + " : " + message.toString()); + } + }); + close(); + }}); + } + +} diff --git a/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/History.java b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/History.java new file mode 100644 index 000000000..db19ec452 --- /dev/null +++ b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/History.java @@ -0,0 +1,44 @@ +package com.pubnub.examples.blackberry; + +import net.rim.device.api.ui.Field; +import net.rim.device.api.ui.FieldChangeListener; +import net.rim.device.api.ui.component.BasicEditField; +import net.rim.device.api.ui.component.ButtonField; +import net.rim.device.api.ui.container.MainScreen; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class History extends PubnubCommand { + + public History(Pubnub pubnub) { + super(pubnub, "History"); + } + + protected void initScreen() { + final BasicEditField txtChannel = new BasicEditField("Channel : ", "", 256, BasicEditField.FILTER_DEFAULT); + final BasicEditField txtCount = new BasicEditField("Count : ", "",20, BasicEditField.FILTER_INTEGER); + screen = new MainScreen(); + screen.add(txtChannel); + screen.add(txtCount); + + ButtonField btn = new ButtonField(); + btn.setLabel("Get History"); + screen.add(btn); + + btn.setChangeListener(new FieldChangeListener() { + + public void fieldChanged(Field field, int context) { + _pubnub.history(txtChannel.toString(), Integer.parseInt(txtCount.toString()), new Callback() { + public void successCallback(String channel, Object message) { + notifyUser(message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(channel + " : " + message.toString()); + } + }); + close(); + }}); + } +} diff --git a/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Presence.java b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Presence.java new file mode 100644 index 000000000..4a215e0fc --- /dev/null +++ b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Presence.java @@ -0,0 +1,51 @@ +package com.pubnub.examples.blackberry; + +import net.rim.device.api.ui.Field; +import net.rim.device.api.ui.FieldChangeListener; +import net.rim.device.api.ui.component.BasicEditField; +import net.rim.device.api.ui.component.ButtonField; +import net.rim.device.api.ui.container.MainScreen; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class Presence extends PubnubCommand { + + public Presence(Pubnub pubnub) { + super(pubnub, "Presence"); + // TODO Auto-generated constructor stub + } + + protected void initScreen() { + final BasicEditField txtChannel = new BasicEditField("Channel : ", "", 256, BasicEditField.FILTER_DEFAULT); + screen = new MainScreen(); + screen.add(txtChannel); + + ButtonField btn = new ButtonField(); + btn.setLabel("Subscribe"); + screen.add(btn); + + btn.setChangeListener(new FieldChangeListener() { + + public void fieldChanged(Field field, int context) { + + try { + _pubnub.presence(txtChannel.toString(), new Callback() { + + public void successCallback(String channel, Object message) { + notifyUser("Channel " + channel + " : " + message.toString()); + } + public void errorCallback(String channel, Object message) { + notifyUser("Channel " + channel + " : " + message.toString()); + } + }); + close(); + + } catch (Exception e) { + + } + }}); + } + + +} diff --git a/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Publish.java b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Publish.java new file mode 100644 index 000000000..aedbe3335 --- /dev/null +++ b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Publish.java @@ -0,0 +1,46 @@ +package com.pubnub.examples.blackberry; + +import net.rim.device.api.ui.Field; +import net.rim.device.api.ui.FieldChangeListener; +import net.rim.device.api.ui.component.BasicEditField; +import net.rim.device.api.ui.component.ButtonField; +import net.rim.device.api.ui.container.MainScreen; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class Publish extends PubnubCommand { + + public Publish(Pubnub pubnub) { + super(pubnub, "Publish"); + } + + protected void initScreen() { + final BasicEditField txtChannel = new BasicEditField("Channel : ", "", 256, BasicEditField.FILTER_DEFAULT); + final BasicEditField txtMessage = new BasicEditField("Message : ", "",256, BasicEditField.FILTER_DEFAULT); + screen = new MainScreen(); + screen.add(txtChannel); + screen.add(txtMessage); + + ButtonField btn = new ButtonField(); + btn.setLabel("Publish"); + screen.add(btn); + + btn.setChangeListener(new FieldChangeListener() { + + public void fieldChanged(Field field, int context) { + + _pubnub.publish(txtChannel.toString(), txtMessage.toString(), new Callback() { + public void successCallback(String channel, Object message) { + notifyUser(message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(channel + " : " + message.toString()); + } + }); + close(); + }}); + } + +} diff --git a/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/PubnubCommand.java b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/PubnubCommand.java new file mode 100644 index 000000000..1dd7e7b6c --- /dev/null +++ b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/PubnubCommand.java @@ -0,0 +1,91 @@ +package com.pubnub.examples.blackberry; + +import net.rim.device.api.command.Command; +import net.rim.device.api.command.CommandHandler; +import net.rim.device.api.command.ReadOnlyCommandMetadata; +import net.rim.device.api.ui.MenuItem; +import net.rim.device.api.ui.UiApplication; +import net.rim.device.api.ui.component.Dialog; +import net.rim.device.api.ui.container.MainScreen; +import net.rim.device.api.util.StringProvider; + +import org.json.me.JSONArray; +import org.json.me.JSONObject; + +import com.pubnub.api.Pubnub; + +public abstract class PubnubCommand { + + protected Pubnub _pubnub; + + protected MainScreen screen; + + private UiApplication uiapp; + + private MenuItem menuItem; + + + + /** + * Presents a dialog to the user with a given message + * + * @param message + * The text to display + */ + private void alertDialog(final String message) { + uiapp.invokeLater(new Runnable() { + public void run() { + Dialog.alert(message); + } + }); + } + + public PubnubCommand(Pubnub pubnub, String command) { + this._pubnub = pubnub; + this.uiapp = UiApplication.getUiApplication(); + this.menuItem = new MenuItem(new StringProvider(command), 0x230010, 0); + this.menuItem.setCommand(new Command(new CommandHandler() + { + public void execute(ReadOnlyCommandMetadata metadata, Object context) + { + handler(); + } + })); + } + + protected void notifyUser(Object message) { + try { + if (message instanceof JSONObject) { + JSONObject obj = (JSONObject) message; + alertDialog(obj.toString()); + } else if (message instanceof String) { + String obj = (String) message; + alertDialog(obj.toString()); + } else if (message instanceof JSONArray) { + JSONArray obj = (JSONArray) message; + alertDialog(obj.toString()); + } + } catch (Exception e) { + + } + + } + + protected abstract void initScreen(); + + public void handler() { + + if (screen == null) + initScreen(); + uiapp.pushScreen(screen); + + } + + public MenuItem getMenuItem() { + return menuItem; + } + + protected void close() { + this.uiapp.popScreen(screen); + } +} diff --git a/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/PubnubDemoConsole.java b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/PubnubDemoConsole.java new file mode 100644 index 000000000..3e216af79 --- /dev/null +++ b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/PubnubDemoConsole.java @@ -0,0 +1,36 @@ +package com.pubnub.examples.blackberry; + +import net.rim.device.api.ui.Screen; +import net.rim.device.api.ui.UiApplication; + +/** + * This class extends the UiApplication class, providing a + * graphical user interface. + */ +public class PubnubDemoConsole extends UiApplication +{ + /** + * Entry point for application + * @param args Command line arguments (not used) + */ + public static void main(String[] args) + { + + // Create a new instance of the application and make the currently + // running thread the application's event dispatch thread. + PubnubDemoConsole theApp = new PubnubDemoConsole(); + theApp.enterEventDispatcher(); + } + + + /** + * Creates a new PubnubExample object + */ + public PubnubDemoConsole() + { + Screen sc = new PubnubDemoConsoleScreen(); + // Push a screen onto the UI stack for rendering. + pushScreen(sc); + } + +} diff --git a/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/PubnubDemoConsoleScreen.java b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/PubnubDemoConsoleScreen.java new file mode 100644 index 000000000..f793eca0c --- /dev/null +++ b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/PubnubDemoConsoleScreen.java @@ -0,0 +1,37 @@ +package com.pubnub.examples.blackberry; + +import net.rim.device.api.ui.container.MainScreen; + +import com.pubnub.api.Pubnub; + +/** + * A class extending the MainScreen class, which provides default standard + * behavior for BlackBerry GUI applications. + */ +public final class PubnubDemoConsoleScreen extends MainScreen +{ + String channel = "hello_world"; + String[] channels = { "hello_world1", "hello_world2", "hello_world3", + "hello_world4" }; + Pubnub _pubnub = new Pubnub("demo","demo","demo", false); + /** + * Creates a new PubnubExampleScreen object + */ + public PubnubDemoConsoleScreen() + { + // Set the displayed title of the screen + setTitle("Pubnub Demo Console"); + addMenuItem(new Publish(_pubnub).getMenuItem()); + addMenuItem(new Subscribe(_pubnub).getMenuItem()); + addMenuItem(new Presence(_pubnub).getMenuItem()); + addMenuItem(new Unsubscribe(_pubnub).getMenuItem()); + addMenuItem(new History(_pubnub).getMenuItem()); + addMenuItem(new DetailedHistory(_pubnub).getMenuItem()); + addMenuItem(new HereNow(_pubnub).getMenuItem()); + addMenuItem(new DisconnectAndResubscribe(_pubnub).getMenuItem()); + addMenuItem(new ToggleResumeOnReconnect(_pubnub).getMenuItem()); + addMenuItem(new Time(_pubnub).getMenuItem()); + } + + +} \ No newline at end of file diff --git a/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Subscribe.java b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Subscribe.java new file mode 100644 index 000000000..0878b0691 --- /dev/null +++ b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Subscribe.java @@ -0,0 +1,63 @@ +package com.pubnub.examples.blackberry; + +import java.util.Hashtable; + +import net.rim.device.api.ui.Field; +import net.rim.device.api.ui.FieldChangeListener; +import net.rim.device.api.ui.component.BasicEditField; +import net.rim.device.api.ui.component.ButtonField; +import net.rim.device.api.ui.container.MainScreen; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class Subscribe extends PubnubCommand { + + public Subscribe(Pubnub pubnub) { + super(pubnub, "Subscribe"); + } + + protected void initScreen() { + final BasicEditField txtChannel = new BasicEditField("Channel : ", "", 256, BasicEditField.FILTER_DEFAULT); + screen = new MainScreen(); + screen.add(txtChannel); + + ButtonField btn = new ButtonField(); + btn.setLabel("Subscribe"); + screen.add(btn); + + btn.setChangeListener(new FieldChangeListener() { + + public void fieldChanged(Field field, int context) { + Hashtable args = new Hashtable(); + args.put("channel", txtChannel.toString()); + + try { + _pubnub.subscribe(args, new Callback() { + public void connectCallback(String channel) { + notifyUser("CONNECT on channel:" + channel); + } + + public void disconnectCallback(String channel) { + notifyUser("DISCONNECT on channel:" + channel); + } + + public void reconnectCallback(String channel) { + notifyUser("RECONNECT on channel:" + channel); + } + + public void successCallback(String channel, Object message) { + notifyUser("Channel " + channel + " : " + message.toString()); + } + public void errorCallback(String channel, Object message) { + notifyUser("Channel " + channel + " : " + message.toString()); + } + }); + close(); + + } catch (Exception e) { + + } + }}); } + +} diff --git a/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Time.java b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Time.java new file mode 100644 index 000000000..c27e8a78b --- /dev/null +++ b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Time.java @@ -0,0 +1,25 @@ +package com.pubnub.examples.blackberry; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class Time extends PubnubCommand { + + public Time(Pubnub pubnub) { + super(pubnub, "Time"); + } + + protected void initScreen() { + } + public void handler() { + _pubnub.time( new Callback() { + public void successCallback(String channel, Object message) { + notifyUser(message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(message.toString()); + } + }); + } +} diff --git a/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/ToggleResumeOnReconnect.java b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/ToggleResumeOnReconnect.java new file mode 100644 index 000000000..3eda0b4dc --- /dev/null +++ b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/ToggleResumeOnReconnect.java @@ -0,0 +1,18 @@ +package com.pubnub.examples.blackberry; + +import com.pubnub.api.Pubnub; + +public class ToggleResumeOnReconnect extends PubnubCommand { + + public ToggleResumeOnReconnect(Pubnub pubnub) { + super(pubnub, "Toggle Resume on Reconnect"); + } + + protected void initScreen() { + + } + public void handler() { + _pubnub.setResumeOnReconnect((_pubnub.isResumeOnReconnect())?false:true); + } + +} diff --git a/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Unsubscribe.java b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Unsubscribe.java new file mode 100644 index 000000000..57b5c4e56 --- /dev/null +++ b/blackberry/examples/PubnubExample/src/com/pubnub/examples/blackberry/Unsubscribe.java @@ -0,0 +1,34 @@ +package com.pubnub.examples.blackberry; + +import net.rim.device.api.ui.Field; +import net.rim.device.api.ui.FieldChangeListener; +import net.rim.device.api.ui.component.BasicEditField; +import net.rim.device.api.ui.component.ButtonField; +import net.rim.device.api.ui.container.MainScreen; + +import com.pubnub.api.Pubnub; + +public class Unsubscribe extends PubnubCommand { + + public Unsubscribe(Pubnub pubnub) { + super(pubnub, "Unsubscribe"); + } + + protected void initScreen() { + final BasicEditField txtChannel = new BasicEditField("Channel : ", "", 256, BasicEditField.FILTER_DEFAULT); + screen = new MainScreen(); + screen.add(txtChannel); + + ButtonField btn = new ButtonField(); + btn.setLabel("Unsubscribe"); + screen.add(btn); + + btn.setChangeListener(new FieldChangeListener() { + + public void fieldChanged(Field field, int context) { + _pubnub.unsubscribe(txtChannel.toString()); + close(); + }}); + } + +} diff --git a/blackberry/libs/Pubnub-Microedition-3.4.jar b/blackberry/libs/Pubnub-Microedition-3.4.jar new file mode 100644 index 000000000..0b99b5f6c Binary files /dev/null and b/blackberry/libs/Pubnub-Microedition-3.4.jar differ diff --git a/blackberry/libs/bouncycastle.jar b/blackberry/libs/bouncycastle.jar new file mode 100644 index 000000000..516587c2d Binary files /dev/null and b/blackberry/libs/bouncycastle.jar differ diff --git a/blackberry/libs/net_rim_api.jar b/blackberry/libs/net_rim_api.jar new file mode 100644 index 000000000..0303009db Binary files /dev/null and b/blackberry/libs/net_rim_api.jar differ diff --git a/blackberry/src/com/pubnub/api/Pubnub.java b/blackberry/src/com/pubnub/api/Pubnub.java new file mode 100644 index 000000000..7162d8431 --- /dev/null +++ b/blackberry/src/com/pubnub/api/Pubnub.java @@ -0,0 +1,86 @@ +package com.pubnub.api; + +import org.bouncycastle.util.SecureRandom; + + +public class Pubnub extends PubnubCore { + + public Pubnub(String publish_key, String subscribe_key, String secret_key, + String cipher_key, boolean ssl_on) { + super(publish_key, subscribe_key, secret_key, cipher_key, ssl_on); + } + + public Pubnub(String publish_key, String subscribe_key, String secret_key, + boolean ssl_on) { + super(publish_key, subscribe_key, secret_key, "", ssl_on); + } + + + public Pubnub(String publish_key, String subscribe_key) { + super(publish_key, subscribe_key, "", "", false); + } + + public Pubnub(String publish_key, String subscribe_key, boolean ssl) { + super(publish_key, subscribe_key, "", "", ssl); + } + + public Pubnub(String publish_key, String subscribe_key, String secret_key) { + super(publish_key, subscribe_key, secret_key, "", false); + } + + /** + * UUID + * + * 32 digit UUID generation at client side. + * + * @return String uuid. + */ + public String uuid() { + + String valueBeforeMD5; + String valueAfterMD5; + SecureRandom mySecureRand = new SecureRandom(); + String s_id = String.valueOf(PubnubCore.class.hashCode()); + StringBuffer sbValueBeforeMD5 = new StringBuffer(); + try { + long time = System.currentTimeMillis(); + long rand = 0; + rand = mySecureRand.nextLong(); + sbValueBeforeMD5.append(s_id); + sbValueBeforeMD5.append(":"); + sbValueBeforeMD5.append(Long.toString(time)); + sbValueBeforeMD5.append(":"); + sbValueBeforeMD5.append(Long.toString(rand)); + valueBeforeMD5 = sbValueBeforeMD5.toString(); + byte[] array = PubnubCrypto.md5(valueBeforeMD5); + StringBuffer sb = new StringBuffer(); + for (int j = 0; j < array.length; ++j) { + int b = array[j] & 0xFF; + if (b < 0x10) { + sb.append('0'); + } + sb.append(Integer.toHexString(b)); + } + valueAfterMD5 = sb.toString(); + String raw = valueAfterMD5.toUpperCase(); + sb = new StringBuffer(); + sb.append(raw.substring(0, 8)); + sb.append("-"); + sb.append(raw.substring(8, 12)); + sb.append("-"); + sb.append(raw.substring(12, 16)); + sb.append("-"); + sb.append(raw.substring(16, 20)); + sb.append("-"); + sb.append(raw.substring(20)); + return sb.toString(); + } catch (Exception e) { + return null; + } + } + + protected String getUserAgent() { + return "Blackberry/3.4"; + } + +} diff --git a/blackberry/tools/preverify b/blackberry/tools/preverify new file mode 100755 index 000000000..6e4b51250 Binary files /dev/null and b/blackberry/tools/preverify differ diff --git a/blackberry/tools/preverify.exe b/blackberry/tools/preverify.exe new file mode 100644 index 000000000..8cdea8902 Binary files /dev/null and b/blackberry/tools/preverify.exe differ diff --git a/blackberry/tools/preverify1.0 b/blackberry/tools/preverify1.0 new file mode 100755 index 000000000..fa9116e9c Binary files /dev/null and b/blackberry/tools/preverify1.0 differ diff --git a/blackberry/tools/preverify1.1 b/blackberry/tools/preverify1.1 new file mode 100755 index 000000000..3cc34a45e Binary files /dev/null and b/blackberry/tools/preverify1.1 differ diff --git a/build.xml b/build.xml new file mode 100644 index 000000000..3169393fa --- /dev/null +++ b/build.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/gwt/3.3/api/PubnubGwt.jar b/gwt/3.3/api/PubnubGwt.jar new file mode 100644 index 000000000..4b394808e Binary files /dev/null and b/gwt/3.3/api/PubnubGwt.jar differ diff --git a/gwt/3.3/api/build.xml b/gwt/3.3/api/build.xml new file mode 100644 index 000000000..bfa8ff98b --- /dev/null +++ b/gwt/3.3/api/build.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gwt/3.3/api/src/com/pubnub/gwt/api/Pubnub.gwt.xml b/gwt/3.3/api/src/com/pubnub/gwt/api/Pubnub.gwt.xml new file mode 100644 index 000000000..6b47b7e5a --- /dev/null +++ b/gwt/3.3/api/src/com/pubnub/gwt/api/Pubnub.gwt.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/gwt/3.3/api/src/com/pubnub/gwt/api/client/Callback.java b/gwt/3.3/api/src/com/pubnub/gwt/api/client/Callback.java new file mode 100644 index 000000000..285693df0 --- /dev/null +++ b/gwt/3.3/api/src/com/pubnub/gwt/api/client/Callback.java @@ -0,0 +1,20 @@ +/** + * + */ +package com.pubnub.gwt.api.client; + +/** + * @author Pubnub + * + */ +public abstract class Callback { + public void callback(String channel, Object message){} + + public void error(String channel, Object message){} + + public void connect(String channel){} + + public void reconnect(String channel){} + + public void disconnect(String channel){} +} diff --git a/gwt/3.3/api/src/com/pubnub/gwt/api/client/Pubnub.java b/gwt/3.3/api/src/com/pubnub/gwt/api/client/Pubnub.java new file mode 100644 index 000000000..09659e2a1 --- /dev/null +++ b/gwt/3.3/api/src/com/pubnub/gwt/api/client/Pubnub.java @@ -0,0 +1,212 @@ +/** + * + */ +package com.pubnub.gwt.api.client; + +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.json.client.JSONArray; +import com.google.gwt.json.client.JSONObject; +import com.pubnub.gwt.api.client.Callback; + +/** + * @author Pubnub + * + */ +public class Pubnub extends JavaScriptObject { + protected Pubnub() { + } + private native void alert(String message) /*-{ + alert(message); + }-*/; + private static native Pubnub _init(String origin, String pubkey, String subkey, boolean ssl) /*-{ + if (ssl) + ssl_setting = "on"; + else + ssl_setting = "off"; + + p = $wnd.PUBNUB.init({ + 'publish_key' : pubkey, + 'subscribe_key' : subkey, + 'ssl' : ssl_setting, + 'origin' : origin, + }); + return p; + + }-*/; + + private static native void _time(Callback cb) /*-{ + $wnd.PUBNUB.time( + function(message){ + cb.@com.pubnub.gwt.api.client.Callback::callback(Ljava/lang/String;Ljava/lang/Object;)("", message.toString()); + } + ); + }-*/; + + private final native void _uuid(Callback cb) /*-{ + this.uuid( + function(message){ + cb.@com.pubnub.gwt.api.client.Callback::callback(Ljava/lang/String;Ljava/lang/Object;)("", message); + } + ); + }-*/; + private final native String _uuid() /*-{ + return this.uuid(); + }-*/; + + private final native void _publish(String channel, String obj, Callback cb) /*-{ + + + this.publish({ + "channel" : channel, + "message" : eval("(" + obj + ")"), + "callback" : function(message){ + cb.@com.pubnub.gwt.api.client.Callback::callback(Ljava/lang/String;Ljava/lang/Object;)(channel, message); + } + }); + }-*/; + + private final native void _publishStr(String channel, String obj, Callback cb) /*-{ + this.publish({ + "channel" : channel, + "message" : obj, + "callback" : function(message){ + cb.@com.pubnub.gwt.api.client.Callback::callback(Ljava/lang/String;Ljava/lang/Object;)(channel, message); + } + }); + +}-*/; + + private final native void _subscribe(String channel, Callback cb)/*-{ + this.subscribe({ + "channel" : channel, + "callback" : function(message){ + cb.@com.pubnub.gwt.api.client.Callback::callback(Ljava/lang/String;Ljava/lang/Object;)(channel, message); + }, + "error" : function(message){ + cb.@com.pubnub.gwt.api.client.Callback::error(Ljava/lang/String;Ljava/lang/Object;)(channel, message); + }, + "connect" : function(){ + cb.@com.pubnub.gwt.api.client.Callback::connect(Ljava/lang/String;)(channel); + }, + "reconnect" : function(){ + cb.@com.pubnub.gwt.api.client.Callback::reconnect(Ljava/lang/String;)(channel); + }, + "disconnect" : function(){ + cb.@com.pubnub.gwt.api.client.Callback::disconnect(Ljava/lang/String;)(channel); + }, + }); + }-*/; + + private native final void _history(String channel, int limit, Callback cb) /*-{ + return this.history({ + "channel" : channel, + "limit" : limit, + "callback" : function(message) { + cb.@com.pubnub.gwt.api.client.Callback::callback(Ljava/lang/String;Ljava/lang/Object;)(channel, message); + } + }); + }-*/; + + private native final void _unsubscribe(String channel) /*-{ + this.unsubscribe({ + "channel" : channel + }); + }-*/; + + private native final void _here_now(String channel, Callback cb) /*-{ + this.here_now({ + "channel" : channel, + "callback" : function(message){ + cb.@com.pubnub.gwt.api.client.Callback::callback(Ljava/lang/String;Ljava/lang/Object;)(channel, message); + } + }); + }-*/; + + private native final void _detailedHistory(String channel, String start, String end, int count, boolean reverse, Callback cb) /*-{ + param = {"channel" : channel}; + if ( start != "-1") + param["start"] = start; + if ( end != "-1") + param["end"] = end; + + if (count > -1) + param["count"] = count; + + param["reverse"] = reverse; + + param["callback"] = function(message) { + cb.@com.pubnub.gwt.api.client.Callback::callback(Ljava/lang/String;Ljava/lang/Object;)(channel, message); + }; + + this.detailedHistory(param); + }-*/; + + //=================== Public Methods + + public static Pubnub init() { + return _init("pubsub.pubnub.com", "demo", "demo", true); + } + + public static Pubnub init(String pubkey, String subkey, boolean ssl) { + return _init("pubsub.pubnub.com", pubkey, subkey, ssl); + } + public static Pubnub init(String origin, String pubkey, String subkey, boolean ssl) { + return _init(origin, pubkey, subkey, ssl); + } + public final void time(Callback cb) { + _time(cb); + } + + public final void uuid(Callback cb) { + _uuid(cb); + } + public final String uuid() { + return _uuid(); + } + + public final void publish(String channel, JSONObject obj, Callback cb) { + _publish(channel, obj.toString(), cb); + } + + public final void publish(String channel, String obj, Callback cb) { + _publishStr(channel, obj, cb); + } + + public final void publish(String channel, JSONArray obj, Callback cb) { + _publish(channel, obj.toString(), cb); + } + + public final void subscribe(String channel, Callback cb) { + _subscribe(channel, cb); + } + + public final void unsubscribe(String channel) { + _unsubscribe(channel); + } + + public final void presence(String channel, Callback cb) { + _subscribe(channel + "-pnpres", cb); + } + + public final void here_now(String channel, Callback cb) { + _here_now(channel, cb); + } + + public final void history(String channel, int limit, Callback cb) { + _history(channel, limit, cb); + } + + public final void detailedHistory(String channel, long start, long end, int count, boolean reverse, Callback cb) { + _detailedHistory(channel, String.valueOf(start), String.valueOf(end), count, reverse, cb); + } + + public final void detailedHistory(String channel, long start, boolean reverse, Callback cb) { + _detailedHistory(channel, String.valueOf(start), "-1", -1, reverse, cb); + + } + + public final void detailedHistory(String channel, int count, Callback cb) { + _detailedHistory(channel, "-1", "-1", count, false, cb); + + } +} diff --git a/gwt/3.3/examples/PubnubExample/.gwt/.gwt-log b/gwt/3.3/examples/PubnubExample/.gwt/.gwt-log new file mode 100644 index 000000000..0e3159d0f --- /dev/null +++ b/gwt/3.3/examples/PubnubExample/.gwt/.gwt-log @@ -0,0 +1,2570 @@ +Module location: file:/home/workpn/workspace/PublishExample/src/com/pubnub/gwt/examples/PublishExample.gwt.xml +Loading inherited module 'com.google.gwt.user.User' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/User.gwt.xml + Loading inherited module 'com.google.gwt.canvas.Canvas' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/Canvas.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.canvas.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/Core.gwt.xml + Loading inherited module 'com.google.gwt.dev.jjs.intrinsic.Intrinsic' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/dev/jjs/intrinsic/Intrinsic.gwt.xml + Loading inherited module 'com.google.gwt.lang.LongLib' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/lang/LongLib.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/Emulation.gwt.xml + Loading inherited module 'com.google.gwt.logging.LogImpl' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/logging/LogImpl.gwt.xml + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/xhr/XMLHttpRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CompilerParameters' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CompilerParameters.gwt.xml + Loading inherited module 'com.google.gwt.core.EmulateJsStack' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/EmulateJsStack.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.AsyncFragmentLoader' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/AsyncFragmentLoader.gwt.xml + Loading inherited module 'com.google.gwt.core.XSLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/XSLinker.gwt.xml + Loading inherited module 'com.google.gwt.core.CrossSiteIframeLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CrossSiteIframeLinker.gwt.xml + Loading inherited module 'com.google.gwt.user.UserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/UserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.EmulationWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/EmulationWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module 'com.google.gwt.emul.Emulation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CoreWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CoreWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/text/Text.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/EventBase.gwt.xml + Loading inherited module 'com.google.web.bindery.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/web/bindery/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.DomEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/DomEvent.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.TouchEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/TouchEvent.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.logical.LogicalEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/logical/LogicalEvent.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/animation/Animation.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/editor/Editor.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'javax.validation.Validation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/javax/validation/Validation.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/resources/Resources.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.http.HTTP' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/http/HTTP.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.jsonp.Jsonp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/jsonp/Jsonp.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.layout.Layout' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/layout/Layout.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module 'com.google.gwt.animation.Animation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.Media' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/Media.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.touch.Touch' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/touch/Touch.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.uibinder.UiBinder' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/uibinder/UiBinder.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module 'com.google.gwt.resources.Resources' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.AsyncProxy' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/AsyncProxy.gwt.xml + Loading inherited module 'com.google.gwt.user.RemoteService' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RemoteService.gwt.xml + Loading inherited module 'com.google.gwt.http.HTTP' + Module 'com.google.gwt.http.HTTP' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DocumentRoot' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DocumentRoot.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Window.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.HTTPRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/HTTPRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.History' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/History.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.i18n.I18N' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/i18n/I18N.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/regexp/RegExp.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safehtml/SafeHtml.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module 'com.google.gwt.regexp.RegExp' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Popup' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Popup.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Form' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Form.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.TextBox' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/TextBox.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Focus' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Focus.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ImageBundle' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ImageBundle.gwt.xml + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ClippedImage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module 'com.google.gwt.user.ClippedImage' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.RichText' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RichText.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.SplitPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/SplitPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.CaptionPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/CaptionPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module 'com.google.gwt.user.Window' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Tree' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Tree.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Hyperlink' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Hyperlink.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.FileUpload' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/FileUpload.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ResizeLayoutPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ResizeLayoutPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ScrollPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ScrollPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.datepicker.DatePicker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/datepicker/DatePicker.gwt.xml + Loading inherited module 'com.google.gwt.user.cellview.CellView' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/cellview/CellView.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.cell.Cell' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/cell/Cell.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module 'com.google.gwt.text.Text' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module 'com.google.gwt.editor.Editor' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.view.View' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/view/View.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safecss.SafeCss' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safecss/SafeCss.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.storage.Storage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/storage/Storage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped +Loading inherited module 'com.google.gwt.user.theme.clean.Clean' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/theme/clean/Clean.gwt.xml +Loading inherited module 'com.pubnub.gwt.api.Pubnub' + Module location: jar:file:/home/workpn/Desktop/PubnubGwt.jar!/com/pubnub/gwt/api/Pubnub.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.json.JSON' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/json/JSON.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped +Public resources found in... +Translatable source found in... +Removing invalidated units +Finding entry point classes +Rebinding com.google.gwt.i18n.client.impl.LocaleInfoImpl + Invoking generator com.google.gwt.i18n.rebind.LocaleInfoGenerator + Processing interface com.google.gwt.i18n.client.constants.NumberConstantsImpl + Generating method body for percentPattern() + Generating method body for zeroDigit() + Generating method body for scientificPattern() + Generating method body for decimalSeparator() + Generating method body for notANumber() + Generating method body for minusSign() + Generating method body for infinity() + Generating method body for exponentialSymbol() + Generating method body for plusSign() + Generating method body for currencyPattern() + Generating method body for monetaryGroupingSeparator() + Generating method body for groupingSeparator() + Generating method body for perMill() + Generating method body for monetarySeparator() + Generating method body for decimalPattern() + Generating method body for percent() + Generating method body for defCurrencyCode() + Adding '3' new generated units + Removing invalidated units +Rebinding com.google.gwt.resources.client.CommonResources.Bundle + Adding '1' new generated units + Removing invalidated units +Module location: file:/home/workpn/workspace/PublishExample/src/com/pubnub/gwt/examples/PublishExample.gwt.xml +Loading inherited module 'com.google.gwt.user.User' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/User.gwt.xml + Loading inherited module 'com.google.gwt.canvas.Canvas' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/Canvas.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.canvas.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/Core.gwt.xml + Loading inherited module 'com.google.gwt.dev.jjs.intrinsic.Intrinsic' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/dev/jjs/intrinsic/Intrinsic.gwt.xml + Loading inherited module 'com.google.gwt.lang.LongLib' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/lang/LongLib.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/Emulation.gwt.xml + Loading inherited module 'com.google.gwt.logging.LogImpl' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/logging/LogImpl.gwt.xml + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/xhr/XMLHttpRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CompilerParameters' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CompilerParameters.gwt.xml + Loading inherited module 'com.google.gwt.core.EmulateJsStack' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/EmulateJsStack.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.AsyncFragmentLoader' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/AsyncFragmentLoader.gwt.xml + Loading inherited module 'com.google.gwt.core.XSLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/XSLinker.gwt.xml + Loading inherited module 'com.google.gwt.core.CrossSiteIframeLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CrossSiteIframeLinker.gwt.xml + Loading inherited module 'com.google.gwt.user.UserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/UserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.EmulationWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/EmulationWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module 'com.google.gwt.emul.Emulation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CoreWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CoreWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/text/Text.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/EventBase.gwt.xml + Loading inherited module 'com.google.web.bindery.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/web/bindery/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.DomEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/DomEvent.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.TouchEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/TouchEvent.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.logical.LogicalEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/logical/LogicalEvent.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/animation/Animation.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/editor/Editor.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'javax.validation.Validation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/javax/validation/Validation.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/resources/Resources.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.http.HTTP' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/http/HTTP.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.jsonp.Jsonp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/jsonp/Jsonp.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.layout.Layout' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/layout/Layout.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module 'com.google.gwt.animation.Animation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.Media' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/Media.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.touch.Touch' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/touch/Touch.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.uibinder.UiBinder' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/uibinder/UiBinder.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module 'com.google.gwt.resources.Resources' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.AsyncProxy' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/AsyncProxy.gwt.xml + Loading inherited module 'com.google.gwt.user.RemoteService' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RemoteService.gwt.xml + Loading inherited module 'com.google.gwt.http.HTTP' + Module 'com.google.gwt.http.HTTP' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DocumentRoot' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DocumentRoot.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Window.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.HTTPRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/HTTPRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.History' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/History.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.i18n.I18N' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/i18n/I18N.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/regexp/RegExp.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safehtml/SafeHtml.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module 'com.google.gwt.regexp.RegExp' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Popup' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Popup.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Form' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Form.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.TextBox' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/TextBox.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Focus' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Focus.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ImageBundle' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ImageBundle.gwt.xml + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ClippedImage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module 'com.google.gwt.user.ClippedImage' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.RichText' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RichText.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.SplitPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/SplitPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.CaptionPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/CaptionPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module 'com.google.gwt.user.Window' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Tree' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Tree.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Hyperlink' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Hyperlink.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.FileUpload' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/FileUpload.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ResizeLayoutPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ResizeLayoutPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ScrollPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ScrollPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.datepicker.DatePicker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/datepicker/DatePicker.gwt.xml + Loading inherited module 'com.google.gwt.user.cellview.CellView' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/cellview/CellView.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.cell.Cell' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/cell/Cell.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module 'com.google.gwt.text.Text' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module 'com.google.gwt.editor.Editor' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.view.View' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/view/View.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safecss.SafeCss' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safecss/SafeCss.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.storage.Storage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/storage/Storage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped +Loading inherited module 'com.google.gwt.user.theme.clean.Clean' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/theme/clean/Clean.gwt.xml +Loading inherited module 'com.pubnub.gwt.api.Pubnub' + Module location: jar:file:/home/workpn/Desktop/PubnubGwt.jar!/com/pubnub/gwt/api/Pubnub.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.json.JSON' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/json/JSON.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped +Public resources found in... +Translatable source found in... +Removing invalidated units +Finding entry point classes +Rebinding com.google.gwt.i18n.client.impl.LocaleInfoImpl + Invoking generator com.google.gwt.i18n.rebind.LocaleInfoGenerator + Processing interface com.google.gwt.i18n.client.constants.NumberConstantsImpl + Generating method body for percentPattern() + Generating method body for zeroDigit() + Generating method body for scientificPattern() + Generating method body for decimalSeparator() + Generating method body for notANumber() + Generating method body for minusSign() + Generating method body for infinity() + Generating method body for exponentialSymbol() + Generating method body for plusSign() + Generating method body for currencyPattern() + Generating method body for monetaryGroupingSeparator() + Generating method body for groupingSeparator() + Generating method body for perMill() + Generating method body for monetarySeparator() + Generating method body for decimalPattern() + Generating method body for percent() + Generating method body for defCurrencyCode() + Adding '3' new generated units + Removing invalidated units +Rebinding com.google.gwt.resources.client.CommonResources.Bundle + Adding '1' new generated units + Removing invalidated units +Module location: file:/home/workpn/workspace/PubnubExample/src/com/pubnub/gwt/examples/PublishExample.gwt.xml +Loading inherited module 'com.google.gwt.user.User' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/User.gwt.xml + Loading inherited module 'com.google.gwt.canvas.Canvas' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/Canvas.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.canvas.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/Core.gwt.xml + Loading inherited module 'com.google.gwt.dev.jjs.intrinsic.Intrinsic' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/dev/jjs/intrinsic/Intrinsic.gwt.xml + Loading inherited module 'com.google.gwt.lang.LongLib' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/lang/LongLib.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/Emulation.gwt.xml + Loading inherited module 'com.google.gwt.logging.LogImpl' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/logging/LogImpl.gwt.xml + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/xhr/XMLHttpRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CompilerParameters' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CompilerParameters.gwt.xml + Loading inherited module 'com.google.gwt.core.EmulateJsStack' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/EmulateJsStack.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.AsyncFragmentLoader' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/AsyncFragmentLoader.gwt.xml + Loading inherited module 'com.google.gwt.core.XSLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/XSLinker.gwt.xml + Loading inherited module 'com.google.gwt.core.CrossSiteIframeLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CrossSiteIframeLinker.gwt.xml + Loading inherited module 'com.google.gwt.user.UserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/UserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.EmulationWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/EmulationWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module 'com.google.gwt.emul.Emulation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CoreWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CoreWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/text/Text.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/EventBase.gwt.xml + Loading inherited module 'com.google.web.bindery.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/web/bindery/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.DomEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/DomEvent.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.TouchEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/TouchEvent.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.logical.LogicalEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/logical/LogicalEvent.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/animation/Animation.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/editor/Editor.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'javax.validation.Validation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/javax/validation/Validation.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/resources/Resources.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.http.HTTP' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/http/HTTP.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.jsonp.Jsonp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/jsonp/Jsonp.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.layout.Layout' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/layout/Layout.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module 'com.google.gwt.animation.Animation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.Media' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/Media.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.touch.Touch' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/touch/Touch.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.uibinder.UiBinder' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/uibinder/UiBinder.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module 'com.google.gwt.resources.Resources' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.AsyncProxy' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/AsyncProxy.gwt.xml + Loading inherited module 'com.google.gwt.user.RemoteService' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RemoteService.gwt.xml + Loading inherited module 'com.google.gwt.http.HTTP' + Module 'com.google.gwt.http.HTTP' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DocumentRoot' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DocumentRoot.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Window.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.HTTPRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/HTTPRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.History' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/History.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.i18n.I18N' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/i18n/I18N.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/regexp/RegExp.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safehtml/SafeHtml.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module 'com.google.gwt.regexp.RegExp' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Popup' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Popup.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Form' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Form.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.TextBox' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/TextBox.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Focus' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Focus.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ImageBundle' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ImageBundle.gwt.xml + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ClippedImage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module 'com.google.gwt.user.ClippedImage' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.RichText' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RichText.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.SplitPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/SplitPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.CaptionPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/CaptionPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module 'com.google.gwt.user.Window' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Tree' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Tree.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Hyperlink' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Hyperlink.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.FileUpload' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/FileUpload.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ResizeLayoutPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ResizeLayoutPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ScrollPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ScrollPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.datepicker.DatePicker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/datepicker/DatePicker.gwt.xml + Loading inherited module 'com.google.gwt.user.cellview.CellView' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/cellview/CellView.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.cell.Cell' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/cell/Cell.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module 'com.google.gwt.text.Text' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module 'com.google.gwt.editor.Editor' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.view.View' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/view/View.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safecss.SafeCss' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safecss/SafeCss.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.storage.Storage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/storage/Storage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped +Loading inherited module 'com.google.gwt.user.theme.clean.Clean' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/theme/clean/Clean.gwt.xml +Loading inherited module 'com.pubnub.gwt.api.Pubnub' + Module location: jar:file:/home/workpn/Desktop/PubnubGwt.jar!/com/pubnub/gwt/api/Pubnub.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.json.JSON' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/json/JSON.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped +Public resources found in... +Translatable source found in... +Removing invalidated units +Finding entry point classes +Rebinding com.google.gwt.i18n.client.impl.LocaleInfoImpl + Invoking generator com.google.gwt.i18n.rebind.LocaleInfoGenerator + Processing interface com.google.gwt.i18n.client.constants.NumberConstantsImpl + Generating method body for percentPattern() + Generating method body for zeroDigit() + Generating method body for scientificPattern() + Generating method body for decimalSeparator() + Generating method body for notANumber() + Generating method body for minusSign() + Generating method body for infinity() + Generating method body for exponentialSymbol() + Generating method body for plusSign() + Generating method body for currencyPattern() + Generating method body for monetaryGroupingSeparator() + Generating method body for groupingSeparator() + Generating method body for perMill() + Generating method body for monetarySeparator() + Generating method body for decimalPattern() + Generating method body for percent() + Generating method body for defCurrencyCode() + Adding '3' new generated units + Removing invalidated units +Module location: file:/home/workpn/workspace/PubnubExample/src/com/pubnub/gwt/examples/PublishExample.gwt.xml +Loading inherited module 'com.google.gwt.user.User' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/User.gwt.xml + Loading inherited module 'com.google.gwt.canvas.Canvas' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/Canvas.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.canvas.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/Core.gwt.xml + Loading inherited module 'com.google.gwt.dev.jjs.intrinsic.Intrinsic' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/dev/jjs/intrinsic/Intrinsic.gwt.xml + Loading inherited module 'com.google.gwt.lang.LongLib' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/lang/LongLib.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/Emulation.gwt.xml + Loading inherited module 'com.google.gwt.logging.LogImpl' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/logging/LogImpl.gwt.xml + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/xhr/XMLHttpRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CompilerParameters' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CompilerParameters.gwt.xml + Loading inherited module 'com.google.gwt.core.EmulateJsStack' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/EmulateJsStack.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.AsyncFragmentLoader' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/AsyncFragmentLoader.gwt.xml + Loading inherited module 'com.google.gwt.core.XSLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/XSLinker.gwt.xml + Loading inherited module 'com.google.gwt.core.CrossSiteIframeLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CrossSiteIframeLinker.gwt.xml + Loading inherited module 'com.google.gwt.user.UserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/UserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.EmulationWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/EmulationWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module 'com.google.gwt.emul.Emulation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CoreWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CoreWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/text/Text.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/EventBase.gwt.xml + Loading inherited module 'com.google.web.bindery.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/web/bindery/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.DomEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/DomEvent.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.TouchEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/TouchEvent.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.logical.LogicalEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/logical/LogicalEvent.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/animation/Animation.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/editor/Editor.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'javax.validation.Validation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/javax/validation/Validation.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/resources/Resources.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.http.HTTP' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/http/HTTP.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.jsonp.Jsonp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/jsonp/Jsonp.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.layout.Layout' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/layout/Layout.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module 'com.google.gwt.animation.Animation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.Media' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/Media.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.touch.Touch' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/touch/Touch.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.uibinder.UiBinder' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/uibinder/UiBinder.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module 'com.google.gwt.resources.Resources' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.AsyncProxy' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/AsyncProxy.gwt.xml + Loading inherited module 'com.google.gwt.user.RemoteService' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RemoteService.gwt.xml + Loading inherited module 'com.google.gwt.http.HTTP' + Module 'com.google.gwt.http.HTTP' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DocumentRoot' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DocumentRoot.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Window.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.HTTPRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/HTTPRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.History' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/History.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.i18n.I18N' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/i18n/I18N.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/regexp/RegExp.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safehtml/SafeHtml.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module 'com.google.gwt.regexp.RegExp' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Popup' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Popup.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Form' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Form.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.TextBox' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/TextBox.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Focus' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Focus.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ImageBundle' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ImageBundle.gwt.xml + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ClippedImage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module 'com.google.gwt.user.ClippedImage' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.RichText' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RichText.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.SplitPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/SplitPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.CaptionPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/CaptionPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module 'com.google.gwt.user.Window' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Tree' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Tree.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Hyperlink' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Hyperlink.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.FileUpload' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/FileUpload.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ResizeLayoutPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ResizeLayoutPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ScrollPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ScrollPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.datepicker.DatePicker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/datepicker/DatePicker.gwt.xml + Loading inherited module 'com.google.gwt.user.cellview.CellView' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/cellview/CellView.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.cell.Cell' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/cell/Cell.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module 'com.google.gwt.text.Text' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module 'com.google.gwt.editor.Editor' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.view.View' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/view/View.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safecss.SafeCss' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safecss/SafeCss.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.storage.Storage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/storage/Storage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped +Loading inherited module 'com.google.gwt.user.theme.clean.Clean' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/theme/clean/Clean.gwt.xml +Loading inherited module 'com.pubnub.gwt.api.Pubnub' + Module location: jar:file:/home/workpn/Desktop/PubnubGwt.jar!/com/pubnub/gwt/api/Pubnub.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.json.JSON' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/json/JSON.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped +Public resources found in... +Translatable source found in... +Removing invalidated units +Finding entry point classes +Rebinding com.google.gwt.i18n.client.impl.LocaleInfoImpl + Invoking generator com.google.gwt.i18n.rebind.LocaleInfoGenerator + Processing interface com.google.gwt.i18n.client.constants.NumberConstantsImpl + Generating method body for percentPattern() + Generating method body for zeroDigit() + Generating method body for scientificPattern() + Generating method body for decimalSeparator() + Generating method body for notANumber() + Generating method body for minusSign() + Generating method body for infinity() + Generating method body for exponentialSymbol() + Generating method body for plusSign() + Generating method body for currencyPattern() + Generating method body for monetaryGroupingSeparator() + Generating method body for groupingSeparator() + Generating method body for perMill() + Generating method body for monetarySeparator() + Generating method body for decimalPattern() + Generating method body for percent() + Generating method body for defCurrencyCode() + Adding '3' new generated units + Removing invalidated units +Module location: file:/home/workpn/workspace/PubnubExample/src/com/pubnub/gwt/examples/PublishExample.gwt.xml +Loading inherited module 'com.google.gwt.user.User' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/User.gwt.xml + Loading inherited module 'com.google.gwt.canvas.Canvas' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/Canvas.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.canvas.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/Core.gwt.xml + Loading inherited module 'com.google.gwt.dev.jjs.intrinsic.Intrinsic' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/dev/jjs/intrinsic/Intrinsic.gwt.xml + Loading inherited module 'com.google.gwt.lang.LongLib' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/lang/LongLib.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/Emulation.gwt.xml + Loading inherited module 'com.google.gwt.logging.LogImpl' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/logging/LogImpl.gwt.xml + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/xhr/XMLHttpRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CompilerParameters' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CompilerParameters.gwt.xml + Loading inherited module 'com.google.gwt.core.EmulateJsStack' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/EmulateJsStack.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.AsyncFragmentLoader' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/AsyncFragmentLoader.gwt.xml + Loading inherited module 'com.google.gwt.core.XSLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/XSLinker.gwt.xml + Loading inherited module 'com.google.gwt.core.CrossSiteIframeLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CrossSiteIframeLinker.gwt.xml + Loading inherited module 'com.google.gwt.user.UserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/UserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.EmulationWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/EmulationWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module 'com.google.gwt.emul.Emulation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CoreWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CoreWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/text/Text.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/EventBase.gwt.xml + Loading inherited module 'com.google.web.bindery.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/web/bindery/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.DomEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/DomEvent.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.TouchEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/TouchEvent.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.logical.LogicalEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/logical/LogicalEvent.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/animation/Animation.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/editor/Editor.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'javax.validation.Validation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/javax/validation/Validation.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/resources/Resources.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.http.HTTP' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/http/HTTP.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.jsonp.Jsonp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/jsonp/Jsonp.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.layout.Layout' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/layout/Layout.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module 'com.google.gwt.animation.Animation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.Media' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/Media.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.touch.Touch' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/touch/Touch.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.uibinder.UiBinder' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/uibinder/UiBinder.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module 'com.google.gwt.resources.Resources' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.AsyncProxy' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/AsyncProxy.gwt.xml + Loading inherited module 'com.google.gwt.user.RemoteService' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RemoteService.gwt.xml + Loading inherited module 'com.google.gwt.http.HTTP' + Module 'com.google.gwt.http.HTTP' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DocumentRoot' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DocumentRoot.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Window.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.HTTPRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/HTTPRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.History' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/History.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.i18n.I18N' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/i18n/I18N.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/regexp/RegExp.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safehtml/SafeHtml.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module 'com.google.gwt.regexp.RegExp' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Popup' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Popup.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Form' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Form.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.TextBox' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/TextBox.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Focus' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Focus.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ImageBundle' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ImageBundle.gwt.xml + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ClippedImage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module 'com.google.gwt.user.ClippedImage' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.RichText' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RichText.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.SplitPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/SplitPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.CaptionPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/CaptionPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module 'com.google.gwt.user.Window' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Tree' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Tree.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Hyperlink' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Hyperlink.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.FileUpload' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/FileUpload.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ResizeLayoutPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ResizeLayoutPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ScrollPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ScrollPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.datepicker.DatePicker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/datepicker/DatePicker.gwt.xml + Loading inherited module 'com.google.gwt.user.cellview.CellView' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/cellview/CellView.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.cell.Cell' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/cell/Cell.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module 'com.google.gwt.text.Text' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module 'com.google.gwt.editor.Editor' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.view.View' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/view/View.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safecss.SafeCss' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safecss/SafeCss.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.storage.Storage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/storage/Storage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped +Loading inherited module 'com.google.gwt.user.theme.clean.Clean' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/theme/clean/Clean.gwt.xml +Loading inherited module 'com.pubnub.gwt.api.Pubnub' + Module location: jar:file:/home/workpn/Desktop/PubnubGwt.jar!/com/pubnub/gwt/api/Pubnub.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.json.JSON' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/json/JSON.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped +Public resources found in... +Translatable source found in... +Validating newly compiled units + [ERROR] Errors in 'file:/home/workpn/workspace/PubnubExample/src/com/pubnub/gwt/examples/client/PubnubExample.java' + [ERROR] Line 294: Duplicate local variable lbl + [ERROR] Line 298: CheckBox cannot be resolved to a type + [ERROR] Line 302: Syntax error, insert ";" to complete LocalVariableDeclarationStatement + [ERROR] Line 302: btn cannot be resolved + [ERROR] Line 303: btn cannot be resolved + [ERROR] Line 304: btn cannot be resolved + [ERROR] Line 315: btn cannot be resolved +Removing invalidated units +Finding entry point classes + [ERROR] Unable to find type 'com.pubnub.gwt.examples.client.PubnubExample' + [ERROR] Hint: Previous compiler errors may have made this type unavailable + [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly +Module location: file:/home/workpn/workspace/PubnubExample/src/com/pubnub/gwt/examples/PublishExample.gwt.xml +Loading inherited module 'com.google.gwt.user.User' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/User.gwt.xml + Loading inherited module 'com.google.gwt.canvas.Canvas' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/Canvas.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.canvas.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/Core.gwt.xml + Loading inherited module 'com.google.gwt.dev.jjs.intrinsic.Intrinsic' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/dev/jjs/intrinsic/Intrinsic.gwt.xml + Loading inherited module 'com.google.gwt.lang.LongLib' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/lang/LongLib.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/Emulation.gwt.xml + Loading inherited module 'com.google.gwt.logging.LogImpl' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/logging/LogImpl.gwt.xml + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/xhr/XMLHttpRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CompilerParameters' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CompilerParameters.gwt.xml + Loading inherited module 'com.google.gwt.core.EmulateJsStack' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/EmulateJsStack.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.AsyncFragmentLoader' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/AsyncFragmentLoader.gwt.xml + Loading inherited module 'com.google.gwt.core.XSLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/XSLinker.gwt.xml + Loading inherited module 'com.google.gwt.core.CrossSiteIframeLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CrossSiteIframeLinker.gwt.xml + Loading inherited module 'com.google.gwt.user.UserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/UserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.EmulationWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/EmulationWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module 'com.google.gwt.emul.Emulation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CoreWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CoreWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/text/Text.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/EventBase.gwt.xml + Loading inherited module 'com.google.web.bindery.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/web/bindery/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.DomEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/DomEvent.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.TouchEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/TouchEvent.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.logical.LogicalEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/logical/LogicalEvent.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/animation/Animation.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/editor/Editor.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'javax.validation.Validation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/javax/validation/Validation.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/resources/Resources.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.http.HTTP' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/http/HTTP.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.jsonp.Jsonp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/jsonp/Jsonp.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.layout.Layout' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/layout/Layout.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module 'com.google.gwt.animation.Animation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.Media' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/Media.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.touch.Touch' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/touch/Touch.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.uibinder.UiBinder' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/uibinder/UiBinder.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module 'com.google.gwt.resources.Resources' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.AsyncProxy' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/AsyncProxy.gwt.xml + Loading inherited module 'com.google.gwt.user.RemoteService' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RemoteService.gwt.xml + Loading inherited module 'com.google.gwt.http.HTTP' + Module 'com.google.gwt.http.HTTP' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DocumentRoot' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DocumentRoot.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Window.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.HTTPRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/HTTPRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.History' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/History.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.i18n.I18N' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/i18n/I18N.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/regexp/RegExp.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safehtml/SafeHtml.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module 'com.google.gwt.regexp.RegExp' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Popup' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Popup.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Form' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Form.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.TextBox' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/TextBox.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Focus' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Focus.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ImageBundle' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ImageBundle.gwt.xml + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ClippedImage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module 'com.google.gwt.user.ClippedImage' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.RichText' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RichText.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.SplitPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/SplitPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.CaptionPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/CaptionPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module 'com.google.gwt.user.Window' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Tree' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Tree.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Hyperlink' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Hyperlink.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.FileUpload' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/FileUpload.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ResizeLayoutPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ResizeLayoutPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ScrollPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ScrollPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.datepicker.DatePicker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/datepicker/DatePicker.gwt.xml + Loading inherited module 'com.google.gwt.user.cellview.CellView' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/cellview/CellView.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.cell.Cell' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/cell/Cell.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module 'com.google.gwt.text.Text' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module 'com.google.gwt.editor.Editor' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.view.View' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/view/View.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safecss.SafeCss' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safecss/SafeCss.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.storage.Storage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/storage/Storage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped +Loading inherited module 'com.google.gwt.user.theme.clean.Clean' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/theme/clean/Clean.gwt.xml +Loading inherited module 'com.pubnub.gwt.api.Pubnub' + Module location: jar:file:/home/workpn/Desktop/PubnubGwt.jar!/com/pubnub/gwt/api/Pubnub.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.json.JSON' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/json/JSON.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped +Public resources found in... +Translatable source found in... +Validating newly compiled units + [ERROR] Errors in 'file:/home/workpn/workspace/PubnubExample/src/com/pubnub/gwt/examples/client/PubnubExample.java' + [ERROR] Line 294: Duplicate local variable lbl + [ERROR] Line 298: CheckBox cannot be resolved to a type + [ERROR] Line 302: Syntax error, insert ";" to complete LocalVariableDeclarationStatement + [ERROR] Line 302: btn cannot be resolved + [ERROR] Line 303: btn cannot be resolved + [ERROR] Line 304: btn cannot be resolved + [ERROR] Line 315: btn cannot be resolved +Removing invalidated units +Finding entry point classes + [ERROR] Unable to find type 'com.pubnub.gwt.examples.client.PubnubExample' + [ERROR] Hint: Previous compiler errors may have made this type unavailable + [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly +Module location: file:/home/workpn/workspace/PubnubExample/src/com/pubnub/gwt/examples/PublishExample.gwt.xml +Loading inherited module 'com.google.gwt.user.User' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/User.gwt.xml + Loading inherited module 'com.google.gwt.canvas.Canvas' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/Canvas.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.canvas.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/Core.gwt.xml + Loading inherited module 'com.google.gwt.dev.jjs.intrinsic.Intrinsic' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/dev/jjs/intrinsic/Intrinsic.gwt.xml + Loading inherited module 'com.google.gwt.lang.LongLib' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/lang/LongLib.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/Emulation.gwt.xml + Loading inherited module 'com.google.gwt.logging.LogImpl' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/logging/LogImpl.gwt.xml + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/xhr/XMLHttpRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CompilerParameters' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CompilerParameters.gwt.xml + Loading inherited module 'com.google.gwt.core.EmulateJsStack' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/EmulateJsStack.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.AsyncFragmentLoader' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/AsyncFragmentLoader.gwt.xml + Loading inherited module 'com.google.gwt.core.XSLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/XSLinker.gwt.xml + Loading inherited module 'com.google.gwt.core.CrossSiteIframeLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CrossSiteIframeLinker.gwt.xml + Loading inherited module 'com.google.gwt.user.UserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/UserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.EmulationWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/EmulationWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module 'com.google.gwt.emul.Emulation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CoreWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CoreWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/text/Text.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/EventBase.gwt.xml + Loading inherited module 'com.google.web.bindery.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/web/bindery/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.DomEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/DomEvent.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.TouchEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/TouchEvent.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.logical.LogicalEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/logical/LogicalEvent.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/animation/Animation.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/editor/Editor.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'javax.validation.Validation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/javax/validation/Validation.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/resources/Resources.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.http.HTTP' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/http/HTTP.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.jsonp.Jsonp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/jsonp/Jsonp.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.layout.Layout' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/layout/Layout.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module 'com.google.gwt.animation.Animation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.Media' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/Media.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.touch.Touch' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/touch/Touch.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.uibinder.UiBinder' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/uibinder/UiBinder.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module 'com.google.gwt.resources.Resources' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.AsyncProxy' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/AsyncProxy.gwt.xml + Loading inherited module 'com.google.gwt.user.RemoteService' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RemoteService.gwt.xml + Loading inherited module 'com.google.gwt.http.HTTP' + Module 'com.google.gwt.http.HTTP' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DocumentRoot' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DocumentRoot.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Window.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.HTTPRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/HTTPRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.History' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/History.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.i18n.I18N' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/i18n/I18N.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/regexp/RegExp.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safehtml/SafeHtml.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module 'com.google.gwt.regexp.RegExp' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Popup' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Popup.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Form' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Form.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.TextBox' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/TextBox.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Focus' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Focus.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ImageBundle' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ImageBundle.gwt.xml + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ClippedImage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module 'com.google.gwt.user.ClippedImage' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.RichText' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RichText.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.SplitPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/SplitPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.CaptionPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/CaptionPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module 'com.google.gwt.user.Window' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Tree' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Tree.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Hyperlink' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Hyperlink.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.FileUpload' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/FileUpload.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ResizeLayoutPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ResizeLayoutPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ScrollPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ScrollPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.datepicker.DatePicker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/datepicker/DatePicker.gwt.xml + Loading inherited module 'com.google.gwt.user.cellview.CellView' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/cellview/CellView.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.cell.Cell' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/cell/Cell.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module 'com.google.gwt.text.Text' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module 'com.google.gwt.editor.Editor' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.view.View' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/view/View.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safecss.SafeCss' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safecss/SafeCss.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.storage.Storage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/storage/Storage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped +Loading inherited module 'com.google.gwt.user.theme.clean.Clean' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/theme/clean/Clean.gwt.xml +Loading inherited module 'com.pubnub.gwt.api.Pubnub' + Module location: jar:file:/home/workpn/Desktop/PubnubGwt.jar!/com/pubnub/gwt/api/Pubnub.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.json.JSON' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/json/JSON.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped +Public resources found in... +Translatable source found in... +Removing invalidated units +Finding entry point classes +Rebinding com.google.gwt.i18n.client.impl.LocaleInfoImpl + Invoking generator com.google.gwt.i18n.rebind.LocaleInfoGenerator + Processing interface com.google.gwt.i18n.client.constants.NumberConstantsImpl + Generating method body for percentPattern() + Generating method body for zeroDigit() + Generating method body for scientificPattern() + Generating method body for decimalSeparator() + Generating method body for notANumber() + Generating method body for minusSign() + Generating method body for infinity() + Generating method body for exponentialSymbol() + Generating method body for plusSign() + Generating method body for currencyPattern() + Generating method body for monetaryGroupingSeparator() + Generating method body for groupingSeparator() + Generating method body for perMill() + Generating method body for monetarySeparator() + Generating method body for decimalPattern() + Generating method body for percent() + Generating method body for defCurrencyCode() + Adding '3' new generated units + Removing invalidated units +Module location: file:/home/workpn/workspace/PubnubExample/src/com/pubnub/gwt/examples/PublishExample.gwt.xml +Loading inherited module 'com.google.gwt.user.User' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/User.gwt.xml + Loading inherited module 'com.google.gwt.canvas.Canvas' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/Canvas.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.canvas.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/canvas/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/Core.gwt.xml + Loading inherited module 'com.google.gwt.dev.jjs.intrinsic.Intrinsic' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/dev/jjs/intrinsic/Intrinsic.gwt.xml + Loading inherited module 'com.google.gwt.lang.LongLib' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar!/com/google/gwt/lang/LongLib.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/Emulation.gwt.xml + Loading inherited module 'com.google.gwt.logging.LogImpl' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/logging/LogImpl.gwt.xml + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/xhr/XMLHttpRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CompilerParameters' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CompilerParameters.gwt.xml + Loading inherited module 'com.google.gwt.core.EmulateJsStack' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/EmulateJsStack.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.AsyncFragmentLoader' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/AsyncFragmentLoader.gwt.xml + Loading inherited module 'com.google.gwt.core.XSLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/XSLinker.gwt.xml + Loading inherited module 'com.google.gwt.core.CrossSiteIframeLinker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CrossSiteIframeLinker.gwt.xml + Loading inherited module 'com.google.gwt.user.UserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/UserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.EmulationWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/emul/EmulationWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.emul.Emulation' + Module 'com.google.gwt.emul.Emulation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.CoreWithUserAgent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/core/CoreWithUserAgent.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/text/Text.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/EventBase.gwt.xml + Loading inherited module 'com.google.web.bindery.event.Event' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/web/bindery/event/Event.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.DomEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/DomEvent.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.dom.TouchEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/dom/TouchEvent.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.event.logical.LogicalEvent' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/event/logical/LogicalEvent.gwt.xml + Loading inherited module 'com.google.gwt.event.EventBase' + Module 'com.google.gwt.event.EventBase' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/animation/Animation.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/editor/Editor.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'javax.validation.Validation' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/javax/validation/Validation.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/resources/Resources.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.http.HTTP' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/http/HTTP.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.jsonp.Jsonp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/jsonp/Jsonp.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.layout.Layout' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/layout/Layout.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.animation.Animation' + Module 'com.google.gwt.animation.Animation' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.Media' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/Media.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.media.dom.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/media/dom/DOM.gwt.xml + Loading inherited module 'com.google.gwt.touch.Touch' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/touch/Touch.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.uibinder.UiBinder' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/uibinder/UiBinder.gwt.xml + Loading inherited module 'com.google.gwt.resources.Resources' + Module 'com.google.gwt.resources.Resources' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.AsyncProxy' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/AsyncProxy.gwt.xml + Loading inherited module 'com.google.gwt.user.RemoteService' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RemoteService.gwt.xml + Loading inherited module 'com.google.gwt.http.HTTP' + Module 'com.google.gwt.http.HTTP' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DocumentRoot' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DocumentRoot.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.DOM' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/DOM.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Window.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.HTTPRequest' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/HTTPRequest.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.xhr.XMLHttpRequest' + Module 'com.google.gwt.xhr.XMLHttpRequest' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.History' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/History.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.i18n.I18N' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/i18n/I18N.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/regexp/RegExp.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safehtml/SafeHtml.gwt.xml + Loading inherited module 'com.google.gwt.regexp.RegExp' + Module 'com.google.gwt.regexp.RegExp' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Popup' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Popup.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Form' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Form.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.TextBox' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/TextBox.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Focus' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Focus.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ImageBundle' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ImageBundle.gwt.xml + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ClippedImage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ClippedImage' + Module 'com.google.gwt.user.ClippedImage' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.RichText' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/RichText.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.SplitPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/SplitPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.CaptionPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/CaptionPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Window' + Module 'com.google.gwt.user.Window' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Tree' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Tree.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.Hyperlink' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/Hyperlink.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.FileUpload' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/FileUpload.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ResizeLayoutPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ResizeLayoutPanel.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.ScrollPanel' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/ScrollPanel.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.datepicker.DatePicker' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/datepicker/DatePicker.gwt.xml + Loading inherited module 'com.google.gwt.user.cellview.CellView' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/cellview/CellView.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.cell.Cell' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/cell/Cell.gwt.xml + Loading inherited module 'com.google.gwt.dom.DOM' + Module 'com.google.gwt.dom.DOM' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.text.Text' + Module 'com.google.gwt.text.Text' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.editor.Editor' + Module 'com.google.gwt.editor.Editor' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.view.View' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/view/View.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.safecss.SafeCss' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/safecss/SafeCss.gwt.xml + Loading inherited module 'com.google.gwt.safehtml.SafeHtml' + Module 'com.google.gwt.safehtml.SafeHtml' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.storage.Storage' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/storage/Storage.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.user.UserAgent' + Module 'com.google.gwt.user.UserAgent' has already been loaded and will be skipped +Loading inherited module 'com.google.gwt.user.theme.clean.Clean' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/user/theme/clean/Clean.gwt.xml +Loading inherited module 'com.pubnub.gwt.api.Pubnub' + Module location: jar:file:/home/workpn/Desktop/PubnubGwt.jar!/com/pubnub/gwt/api/Pubnub.gwt.xml + Loading inherited module 'com.google.gwt.user.User' + Module 'com.google.gwt.user.User' has already been loaded and will be skipped + Loading inherited module 'com.google.gwt.json.JSON' + Module location: jar:file:/usr/local/eclipse3.6_helios/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-user.jar!/com/google/gwt/json/JSON.gwt.xml + Loading inherited module 'com.google.gwt.core.Core' + Module 'com.google.gwt.core.Core' has already been loaded and will be skipped +Public resources found in... +Translatable source found in... +Removing invalidated units +Finding entry point classes +Rebinding com.google.gwt.i18n.client.impl.LocaleInfoImpl + Invoking generator com.google.gwt.i18n.rebind.LocaleInfoGenerator + Processing interface com.google.gwt.i18n.client.constants.NumberConstantsImpl + Generating method body for percentPattern() + Generating method body for zeroDigit() + Generating method body for scientificPattern() + Generating method body for decimalSeparator() + Generating method body for notANumber() + Generating method body for minusSign() + Generating method body for infinity() + Generating method body for exponentialSymbol() + Generating method body for plusSign() + Generating method body for currencyPattern() + Generating method body for monetaryGroupingSeparator() + Generating method body for groupingSeparator() + Generating method body for perMill() + Generating method body for monetarySeparator() + Generating method body for decimalPattern() + Generating method body for percent() + Generating method body for defCurrencyCode() + Adding '3' new generated units + Removing invalidated units diff --git a/gwt/3.3/examples/PubnubExample/build.xml b/gwt/3.3/examples/PubnubExample/build.xml new file mode 100644 index 000000000..70452ccb2 --- /dev/null +++ b/gwt/3.3/examples/PubnubExample/build.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gwt/3.3/examples/PubnubExample/pubnubexample.war b/gwt/3.3/examples/PubnubExample/pubnubexample.war new file mode 100644 index 000000000..5648d4f6f Binary files /dev/null and b/gwt/3.3/examples/PubnubExample/pubnubexample.war differ diff --git a/gwt/3.3/examples/PubnubExample/src/com/pubnub/gwt/examples/PubnubExample.gwt.xml b/gwt/3.3/examples/PubnubExample/src/com/pubnub/gwt/examples/PubnubExample.gwt.xml new file mode 100644 index 000000000..dce555208 --- /dev/null +++ b/gwt/3.3/examples/PubnubExample/src/com/pubnub/gwt/examples/PubnubExample.gwt.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/gwt/3.3/examples/PubnubExample/war/WEB-INF/classes/com/pubnub/gwt/examples/PublishExample.gwt.xml b/gwt/3.3/examples/PubnubExample/war/WEB-INF/classes/com/pubnub/gwt/examples/PublishExample.gwt.xml new file mode 100644 index 000000000..1585465c7 --- /dev/null +++ b/gwt/3.3/examples/PubnubExample/war/WEB-INF/classes/com/pubnub/gwt/examples/PublishExample.gwt.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + ', backslash:'\\\\', ei: {quotes: '\"\\''},eo: {a: '\"quoted\"', b:\"don't\"}, quotes: [\"'\", '\"']}"); + System.out.println(j.toString(2)); + System.out.println(XML.toString(j)); + System.out.println(""); + + j = new JSONObject( + "{foo: [true, false,9876543210, 0.0, 1.00000001, 1.000000000001, 1.00000000000000001," + + " .00000000000000001, 2.00, 0.1, 2e100, -32,[],{}, \"string\"], " + + " to : null, op : 'Good'," + + "ten:10} postfix comment"); + j.put("String", "98.6"); + j.put("JSONObject", new JSONObject()); + j.put("JSONArray", new JSONArray()); + j.put("int", 57); + j.put("double", 123456789012345678901234567890.); + j.put("true", true); + j.put("false", false); + j.put("null", JSONObject.NULL); + j.put("bool", "true"); + j.put("zero", -0.0); + j.put("\\u2028", "\u2028"); + j.put("\\u2029", "\u2029"); + a = j.getJSONArray("foo"); + a.put(666); + a.put(2001.99); + a.put("so \"fine\"."); + a.put("so ."); + a.put(true); + a.put(false); + a.put(new JSONArray()); + a.put(new JSONObject()); + j.put("keys", JSONObject.getNames(j)); + System.out.println(j.toString(4)); + System.out.println(XML.toString(j)); + + System.out.println("String: " + j.getDouble("String")); + System.out.println(" bool: " + j.getBoolean("bool")); + System.out.println(" to: " + j.getString("to")); + System.out.println(" true: " + j.getString("true")); + System.out.println(" foo: " + j.getJSONArray("foo")); + System.out.println(" op: " + j.getString("op")); + System.out.println(" ten: " + j.getInt("ten")); + System.out.println(" oops: " + j.optBoolean("oops")); + + s = "First \u0009<content> This is \"content\". 3 JSON does not preserve the sequencing of elements and contents. III T H R E EContent text is an implied structure in XML. JSON does not have implied structure:7everything is explicit.!]]>"; + j = XML.toJSONObject(s); + System.out.println(j.toString(2)); + System.out.println(XML.toString(j)); + System.out.println(""); + + ja = JSONML.toJSONArray(s); + System.out.println(ja.toString(4)); + System.out.println(JSONML.toString(ja)); + System.out.println(""); + + s = "unodostrestruequatrocinqoseis"; + ja = JSONML.toJSONArray(s); + System.out.println(ja.toString(4)); + System.out.println(JSONML.toString(ja)); + System.out.println(""); + + s = " "; + j = XML.toJSONObject(s); + + System.out.println(j.toString(2)); + System.out.println(XML.toString(j)); + System.out.println(""); + ja = JSONML.toJSONArray(s); + System.out.println(ja.toString(4)); + System.out.println(JSONML.toString(ja)); + System.out.println(""); + + j = XML.toJSONObject("Sample BookThis is chapter 1. It is not very long or interesting.This is chapter 2. Although it is longer than chapter 1, it is not any more interesting."); + System.out.println(j.toString(2)); + System.out.println(XML.toString(j)); + System.out.println(""); + + j = XML.toJSONObject(""); + System.out.println(j.toString(2)); + System.out.println(XML.toString(j)); + System.out.println(""); + + j = XML.toJSONObject(" Fred fbs0001 Scerbo B "); + System.out.println(j.toString(2)); + System.out.println(XML.toString(j)); + System.out.println(""); + + j = XML.toJSONObject("Repository Address Special Collections LibraryABC UniversityMain Library, 40 Circle DriveOurtown, Pennsylvania17654 USA"); + System.out.println(j.toString()); + System.out.println(XML.toString(j)); + System.out.println(""); + + j = XML.toJSONObject("deluxe&"toot"&toot;Aeksbonusbonus2"); + System.out.println(j.toString(2)); + System.out.println(XML.toString(j)); + System.out.println(""); + + j = HTTP.toJSONObject("GET / HTTP/1.0\nAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*\nAccept-Language: en-us\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; T312461; Q312461)\nHost: www.nokko.com\nConnection: keep-alive\nAccept-encoding: gzip, deflate\n"); + System.out.println(j.toString(2)); + System.out.println(HTTP.toString(j)); + System.out.println(""); + + j = HTTP.toJSONObject("HTTP/1.1 200 Oki Doki\nDate: Sun, 26 May 2002 17:38:52 GMT\nServer: Apache/1.3.23 (Unix) mod_perl/1.26\nKeep-Alive: timeout=15, max=100\nConnection: Keep-Alive\nTransfer-Encoding: chunked\nContent-Type: text/html\n"); + System.out.println(j.toString(2)); + System.out.println(HTTP.toString(j)); + System.out.println(""); + + j = new JSONObject("{nix: null, nux: false, null: 'null', 'Request-URI': '/', Method: 'GET', 'HTTP-Version': 'HTTP/1.0'}"); + System.out.println(j.toString(2)); + System.out.println("isNull: " + j.isNull("nix")); + System.out.println(" has: " + j.has("nix")); + System.out.println(XML.toString(j)); + System.out.println(HTTP.toString(j)); + System.out.println(""); + + j = XML.toJSONObject(""+"\n\n"+""+ + ""+ + "GOOGLEKEY '+search+' 0 10 true false latin1 latin1"+ + ""+ + ""); + System.out.println(j.toString(2)); + System.out.println(XML.toString(j)); + System.out.println(""); + + j = new JSONObject("{Envelope: {Body: {\"ns1:doGoogleSearch\": {oe: \"latin1\", filter: true, q: \"'+search+'\", key: \"GOOGLEKEY\", maxResults: 10, \"SOAP-ENV:encodingStyle\": \"http://schemas.xmlsoap.org/soap/encoding/\", start: 0, ie: \"latin1\", safeSearch:false, \"xmlns:ns1\": \"urn:GoogleSearch\"}}}}"); + System.out.println(j.toString(2)); + System.out.println(XML.toString(j)); + System.out.println(""); + + j = CookieList.toJSONObject(" f%oo = b+l=ah ; o;n%40e = t.wo "); + System.out.println(j.toString(2)); + System.out.println(CookieList.toString(j)); + System.out.println(""); + + j = Cookie.toJSONObject("f%oo=blah; secure ;expires = April 24, 2002"); + System.out.println(j.toString(2)); + System.out.println(Cookie.toString(j)); + System.out.println(""); + + j = new JSONObject("{script: 'It is not allowed in HTML to send a close script tag in a stringso we insert a backslash before the /'}"); + System.out.println(j.toString()); + System.out.println(""); + + JSONTokener jt = new JSONTokener("{op:'test', to:'session', pre:1}{op:'test', to:'session', pre:2}"); + j = new JSONObject(jt); + System.out.println(j.toString()); + System.out.println("pre: " + j.optInt("pre")); + int i = jt.skipTo('{'); + System.out.println(i); + j = new JSONObject(jt); + System.out.println(j.toString()); + System.out.println(""); + + a = CDL.toJSONArray("Comma delimited list test, '\"Strip\"Quotes', 'quote, comma', No quotes, 'Single Quotes', \"Double Quotes\"\n1,'2',\"3\"\n,'It is \"good,\"', \"It works.\"\n\n"); + + s = CDL.toString(a); + System.out.println(s); + System.out.println(""); + System.out.println(a.toString(4)); + System.out.println(""); + a = CDL.toJSONArray(s); + System.out.println(a.toString(4)); + System.out.println(""); + + a = new JSONArray(" [\"\", next is an implied null , , ok,] "); + System.out.println(a.toString()); + System.out.println(""); + System.out.println(XML.toString(a)); + System.out.println(""); + + j = new JSONObject("{ fun => with non-standard forms ; forgiving => This package can be used to parse formats that are similar to but not stricting conforming to JSON; why=To make it easier to migrate existing data to JSON,one = [[1.00]]; uno=[[{1=>1}]];'+':+6e66 ;pluses=+++;empty = '' , 'double':0.666,true: TRUE, false: FALSE, null=NULL;[true] = [[!,@;*]]; string=> o. k. ; \r oct=0666; hex=0x666; dec=666; o=0999; noh=0x0x}"); + System.out.println(j.toString(4)); + System.out.println(""); + if (j.getBoolean("true") && !j.getBoolean("false")) { + System.out.println("It's all good"); + } + + System.out.println(""); + j = new JSONObject(j, new String[]{"dec", "oct", "hex", "missing"}); + System.out.println(j.toString(4)); + + System.out.println(""); + System.out.println(new JSONStringer().array().value(a).value(j).endArray()); + + j = new JSONObject("{string: \"98.6\", long: 2147483648, int: 2147483647, longer: 9223372036854775807, double: 9223372036854775808}"); + System.out.println(j.toString(4)); + + System.out.println("\ngetInt"); + System.out.println("int " + j.getInt("int")); + System.out.println("long " + j.getInt("long")); + System.out.println("longer " + j.getInt("longer")); + //System.out.println("double " + j.getInt("double")); + //System.out.println("string " + j.getInt("string")); + + System.out.println("\ngetLong"); + System.out.println("int " + j.getLong("int")); + System.out.println("long " + j.getLong("long")); + System.out.println("longer " + j.getLong("longer")); + //System.out.println("double " + j.getLong("double")); + //System.out.println("string " + j.getLong("string")); + + System.out.println("\ngetDouble"); + System.out.println("int " + j.getDouble("int")); + System.out.println("long " + j.getDouble("long")); + System.out.println("longer " + j.getDouble("longer")); + System.out.println("double " + j.getDouble("double")); + System.out.println("string " + j.getDouble("string")); + + j.put("good sized", 9223372036854775807L); + System.out.println(j.toString(4)); + + a = new JSONArray("[2147483647, 2147483648, 9223372036854775807, 9223372036854775808]"); + System.out.println(a.toString(4)); + + System.out.println("\nKeys: "); + it = j.keys(); + while (it.hasNext()) { + s = (String)it.next(); + System.out.println(s + ": " + j.getString(s)); + } + + + System.out.println("\naccumulate: "); + j = new JSONObject(); + j.accumulate("stooge", "Curly"); + j.accumulate("stooge", "Larry"); + j.accumulate("stooge", "Moe"); + a = j.getJSONArray("stooge"); + a.put(5, "Shemp"); + System.out.println(j.toString(4)); + + System.out.println("\nwrite:"); + System.out.println(j.write(new StringWriter())); + + s = "122333"; + j = XML.toJSONObject(s); + System.out.println(j.toString(4)); + System.out.println(XML.toString(j)); + + s = "Content of the first chapterContent of the second chapter Content of the first subchapter Content of the second subchapterThird Chapter"; + j = XML.toJSONObject(s); + System.out.println(j.toString(4)); + System.out.println(XML.toString(j)); + + a = JSONML.toJSONArray(s); + System.out.println(a.toString(4)); + System.out.println(JSONML.toString(a)); + + Collection c = null; + Map m = null; + + j = new JSONObject(m); + a = new JSONArray(c); + j.append("stooge", "Joe DeRita"); + j.append("stooge", "Shemp"); + j.accumulate("stooges", "Curly"); + j.accumulate("stooges", "Larry"); + j.accumulate("stooges", "Moe"); + j.accumulate("stoogearray", j.get("stooges")); + j.put("map", m); + j.put("collection", c); + j.put("array", a); + a.put(m); + a.put(c); + System.out.println(j.toString(4)); + + s = "{plist=Apple; AnimalSmells = { pig = piggish; lamb = lambish; worm = wormy; }; AnimalSounds = { pig = oink; lamb = baa; worm = baa; Lisa = \"Why is the worm talking like a lamb?\" } ; AnimalColors = { pig = pink; lamb = black; worm = pink; } } "; + j = new JSONObject(s); + System.out.println(j.toString(4)); + + s = " (\"San Francisco\", \"New York\", \"Seoul\", \"London\", \"Seattle\", \"Shanghai\")"; + a = new JSONArray(s); + System.out.println(a.toString()); + + s = "The content of b and The content of cdoremi"; + j = XML.toJSONObject(s); + + System.out.println(j.toString(2)); + System.out.println(XML.toString(j)); + System.out.println(""); + ja = JSONML.toJSONArray(s); + System.out.println(ja.toString(4)); + System.out.println(JSONML.toString(ja)); + System.out.println(""); + + s = "111111111111111"; + j = JSONML.toJSONObject(s); + System.out.println(j); + ja = JSONML.toJSONArray(s); + System.out.println(ja); + + + System.out.println("\nTesting Exceptions: "); + + System.out.print("Exception: "); + try { + a = new JSONArray("[\n\r\n\r}"); + System.out.println(a.toString()); + } catch (Exception e) { + System.out.println(e); + } + + System.out.print("Exception: "); + try { + a = new JSONArray("<\n\r\n\r "); + System.out.println(a.toString()); + } catch (Exception e) { + System.out.println(e); + } + + System.out.print("Exception: "); + try { + a = new JSONArray(); + a.put(Double.NEGATIVE_INFINITY); + a.put(Double.NaN); + System.out.println(a.toString()); + } catch (Exception e) { + System.out.println(e); + } + System.out.print("Exception: "); + try { + System.out.println(j.getDouble("stooge")); + } catch (Exception e) { + System.out.println(e); + } + System.out.print("Exception: "); + try { + System.out.println(j.getDouble("howard")); + } catch (Exception e) { + System.out.println(e); + } + System.out.print("Exception: "); + try { + System.out.println(j.put(null, "howard")); + } catch (Exception e) { + System.out.println(e); + } + System.out.print("Exception: "); + try { + System.out.println(a.getDouble(0)); + } catch (Exception e) { + System.out.println(e); + } + System.out.print("Exception: "); + try { + System.out.println(a.get(-1)); + } catch (Exception e) { + System.out.println(e); + } + System.out.print("Exception: "); + try { + System.out.println(a.put(Double.NaN)); + } catch (Exception e) { + System.out.println(e); + } + System.out.print("Exception: "); + try { + j = XML.toJSONObject(" "); + } catch (Exception e) { + System.out.println(e); + } + System.out.print("Exception: "); + try { + j = XML.toJSONObject(" "); + } catch (Exception e) { + System.out.println(e); + } + System.out.print("Exception: "); + try { + j = XML.toJSONObject("'. */ + public static final Character GT = new Character('>'); + + /** The Character '<'. */ + public static final Character LT = new Character('<'); + + /** The Character '?'. */ + public static final Character QUEST = new Character('?'); + + /** The Character '"'. */ + public static final Character QUOT = new Character('"'); + + /** The Character '/'. */ + public static final Character SLASH = new Character('/'); + + /** + * Replace special characters with XML escapes: + *
+     * & (ampersand) is replaced by &amp;
+     * < (less than) is replaced by &lt;
+     * > (greater than) is replaced by &gt;
+     * " (double quote) is replaced by &quot;
+     * 
+ * @param string The string to be escaped. + * @return The escaped string. + */ + public static String escape(String string) { + StringBuffer sb = new StringBuffer(); + for (int i = 0, len = string.length(); i < len; i++) { + char c = string.charAt(i); + switch (c) { + case '&': + sb.append("&"); + break; + case '<': + sb.append("<"); + break; + case '>': + sb.append(">"); + break; + case '"': + sb.append("""); + break; + default: + sb.append(c); + } + } + return sb.toString(); + } + + /** + * Throw an exception if the string contains whitespace. + * Whitespace is not allowed in tagNames and attributes. + * @param string + * @throws JSONException + */ + public static void noSpace(String string) throws JSONException { + int i, length = string.length(); + if (length == 0) { + throw new JSONException("Empty string."); + } + for (i = 0; i < length; i += 1) { + if (Character.isWhitespace(string.charAt(i))) { + throw new JSONException("'" + string + + "' contains a space character."); + } + } + } + + /** + * Scan the content following the named tag, attaching it to the context. + * @param x The XMLTokener containing the source string. + * @param context The JSONObject that will include the new material. + * @param name The tag name. + * @return true if the close tag is processed. + * @throws JSONException + */ + private static boolean parse(XMLTokener x, JSONObject context, + String name) throws JSONException { + char c; + int i; + String n; + JSONObject o = null; + String s; + Object t; + +// Test for and skip past these forms: +// +// +// +// +// Report errors for these forms: +// <> +// <= +// << + + t = x.nextToken(); + +// "); + return false; + } + x.back(); + } else if (c == '[') { + t = x.nextToken(); + if (t.equals("CDATA")) { + if (x.next() == '[') { + s = x.nextCDATA(); + if (s.length() > 0) { + context.accumulate("content", s); + } + return false; + } + } + throw x.syntaxError("Expected 'CDATA['"); + } + i = 1; + do { + t = x.nextMeta(); + if (t == null) { + throw x.syntaxError("Missing '>' after ' 0); + return false; + } else if (t == QUEST) { + +// "); + return false; + } else if (t == SLASH) { + +// Close tag + + } else if (t == SLASH) { + if (x.nextToken() != GT) { + throw x.syntaxError("Misshaped tag"); + } + if (o.length() > 0) { + context.accumulate(n, o); + } else { + context.accumulate(n, ""); + } + return false; + +// Content, between <...> and + + } else if (t == GT) { + for (;;) { + t = x.nextContent(); + if (t == null) { + if (n != null) { + throw x.syntaxError("Unclosed tag " + n); + } + return false; + } else if (t instanceof String) { + s = (String)t; + if (s.length() > 0) { + o.accumulate("content", JSONObject.stringToValue(s)); + } + +// Nested element + + } else if (t == LT) { + if (parse(x, o, n)) { + if (o.length() == 0) { + context.accumulate(n, ""); + } else if (o.length() == 1 && + o.opt("content") != null) { + context.accumulate(n, o.opt("content")); + } else { + context.accumulate(n, o); + } + return false; + } + } + } + } else { + throw x.syntaxError("Misshaped tag"); + } + } + } + } + + + /** + * Convert a well-formed (but not necessarily valid) XML string into a + * JSONObject. Some information may be lost in this transformation + * because JSON is a data format and XML is a document format. XML uses + * elements, attributes, and content text, while JSON uses unordered + * collections of name/value pairs and arrays of values. JSON does not + * does not like to distinguish between elements and attributes. + * Sequences of similar elements are represented as JSONArrays. Content + * text may be placed in a "content" member. Comments, prologs, DTDs, and + * <[ [ ]]> are ignored. + * @param string The source string. + * @return A JSONObject containing the structured data from the XML string. + * @throws JSONException + */ + public static JSONObject toJSONObject(String string) throws JSONException { + JSONObject o = new JSONObject(); + XMLTokener x = new XMLTokener(string); + while (x.more() && x.skipPast("<")) { + parse(x, o, null); + } + return o; + } + + + /** + * Convert a JSONObject into a well-formed, element-normal XML string. + * @param o A JSONObject. + * @return A string. + * @throws JSONException + */ + public static String toString(Object o) throws JSONException { + return toString(o, null); + } + + + /** + * Convert a JSONObject into a well-formed, element-normal XML string. + * @param o A JSONObject. + * @param tagName The optional name of the enclosing tag. + * @return A string. + * @throws JSONException + */ + public static String toString(Object o, String tagName) + throws JSONException { + StringBuffer b = new StringBuffer(); + int i; + JSONArray ja; + JSONObject jo; + String k; + Iterator keys; + int len; + String s; + Object v; + if (o instanceof JSONObject) { + +// Emit + + if (tagName != null) { + b.append('<'); + b.append(tagName); + b.append('>'); + } + +// Loop thru the keys. + + jo = (JSONObject)o; + keys = jo.keys(); + while (keys.hasNext()) { + k = keys.next().toString(); + v = jo.opt(k); + if (v == null) { + v = ""; + } + if (v instanceof String) { + s = (String)v; + } else { + s = null; + } + +// Emit content in body + + if (k.equals("content")) { + if (v instanceof JSONArray) { + ja = (JSONArray)v; + len = ja.length(); + for (i = 0; i < len; i += 1) { + if (i > 0) { + b.append('\n'); + } + b.append(escape(ja.get(i).toString())); + } + } else { + b.append(escape(v.toString())); + } + +// Emit an array of similar keys + + } else if (v instanceof JSONArray) { + ja = (JSONArray)v; + len = ja.length(); + for (i = 0; i < len; i += 1) { + v = ja.get(i); + if (v instanceof JSONArray) { + b.append('<'); + b.append(k); + b.append('>'); + b.append(toString(v)); + b.append("'); + } else { + b.append(toString(v, k)); + } + } + } else if (v.equals("")) { + b.append('<'); + b.append(k); + b.append("/>"); + +// Emit a new tag + + } else { + b.append(toString(v, k)); + } + } + if (tagName != null) { + +// Emit the close tag + + b.append("'); + } + return b.toString(); + +// XML does not have good support for arrays. If an array appears in a place +// where XML is lacking, synthesize an element. + + } else if (o instanceof JSONArray) { + ja = (JSONArray)o; + len = ja.length(); + for (i = 0; i < len; ++i) { + v = ja.opt(i); + b.append(toString(v, (tagName == null) ? "array" : tagName)); + } + return b.toString(); + } else { + s = (o == null) ? "null" : escape(o.toString()); + return (tagName == null) ? "\"" + s + "\"" : + (s.length() == 0) ? "<" + tagName + "/>" : + "<" + tagName + ">" + s + ""; + } + } +} \ No newline at end of file diff --git a/gwt/3.3/src/org/json/XMLTokener.java b/gwt/3.3/src/org/json/XMLTokener.java new file mode 100644 index 000000000..39f90a6ff --- /dev/null +++ b/gwt/3.3/src/org/json/XMLTokener.java @@ -0,0 +1,365 @@ +package org.json; + +/* +Copyright (c) 2002 JSON.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +The Software shall be used for Good, not Evil. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +/** + * The XMLTokener extends the JSONTokener to provide additional methods + * for the parsing of XML texts. + * @author JSON.org + * @version 2010-01-30 + */ +public class XMLTokener extends JSONTokener { + + + /** The table of entity values. It initially contains Character values for + * amp, apos, gt, lt, quot. + */ + public static final java.util.HashMap entity; + + static { + entity = new java.util.HashMap(8); + entity.put("amp", XML.AMP); + entity.put("apos", XML.APOS); + entity.put("gt", XML.GT); + entity.put("lt", XML.LT); + entity.put("quot", XML.QUOT); + } + + /** + * Construct an XMLTokener from a string. + * @param s A source string. + */ + public XMLTokener(String s) { + super(s); + } + + /** + * Get the text in the CDATA block. + * @return The string up to the ]]>. + * @throws JSONException If the ]]> is not found. + */ + public String nextCDATA() throws JSONException { + char c; + int i; + StringBuffer sb = new StringBuffer(); + for (;;) { + c = next(); + if (end()) { + throw syntaxError("Unclosed CDATA"); + } + sb.append(c); + i = sb.length() - 3; + if (i >= 0 && sb.charAt(i) == ']' && + sb.charAt(i + 1) == ']' && sb.charAt(i + 2) == '>') { + sb.setLength(i); + return sb.toString(); + } + } + } + + + /** + * Get the next XML outer token, trimming whitespace. There are two kinds + * of tokens: the '<' character which begins a markup tag, and the content + * text between markup tags. + * + * @return A string, or a '<' Character, or null if there is no more + * source text. + * @throws JSONException + */ + public Object nextContent() throws JSONException { + char c; + StringBuffer sb; + do { + c = next(); + } while (Character.isWhitespace(c)); + if (c == 0) { + return null; + } + if (c == '<') { + return XML.LT; + } + sb = new StringBuffer(); + for (;;) { + if (c == '<' || c == 0) { + back(); + return sb.toString().trim(); + } + if (c == '&') { + sb.append(nextEntity(c)); + } else { + sb.append(c); + } + c = next(); + } + } + + + /** + * Return the next entity. These entities are translated to Characters: + * & ' > < ". + * @param a An ampersand character. + * @return A Character or an entity String if the entity is not recognized. + * @throws JSONException If missing ';' in XML entity. + */ + public Object nextEntity(char a) throws JSONException { + StringBuffer sb = new StringBuffer(); + for (;;) { + char c = next(); + if (Character.isLetterOrDigit(c) || c == '#') { + sb.append(Character.toLowerCase(c)); + } else if (c == ';') { + break; + } else { + throw syntaxError("Missing ';' in XML entity: &" + sb); + } + } + String s = sb.toString(); + Object e = entity.get(s); + return e != null ? e : a + s + ";"; + } + + + /** + * Returns the next XML meta token. This is used for skipping over + * and structures. + * @return Syntax characters (< > / = ! ?) are returned as + * Character, and strings and names are returned as Boolean. We don't care + * what the values actually are. + * @throws JSONException If a string is not properly closed or if the XML + * is badly structured. + */ + public Object nextMeta() throws JSONException { + char c; + char q; + do { + c = next(); + } while (Character.isWhitespace(c)); + switch (c) { + case 0: + throw syntaxError("Misshaped meta tag"); + case '<': + return XML.LT; + case '>': + return XML.GT; + case '/': + return XML.SLASH; + case '=': + return XML.EQ; + case '!': + return XML.BANG; + case '?': + return XML.QUEST; + case '"': + case '\'': + q = c; + for (;;) { + c = next(); + if (c == 0) { + throw syntaxError("Unterminated string"); + } + if (c == q) { + return Boolean.TRUE; + } + } + default: + for (;;) { + c = next(); + if (Character.isWhitespace(c)) { + return Boolean.TRUE; + } + switch (c) { + case 0: + case '<': + case '>': + case '/': + case '=': + case '!': + case '?': + case '"': + case '\'': + back(); + return Boolean.TRUE; + } + } + } + } + + + /** + * Get the next XML Token. These tokens are found inside of angle + * brackets. It may be one of these characters: / > = ! ? or it + * may be a string wrapped in single quotes or double quotes, or it may be a + * name. + * @return a String or a Character. + * @throws JSONException If the XML is not well formed. + */ + public Object nextToken() throws JSONException { + char c; + char q; + StringBuffer sb; + do { + c = next(); + } while (Character.isWhitespace(c)); + switch (c) { + case 0: + throw syntaxError("Misshaped element"); + case '<': + throw syntaxError("Misplaced '<'"); + case '>': + return XML.GT; + case '/': + return XML.SLASH; + case '=': + return XML.EQ; + case '!': + return XML.BANG; + case '?': + return XML.QUEST; + +// Quoted string + + case '"': + case '\'': + q = c; + sb = new StringBuffer(); + for (;;) { + c = next(); + if (c == 0) { + throw syntaxError("Unterminated string"); + } + if (c == q) { + return sb.toString(); + } + if (c == '&') { + sb.append(nextEntity(c)); + } else { + sb.append(c); + } + } + default: + +// Name + + sb = new StringBuffer(); + for (;;) { + sb.append(c); + c = next(); + if (Character.isWhitespace(c)) { + return sb.toString(); + } + switch (c) { + case 0: + return sb.toString(); + case '>': + case '/': + case '=': + case '!': + case '?': + case '[': + case ']': + back(); + return sb.toString(); + case '<': + case '"': + case '\'': + throw syntaxError("Bad character in a name"); + } + } + } + } + + + /** + * Skip characters until past the requested string. + * If it is not found, we are left at the end of the source with a result of false. + * @param to A string to skip past. + * @throws JSONException + */ + public boolean skipPast(String to) throws JSONException { + boolean b; + char c; + int i; + int j; + int offset = 0; + int n = to.length(); + char[] circle = new char[n]; + + /* + * First fill the circle buffer with as many characters as are in the + * to string. If we reach an early end, bail. + */ + + for (i = 0; i < n; i += 1) { + c = next(); + if (c == 0) { + return false; + } + circle[i] = c; + } + /* + * We will loop, possibly for all of the remaining characters. + */ + for (;;) { + j = offset; + b = true; + /* + * Compare the circle buffer with the to string. + */ + for (i = 0; i < n; i += 1) { + if (circle[j] != to.charAt(i)) { + b = false; + break; + } + j += 1; + if (j >= n) { + j -= n; + } + } + /* + * If we exit the loop with b intact, then victory is ours. + */ + if (b) { + return true; + } + /* + * Get the next character. If there isn't one, then defeat is ours. + */ + c = next(); + if (c == 0) { + return false; + } + /* + * Shove the character in the circle buffer and advance the + * circle offset. The offset is mod n. + */ + circle[offset] = c; + offset += 1; + if (offset >= n) { + offset -= n; + } + } + } +} diff --git a/gwt/3.3/src/pubnub/api/Callback.java b/gwt/3.3/src/pubnub/api/Callback.java new file mode 100644 index 000000000..cd7d9c97e --- /dev/null +++ b/gwt/3.3/src/pubnub/api/Callback.java @@ -0,0 +1,16 @@ +package pubnub.api; + +public interface Callback { + + public abstract boolean subscribeCallback(String channel, Object message); + + public abstract boolean presenceCallback(String channel, Object message); + + public abstract void errorCallback(String channel, Object message); + + public abstract void connectCallback(String channel); + + public abstract void reconnectCallback(String channel); + + public abstract void disconnectCallback(String channel); +} diff --git a/gwt/3.3/src/pubnub/api/Pubnub.java b/gwt/3.3/src/pubnub/api/Pubnub.java new file mode 100644 index 000000000..3f1ffa9c1 --- /dev/null +++ b/gwt/3.3/src/pubnub/api/Pubnub.java @@ -0,0 +1,1419 @@ +package pubnub.api; + +import com.ning.http.client.*; +import com.ning.http.client.AsyncHttpClientConfig.Builder; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.net.URLEncoder; +import java.util.*; +import java.util.concurrent.Future; +import java.util.zip.GZIPInputStream; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.math.BigInteger; +import java.security.Key; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Iterator; + +import javax.crypto.Cipher; +import javax.crypto.CipherInputStream; +import javax.crypto.CipherOutputStream; +import javax.crypto.Mac; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +/** + * PubNub 3.2 Real-time Push Cloud API + * + * @author Stephen Blum 3.1 + * @author Leonardo Redmond 3.2 Revision + * @package pubnub.api + */ +public class Pubnub { + private String ORIGIN = "pubsub.pubnub.com"; + private String PUBLISH_KEY = ""; + private String SUBSCRIBE_KEY = ""; + private String SECRET_KEY = ""; + public String CIPHER_KEY = ""; + private boolean SSL = false; + private String sessionUUID = ""; + private String parameters = ""; + + private class ChannelStatus { + String channel; + boolean connected, first; + } + + private List subscriptions; + + /** + * PubNub 3.1 with Cipher Key + * + * Prepare PubNub State. + * + * @param String + * Publish Key. + * @param String + * Subscribe Key. + * @param String + * Secret Key. + * @param String + * Cipher Key. + * @param boolean SSL Enabled. + */ + public Pubnub(String publish_key, String subscribe_key, String secret_key, + String cipher_key, boolean ssl_on) { + this.init(publish_key, subscribe_key, secret_key, cipher_key, ssl_on); + } + + /** + * PubNub 3.0 + * + * Prepare PubNub Class State. + * + * @param String + * Publish Key. + * @param String + * Subscribe Key. + * @param String + * Secret Key. + * @param boolean SSL Enabled. + */ + public Pubnub(String publish_key, String subscribe_key, String secret_key, + boolean ssl_on) { + this.init(publish_key, subscribe_key, secret_key, "", ssl_on); + } + + /** + * PubNub 2.0 Compatibility + * + * Prepare PubNub Class State. + * + * @param String + * Publish Key. + * @param String + * Subscribe Key. + */ + public Pubnub(String publish_key, String subscribe_key) { + this.init(publish_key, subscribe_key, "", "", false); + } + + /** + * PubNub 3.0 without SSL + * + * Prepare PubNub Class State. + * + * @param String + * Publish Key. + * @param String + * Subscribe Key. + * @param String + * Secret Key. + */ + public Pubnub(String publish_key, String subscribe_key, String secret_key) { + this.init(publish_key, subscribe_key, secret_key, "", false); + } + + /** + * Init + * + * Prepare PubNub Class State. + * + * @param String + * Publish Key. + * @param String + * Subscribe Key. + * @param String + * Secret Key. + * @param String + * Cipher Key. + * @param boolean SSL Enabled. + */ + public void init(String publish_key, String subscribe_key, + String secret_key, String cipher_key, boolean ssl_on) { + this.PUBLISH_KEY = publish_key; + this.SUBSCRIBE_KEY = subscribe_key; + this.SECRET_KEY = secret_key; + this.CIPHER_KEY = cipher_key; + this.SSL = ssl_on; + + if (this.sessionUUID.equals("")) + sessionUUID = UUID.randomUUID().toString(); + // SSL On? + if (this.SSL) { + this.ORIGIN = "https://" + this.ORIGIN; + } else { + this.ORIGIN = "http://" + this.ORIGIN; + } + } + + /** + * Publish + * + * Send a message to a channel. + * + * @param String + * channel name. + * @param JSONObject + * message. + * @return JSONArray. + */ + public JSONArray publish(String channel, JSONObject message) { + HashMap args = new HashMap(2); + args.put("channel", channel); + args.put("message", message); + return publish(args); + } + + /** + * Publish + * + * Send a message to a channel. + * + * @param HashMap + * containing channel name, message. + * @return JSONArray. + */ + public JSONArray publish(HashMap args) { + + String channel = (String) args.get("channel"); + Object message = args.get("message"); + + if (message instanceof JSONObject) { + JSONObject obj = (JSONObject) message; + if (this.CIPHER_KEY.length() > 0) { + // Encrypt Message + PubnubCrypto pc = new PubnubCrypto(this.CIPHER_KEY); + message = pc.encrypt(obj); + } else { + message = obj; + } + // System.out.println(); + } else if (message instanceof String) { + String obj = (String) message; + if (this.CIPHER_KEY.length() > 0) { + // Encrypt Message + PubnubCrypto pc = new PubnubCrypto(this.CIPHER_KEY); + try { + message = pc.encrypt(obj); + } catch (Exception e) { + e.printStackTrace(); + } + } else { + message = obj; + } + message = "\"" + message + "\""; + + } else if (message instanceof JSONArray) { + JSONArray obj = (JSONArray) message; + + if (this.CIPHER_KEY.length() > 0) { + // Encrypt Message + PubnubCrypto pc = new PubnubCrypto(this.CIPHER_KEY); + message = pc.encryptJSONArray(obj); + } else { + message = obj; + } + System.out.println(); + } + + // Generate String to Sign + String signature = "0"; + + if (this.SECRET_KEY.length() > 0) { + StringBuilder string_to_sign = new StringBuilder(); + string_to_sign.append(this.PUBLISH_KEY).append('/') + .append(this.SUBSCRIBE_KEY).append('/') + .append(this.SECRET_KEY).append('/').append(channel) + .append('/').append(message.toString()); + + // Sign Message + signature = PubnubCrypto.getHMacSHA256(this.SECRET_KEY, + string_to_sign.toString()); + } + + // Build URL + List url = new ArrayList(); + url.add("publish"); + url.add(this.PUBLISH_KEY); + url.add(this.SUBSCRIBE_KEY); + url.add(signature); + url.add(channel); + url.add("0"); + url.add(message.toString()); + + return _request(url); + } + + /** + * Subscribe + * + * Listen for a message on a channel. + * + * @param String + * channel name. + * @param Callback + * function callback. + */ + public void subscribe(String channel, Callback callback) { + HashMap args = new HashMap(2); + args.put("channel", channel); + args.put("callback", callback); + subscribe(args); + } + + /** + * Subscribe + * + * Listen for a message on a channel. + * + * @param HashMap + * containing channel name, function callback. + */ + public void subscribe(HashMap args) { + args.put("timetoken", "0"); + this._subscribe(args); + } + + /** + * Subscribe - Private Interface + * + * Patch provided by petereddy on GitHub + * + * @param HashMap + * containing channel name, function callback, + * timetoken. + */ + private void _subscribe(HashMap args) { + + String channel = (String) args.get("channel"); + String timetoken = (String) args.get("timetoken"); + Callback callback; + + // Validate Arguments + if (args.get("callback") != null) { + callback = (Callback) args.get("callback"); + } else { + System.out.println("Invalid Callback."); + return; + } + + if (channel == null || channel.equals("")) { + callback.errorCallback(channel, "Invalid Channel."); + return; + } + + // Ensure Single Connection + if (subscriptions != null && subscriptions.size() > 0) { + boolean channel_exist = false; + for (ChannelStatus it : subscriptions) { + if (it.channel.equals(channel)) { + channel_exist = true; + break; + } + } + if (!channel_exist) { + ChannelStatus cs = new ChannelStatus(); + cs.channel = channel; + cs.connected = true; + subscriptions.add(cs); + } else { + callback.errorCallback(channel, "Already Connected"); + return; + } + } else { + // New Channel + ChannelStatus cs = new ChannelStatus(); + cs.channel = channel; + cs.connected = true; + subscriptions = new ArrayList(); + subscriptions.add(cs); + } + + while (true) { + try { + // Build URL + List url = java.util.Arrays.asList("subscribe", + this.SUBSCRIBE_KEY, channel, "0", timetoken); + + // Stop Connection? + boolean is_disconnect = false; + for (ChannelStatus it : subscriptions) { + if (it.channel.equals(channel)) { + if (!it.connected) { + subscriptions.remove(it); + callback.disconnectCallback(channel); + is_disconnect = true; + break; + } + } + } + if (is_disconnect) + return; + + // Wait for Message + JSONArray response = _request(url); + + // Stop Connection? + for (ChannelStatus it : subscriptions) { + if (it.channel.equals(channel)) { + if (!it.connected) { + subscriptions.remove(it); + callback.disconnectCallback(channel); + is_disconnect = true; + break; + } + } + } + + if (is_disconnect) + return; + + // Problem? + if (response == null || response.optInt(1) == 0) { + for (ChannelStatus it : subscriptions) { + if (it.channel.equals(channel)) { + if (it.connected && it.first) { + subscriptions.remove(it); + callback.disconnectCallback(channel); + } else { + subscriptions.remove(it); + callback.errorCallback(channel, + "Lost Network Connection"); + } + } + + } + // Ensure Connected (Call Time Function) + boolean is_reconnected = false; + while (true) { + double time_token = this.time(); + if (time_token == 0.0) { + + Thread.sleep(5000); + } else { + // Reconnect Callback + callback.reconnectCallback(channel); + // this._subscribe(args); + is_reconnected = true; + break; + } + } + if (is_reconnected) { + continue; + } + } else { + for (ChannelStatus it : subscriptions) { + if (it.channel.equals(channel)) { + // Connect Callback + if (!it.first) { + it.first = true; + callback.connectCallback(channel); + + break; + } + } + } + } + + JSONArray messages = response.optJSONArray(0); + + // Update TimeToken + if (response.optString(1).length() > 0) + timetoken = response.optString(1); + + for (int i = 0; messages.length() > i; i++) { + JSONObject message = messages.optJSONObject(i); + if (message != null) { + + if (this.CIPHER_KEY.length() > 0) { + // Decrypt Message + PubnubCrypto pc = new PubnubCrypto(this.CIPHER_KEY); + message = pc.decrypt(message); + } + if (callback != null) + if (!callback.subscribeCallback(channel, message)) return; + } else { + + JSONArray arr = messages.optJSONArray(i); + if (arr != null) { + if (this.CIPHER_KEY.length() > 0) { + PubnubCrypto pc = new PubnubCrypto( + this.CIPHER_KEY); + arr = pc.decryptJSONArray(arr); + ; + } + if (callback != null) + if(!callback.subscribeCallback(channel, arr)) return; + } else { + String msgs = messages.getString(0); + if (this.CIPHER_KEY.length() > 0) { + PubnubCrypto pc = new PubnubCrypto( + this.CIPHER_KEY); + msgs = pc.decrypt(msgs); + } + if (callback != null) + if(!callback.subscribeCallback(channel, msgs)) return; + } + } + } + } catch (Exception e) { + try { + Thread.sleep(1000); + } catch (InterruptedException ie) { + } + } + } + } + + /** + * Presence + * + * Listen for a message on a channel & add presence info. + * + * @param String + * channel name. + * @param Callback + * function callback. + */ + public void presence(String channel, Callback callback) { + HashMap args = new HashMap(2); + args.put("channel", channel + "-pnpres"); + args.put("callback", callback); + subscribe(args); + } + + /** + * Presence + * + * Listen for a message on a channel & add presence info. + * + * @param HashMap + * containing channel name, function callback. + */ + public void presence(HashMap args) { + args.put("timetoken", "0"); + this._presence(args); + } + + /** + * Presence - Private Interface + * + * Implemented by Leonardo Redmond on GitHub + * + * @param HashMap + * containing channel name, function callback, + * timetoken. + */ + private void _presence(HashMap args) { + + String channel = (String) args.get("channel"); + String timetoken = (String) args.get("timetoken"); + Callback callback; + + // Validate Arguments + if (args.get("callback") != null) { + callback = (Callback) args.get("callback"); + } else { + System.out.println("Invalid Callback."); + return; + } + + if (channel == null || channel.equals("")) { + callback.errorCallback(channel, "Invalid Channel."); + return; + } + + // Ensure Single Connection + if (subscriptions != null && subscriptions.size() > 0) { + boolean channel_exist = false; + for (ChannelStatus it : subscriptions) { + if (it.channel.equals(channel)) { + channel_exist = true; + break; + } + } + if (!channel_exist) { + ChannelStatus cs = new ChannelStatus(); + cs.channel = channel; + cs.connected = true; + subscriptions.add(cs); + } else { + callback.errorCallback(channel, "Already Connected"); + return; + } + } else { + // New Channel + ChannelStatus cs = new ChannelStatus(); + cs.channel = channel; + cs.connected = true; + subscriptions = new ArrayList(); + subscriptions.add(cs); + } + + while (true) { + try { + // Build URL + List url = java.util.Arrays.asList("subscribe", + this.SUBSCRIBE_KEY, channel, "0", timetoken); + + // Stop Connection? + boolean is_disconnect = false; + for (ChannelStatus it : subscriptions) { + if (it.channel.equals(channel)) { + if (!it.connected) { + subscriptions.remove(it); + callback.disconnectCallback(channel); + is_disconnect = true; + break; + } + } + } + if (is_disconnect) + return; + + // Wait for Message + JSONArray response = _request(url); + + // Stop Connection? + for (ChannelStatus it : subscriptions) { + if (it.channel.equals(channel)) { + if (!it.connected) { + subscriptions.remove(it); + callback.disconnectCallback(channel); + is_disconnect = true; + break; + } + } + } + + if (is_disconnect) + return; + + // Problem? + if (response == null || response.optInt(1) == 0) { + for (ChannelStatus it : subscriptions) { + if (it.channel.equals(channel)) { + if (it.connected && it.first) { + subscriptions.remove(it); + callback.disconnectCallback(channel); + } else { + subscriptions.remove(it); + callback.errorCallback(channel, + "Lost Network Connection"); + } + } + + } + // Ensure Connected (Call Time Function) + boolean is_reconnected = false; + while (true) { + double time_token = this.time(); + if (time_token == 0.0) { + + Thread.sleep(5000); + } else { + // Reconnect Callback + callback.reconnectCallback(channel); + // this._subscribe(args); + is_reconnected = true; + break; + } + } + if (is_reconnected) { + continue; + } + } else { + for (ChannelStatus it : subscriptions) { + if (it.channel.equals(channel)) { + // Connect Callback + if (!it.first) { + it.first = true; + callback.connectCallback(channel); + + break; + } + } + } + } + + JSONArray messages = response.optJSONArray(0); + + // Update TimeToken + if (response.optString(1).length() > 0) + timetoken = response.optString(1); + + for (int i = 0; messages.length() > i; i++) { + JSONObject message = messages.optJSONObject(i); + if (message != null) { + + if (this.CIPHER_KEY.length() > 0) { + // Decrypt Message + PubnubCrypto pc = new PubnubCrypto(this.CIPHER_KEY); + message = pc.decrypt(message); + } + if (callback != null) + if(!callback.presenceCallback(channel, message)) return; + } else { + + JSONArray arr = messages.optJSONArray(i); + if (arr != null) { + if (this.CIPHER_KEY.length() > 0) { + PubnubCrypto pc = new PubnubCrypto( + this.CIPHER_KEY); + arr = pc.decryptJSONArray(arr); + } + if (callback != null) + if (!callback.presenceCallback(channel, arr)) return; + } else { + String msgs = messages.getString(0); + if (this.CIPHER_KEY.length() > 0) { + PubnubCrypto pc = new PubnubCrypto( + this.CIPHER_KEY); + msgs = pc.decrypt(msgs); + } + if (callback != null) + if (!callback.presenceCallback(channel, msgs)) return; + } + } + } + } catch (Exception e) { + try { + Thread.sleep(1000); + } catch (InterruptedException ie) { + } + } + } + } + + /** + * Here Now + * + * Load presence information from a channel + * + * @param String channel name. + * @return JSONObject of here_now + */ + public JSONArray here_now(String channel) { + List url = new ArrayList(); + + url.add("v2"); + url.add("presence"); + url.add("sub_key"); + url.add(this.SUBSCRIBE_KEY); + url.add("channel"); + url.add(channel); + + JSONArray response = _request(url); + + if (this.CIPHER_KEY.length() > 0) { + // Decrypt Messages + PubnubCrypto pc = new PubnubCrypto(this.CIPHER_KEY); + return pc.decryptJSONArray(response); + } else { + return response; + } + } + /** + * History + * + * Load history from a channel. + * + * @param String + * channel name. + * @param int limit history count response. + * @return JSONArray of history. + */ + public JSONArray history(String channel, int limit) { + HashMap args = new HashMap(2); + args.put("channel", channel); + args.put("limit", limit); + return history(args); + } + + /** + * History + * + * Load history from a channel. + * + * @param HashMap + * containing channel name, limit history count + * response. + * @return JSONArray of history. + */ + public JSONArray history(HashMap args) { + + String channel = (String) args.get("channel"); + int limit = Integer.parseInt(args.get("limit").toString()); + + List url = new ArrayList(); + + url.add("history"); + url.add(this.SUBSCRIBE_KEY); + url.add(channel); + url.add("0"); + url.add(Integer.toString(limit)); + + JSONArray response = _request(url); + + if (this.CIPHER_KEY.length() > 0) { + // Decrypt Messages + PubnubCrypto pc = new PubnubCrypto(this.CIPHER_KEY); + return pc.decryptJSONArray(response); + } else { + return response; + } + } + + /** + * DetailedHistory + * + * DetailedHistory from PubNub Cloud. + * + * @return JSONArray of detailed history. + */ + public JSONArray detailedHistory(String channel, long start, long end, int count, Boolean reverse) { + parameters = ""; + if (count == -1) count = 100; + if (count == -1) count = 100; + parameters = "?count=" + count; + if (reverse) + parameters = parameters + "&" + "reverse=" + reverse.toString().toLowerCase(); + if (start != -1) + parameters = parameters + "&" + "start=" + Long.toString(start).toLowerCase(); + if (end != -1) + parameters = parameters + "&" + "end=" + Long.toString(end).toLowerCase(); + + List url = new ArrayList(); + url.add("v2"); + url.add("history"); + url.add("sub-key"); + url.add(this.SUBSCRIBE_KEY); + url.add("channel"); + url.add(channel); + + JSONArray response = _request(url); + + if (this.CIPHER_KEY.length() > 0) { + PubnubCrypto pc = new PubnubCrypto(this.CIPHER_KEY); + try { + return pc.decryptJSONArray(response.getJSONArray(0)); + } catch (JSONException e) { + return response; + } + } else { + return response; + } + } + + public JSONArray detailedHistory(String channel, long start, boolean reverse) { + return detailedHistory(channel, start, -1, -1, reverse); + } + + public JSONArray detailedHistory(String channel, int count) { + return detailedHistory(channel, -1, -1, count, false); + } + /** + * Time + * + * Timestamp from PubNub Cloud. + * + * @return double timestamp. + */ + public double time() { + List url = new ArrayList(); + + url.add("time"); + url.add("0"); + + JSONArray response = _request(url); + + return response.optDouble(0); + } + + /** + * UUID + * + * 32 digit UUID generation at client side. + * + * @return String uuid. + */ + public static String uuid() { + UUID uuid = UUID.randomUUID(); + return uuid.toString(); + } + + /** + * Unsubscribe + * + * Unsubscribe/Disconnect to channel. + * + * @param HashMap + * containing channel name. + */ + public void unsubscribe(HashMap args) { + String channel = (String) args.get("channel"); + for (ChannelStatus it : subscriptions) { + if (it.channel.equals(channel) && it.connected) { + it.connected = false; + it.first = false; + break; + } + } + } + + /** + * Request URL + * + * @param List + * request of url directories. + * @return JSONArray from JSON response. + */ + private JSONArray _request(List url_components) { + String json = ""; + StringBuilder url = new StringBuilder(); + Iterator url_iterator = url_components.iterator(); + String request_for = url_components.get(0); + String request_type = url_components.get(1); + + url.append(this.ORIGIN); + + // Generate URL with UTF-8 Encoding + while (url_iterator.hasNext()) { + try { + String url_bit = (String) url_iterator.next(); + url.append("/").append(_encodeURIcomponent(url_bit)); + } catch (Exception e) { + // e.printStackTrace(); + JSONArray jsono = new JSONArray(); + try { + jsono.put("Failed UTF-8 Encoding URL."); + } catch (Exception jsone) { + } + return jsono; + } + } + if (request_for.equals("subscribe") || request_for.equals("presence")) + url.append("?uuid=").append(this.sessionUUID); + if (request_for.equals("v2") && request_type.equals("history")) + url.append(parameters); + + AsyncHttpClient ahc = null; + try { + // Prepare Asynchronous HTTP Request + Builder cb = new AsyncHttpClientConfig.Builder(); + cb.setRequestTimeoutInMs(310000); + AsyncHttpClientConfig config = cb.build(); + ahc = new AsyncHttpClient(config); + RequestBuilder rb = new RequestBuilder("GET"); + rb.setUrl(url.toString()); + rb.addHeader("V", "3.1"); + rb.addHeader("User-Agent", "Java"); + rb.addHeader("Accept-Encoding", "gzip"); + Request request = rb.build(); + + // Execute Request + Future f = ahc.executeRequest(request, + new AsyncCompletionHandler() { + + @Override + public String onCompleted(Response r) throws Exception { + + String ce = r.getHeader("Content-Encoding"); + InputStream resulting_is = null; + InputStream is = r.getResponseBodyAsStream(); + + if (ce != null && ce.equalsIgnoreCase("gzip")) { + // Decoding using 'gzip' + + try { + resulting_is = new GZIPInputStream(is); + } catch (IOException e) { + resulting_is = is; + } catch (Exception e) { + resulting_is = is; + } + } else { + // Default (encoding is null OR 'identity') + resulting_is = is; + } + + String line = "", json = ""; + BufferedReader reader = new BufferedReader( + new InputStreamReader(resulting_is, "UTF8")); + + // Read JSON Message + while ((line = reader.readLine()) != null) { + json += line; + } + + reader.close(); + + return json; + } + }); + json = f.get(); + ahc.close(); + + } catch (Exception e) { + + // Response If Failed JSONP HTTP Request. + JSONArray jsono = new JSONArray(); + try { + if (request_for != null) { + if (request_for.equals("time")) { + jsono.put("0"); + } else if (request_for.equals("history")) { + jsono.put("Error: Failed JSONP HTTP Request."); + } else if (request_for.equals("publish")) { + jsono.put("0"); + jsono.put("Error: Failed JSONP HTTP Request."); + } else if (request_for.equals("subscribe")) { + jsono.put("0"); + jsono.put("0"); + } + } + } catch (Exception jsone) { + } + + if (ahc != null) { + ahc.close(); + } + return jsono; + } + + // Parse JSON String + try { + if (json.contains("uuids")) { + JSONArray resp = new JSONArray(); + resp.put(json); + return resp; + } + return new JSONArray(json); + } catch (Exception e) { + JSONArray jsono = new JSONArray(); + + try { + jsono.put("Error: Failed JSON Parsing."); + } catch (Exception jsone) { + } + + // Return Failure to Parse + return jsono; + } + } + + private String _encodeURIcomponent(String s) { + StringBuilder o = new StringBuilder(); + for (Character ch : s.toCharArray()) { + if (isUnsafe(ch)) { + o.append('%'); + o.append(toHex(ch / 16)); + o.append(toHex(ch % 16)); + } else + o.append(encodeToUTF8(ch.toString())); + } + return o.toString(); + } + + private char toHex(int ch) { + return (char) (ch < 10 ? '0' + ch : 'A' + ch - 10); + } + + private boolean isUnsafe(char ch) { + return " ~`!@#$%^&*()+=[]\\{}|;':\",./<>?".indexOf(ch) >= 0; + } + + private String encodeToUTF8(String s) { + try { + String enc = URLEncoder.encode(s, "UTF-8").replace("+", "%20"); + return enc; + } catch (UnsupportedEncodingException e) { + + } + return s; + } + +} + +class Base64Encoder { + + // Mapping table from 6-bit nibbles to Base64 characters. + private static char[] map1 = new char[64]; + static { + int i=0; + for (char c='A'; c<='Z'; c++) map1[i++] = c; + for (char c='a'; c<='z'; c++) map1[i++] = c; + for (char c='0'; c<='9'; c++) map1[i++] = c; + map1[i++] = '+'; map1[i++] = '/'; + } + + // Mapping table from Base64 characters to 6-bit nibbles. + private static byte[] map2 = new byte[128]; + static { + for (int i=0; iin. + * @return A character array with the Base64 encoded data. + */ + public static char[] encode (byte[] in, int iLen) { + int oDataLen = (iLen*4+2)/3; // output length without padding + int oLen = ((iLen+2)/3)*4; // output length including padding + char[] out = new char[oLen]; + int ip = 0; + int op = 0; + while (ip < iLen) { + int i0 = in[ip++] & 0xff; + int i1 = ip < iLen ? in[ip++] & 0xff : 0; + int i2 = ip < iLen ? in[ip++] & 0xff : 0; + int o0 = i0 >>> 2; + int o1 = ((i0 & 3) << 4) | (i1 >>> 4); + int o2 = ((i1 & 0xf) << 2) | (i2 >>> 6); + int o3 = i2 & 0x3F; + out[op++] = map1[o0]; + out[op++] = map1[o1]; + out[op] = op < oDataLen ? map1[o2] : '='; op++; + out[op] = op < oDataLen ? map1[o3] : '='; op++; } + return out; + } + + /** + * Decodes a string from Base64 format. + * + * @param s a Base64 String to be decoded. + * @return A String containing the decoded data. + * @throws IllegalArgumentException if the input is not valid Base64 encoded data. + */ + public static String decodeString (String s) { + return new String(decode(s)); + } + + /** + * Decodes a byte array from Base64 format. + * + * @param s a Base64 String to be decoded. + * @return An array containing the decoded data bytes. + * @throws IllegalArgumentException if the input is not valid Base64 encoded data. + */ + public static byte[] decode (String s) { + return decode(s.toCharArray()); + } + + /** + * Decodes a byte array from Base64 format. + * No blanks or line breaks are allowed within the Base64 encoded data. + * + * @param in a character array containing the Base64 encoded data. + * @return An array containing the decoded data bytes. + * @throws IllegalArgumentException if the input is not valid Base64 encoded data. + */ + public static byte[] decode (char[] in) { + int iLen = in.length; + if (iLen%4 != 0) throw new IllegalArgumentException ("Length of Base64 encoded input string is not a multiple of 4."); + while (iLen > 0 && in[iLen-1] == '=') iLen--; + int oLen = (iLen*3) / 4; + byte[] out = new byte[oLen]; + int ip = 0; + int op = 0; + while (ip < iLen) { + int i0 = in[ip++]; + int i1 = in[ip++]; + int i2 = ip < iLen ? in[ip++] : 'A'; + int i3 = ip < iLen ? in[ip++] : 'A'; + if (i0 > 127 || i1 > 127 || i2 > 127 || i3 > 127) + throw new IllegalArgumentException ("Illegal character in Base64 encoded data."); + int b0 = map2[i0]; + int b1 = map2[i1]; + int b2 = map2[i2]; + int b3 = map2[i3]; + if (b0 < 0 || b1 < 0 || b2 < 0 || b3 < 0) + throw new IllegalArgumentException ("Illegal character in Base64 encoded data."); + int o0 = ( b0 <<2) | (b1>>>4); + int o1 = ((b1 & 0xf)<<4) | (b2>>>2); + int o2 = ((b2 & 3)<<6) | b3; + out[op++] = (byte)o0; + if (op it = message.keys(); + + while(it.hasNext()) { + String key = it.next(); + String val = message.getString(key); + message_encrypted.put(key, encrypt(val)); + } + return message_encrypted; + + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * Decrypt + * + * @param JSONObject Encrypted message + * @return JSONObject Message decrypted + */ + @SuppressWarnings("unchecked") + public JSONObject decrypt(JSONObject message_encrypted) { + try { + JSONObject message_decrypted = new JSONObject(); + Iterator it = message_encrypted.keys(); + + while(it.hasNext()) { + String key = it.next(); + String encrypted_str = message_encrypted.getString(key); + String decrypted_str = decrypt(encrypted_str); + message_decrypted.put(key, decrypted_str); + } + return message_decrypted; + } catch(Exception e) { + throw new RuntimeException(e); + } + } + + /** + * Encrypt JSONArray + * + * @param JSONArray - Encrypted JSONArray + * @return JSONArray - Decrypted JSONArray + */ + public JSONArray encryptJSONArray(JSONArray jsona_arry) { + try { + JSONArray jsona_decrypted = new JSONArray(); + + for (int i = 0; i < jsona_arry.length(); i++) { + Object o = jsona_arry.get(i); + if(o != null) { + if(o instanceof JSONObject) { + jsona_decrypted.put(i, encrypt((JSONObject)o)); + } else if(o instanceof JSONArray) { + jsona_decrypted.put(i, encryptJSONArray((JSONArray)o)); + } else if(o instanceof String) { + jsona_decrypted.put(i, encrypt(o.toString())); + } + } + } + + return jsona_decrypted; + + } catch(Exception e) { + throw new RuntimeException(e); + } + } + + /** + * Decrypt JSONArray + * + * @param JSONArray - Encrypted JSONArray + * @return JSONArray - Decrypted JSONArray + */ + public JSONArray decryptJSONArray(JSONArray jsona_encrypted) { + try { + JSONArray jsona_decrypted = new JSONArray(); + + for (int i = 0; i < jsona_encrypted.length(); i++) { + Object o = jsona_encrypted.get(i); + if(o != null) { + if(o instanceof JSONObject) { + jsona_decrypted.put(i, decrypt((JSONObject)o)); + } else if(o instanceof JSONArray) { + jsona_decrypted.put(i, decryptJSONArray((JSONArray)o)); + } else if(o instanceof String) { + jsona_decrypted.put(i, decrypt(o.toString())); + } + } + } + + return jsona_decrypted; + + } catch(Exception e) { + throw new RuntimeException(e); + } + } + + /** + * Encrypt + * + * @param String plain text to encrypt + * @return String cipher text + * @throws Exception + */ + public String encrypt(String plain_text) throws Exception { + byte[] out = transform(true, plain_text.getBytes()); + return new String(Base64Encoder.encode(out)); + } + + /** + * Decrypt + * + * @param String cipherText + * @return String + * @throws Exception + */ + public String decrypt(String cipher_text) throws Exception { + byte[] out = transform(false, Base64Encoder.decode(cipher_text)); + return new String(out).trim(); + } + + /** + * AES Encryption + * + * @param boolean encrypt_or_decrypt ENCRYPT/DECRYPT mode + * @param ByteArray input_bytes + * @return ByteArray + * @throws Exception + */ + private byte[] transform(boolean encrypt_or_decrypt, byte[] input_bytes) throws Exception { + ByteArrayOutputStream output = new ByteArrayOutputStream(); + byte[] iv_bytes = "0123456789012345".getBytes(); + byte[] key_bytes = md5(this.CIPHER_KEY); + + SecretKeySpec key = new SecretKeySpec(key_bytes, "AES"); + IvParameterSpec ivSpec = new IvParameterSpec(iv_bytes); + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); + + if(encrypt_or_decrypt) { + cipher.init(Cipher.ENCRYPT_MODE, key, ivSpec); + ByteArrayInputStream b_in = new ByteArrayInputStream(input_bytes); + CipherInputStream c_in = new CipherInputStream(b_in, cipher); + int ch; + while ((ch = c_in.read()) >= 0) { + output.write(ch); + } + c_in.close(); + } else { + cipher.init(Cipher.DECRYPT_MODE, key, ivSpec); + CipherOutputStream c_out = new CipherOutputStream(output, cipher); + c_out.write(input_bytes); + c_out.close(); + } + return output.toByteArray(); + } + + /** + * Sign Message + * + * @param String input + * @return String as HashText + */ + public static String getHMacSHA256(String secret_key, String input) { + try { + Key KEY = new SecretKeySpec(input.getBytes("UTF-8"), "HmacSHA256"); + Mac sha256_HMAC = Mac.getInstance("HMACSHA256"); + + sha256_HMAC.init(KEY); + byte[] mac_data = sha256_HMAC.doFinal(secret_key.getBytes()); + + BigInteger number = new BigInteger(1, mac_data); + String hashtext = number.toString(16); + + return hashtext; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + /** + * Get MD5 + * @param string + * @return + */ + public static byte[] md5(String string) { + byte[] hash; + + try { + hash = MessageDigest.getInstance("MD5").digest(string.getBytes("UTF-8")); + } catch (NoSuchAlgorithmException e) { + throw new RuntimeException("MD5 should be supported!", e); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("UTF-8 should be supported!", e); + } + + StringBuilder hex = new StringBuilder(hash.length * 2); + for (byte b : hash) { + if ((b & 0xFF) < 0x10) hex.append("0"); + hex.append(Integer.toHexString(b & 0xFF)); + } + return hexStringToByteArray(hex.toString()); + } + + public static byte[] hexStringToByteArray(String s) { + int len = s.length(); + byte[] data = new byte[len / 2]; + for (int i = 0; i < len; i += 2) { + data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + + Character.digit(s.charAt(i+1), 16)); + } + return data; + } +} \ No newline at end of file diff --git a/gwt/3.3/src/pubnub/example/PubnubExample.java b/gwt/3.3/src/pubnub/example/PubnubExample.java new file mode 100644 index 000000000..602892d28 --- /dev/null +++ b/gwt/3.3/src/pubnub/example/PubnubExample.java @@ -0,0 +1,408 @@ +package src.pubnub.example; + +import java.util.HashMap; +import java.util.Iterator; + +import org.json.JSONArray; +import org.json.JSONObject; +import pubnub.api.Pubnub; +import pubnub.api.Callback; + +public class PubnubExample { + + /** + * @param params + */ + public static void main(String[] params) { + + System.out.println("\nRunning publish()"); + PublishExample(); + + System.out.println("\nRunning history()"); + HistoryExample(); + + System.out.println("\nRunning timestamp()"); + TimestampExample(); + + System.out.println("\nRunning here_now()"); + HereNowExample(); + + System.out.println("\nRunning detailedHistory()"); + DetailedHistoryExample(); + +// System.out.println("\nRunning presence()"); +// PresenceExample(); + + System.out.println("\nRunning subscribe()"); + SubscribeExample(); + + } + + private static void PublishExample() { + String publish_key = "demo"; + String subscribe_key = "demo"; + String secret_key = "demo"; + String cipher_key = "enigma"; // (Cipher key is optional) + String channel = "hello_world"; + + int publish_message_count = 1; + + Pubnub pubnub = new Pubnub( + publish_key, + subscribe_key, + secret_key, + cipher_key, + true + ); + int count = 0; + while (true) { + if (count >= publish_message_count) break; + count ++; + + // Create JSON Message + JSONObject message = new JSONObject(); + try { + message.put("text", "Hello World!" + count); + /* + * message.put("title", "Java Client PubNub"; + * message.put("some_val", "This is a push to all users! Fighting!" + * message.put("url", "http://www.pubnub.com" + */ + } catch (org.json.JSONException jsonError) { + } + + // Publish + HashMap args = new HashMap(2); + args.put("channel", channel); + args.put("message", message); + JSONArray response = null; + response = pubnub.publish(args); + System.out.println(response); + + args = new HashMap(2); + args.put("channel", channel); + args.put("message", "Hello World"); + response = pubnub.publish(args); + System.out.println(response); + + JSONArray array = new JSONArray(); + array.put("Sunday"); + array.put("Monday"); + array.put("Tuesday"); + array.put("Wednesday"); + array.put("Thursday"); + array.put("Friday"); + array.put("Saturday"); + + args = new HashMap(2); + args.put("channel", channel); + args.put("message", array); + + response = pubnub.publish(args); + System.out.println(response); + } + } + + private static void HistoryExample() { + String publish_key = "demo"; + String subscribe_key = "demo"; + String secret_key = "demo"; + String cipher_key = "enigma"; // (Cipher key is optional) + String channel = "hello_world"; + int limit = 1; + + Pubnub pubnub = new Pubnub( + publish_key, + subscribe_key, + secret_key, + cipher_key, + true + ); + + HashMap args = new HashMap(2); + args.put("channel", channel); + args.put("limit", limit); + + // Get History + JSONArray response = pubnub.history(args); + + // Print Response from PubNub JSONP REST Service + System.out.println(response); + + try { + if (response != null) { + for (int i = 0; i < response.length(); i ++) { + JSONObject jsono = response.optJSONObject(i); + if (jsono != null) { + @SuppressWarnings("rawtypes") + Iterator keys = jsono.keys(); + while (keys.hasNext()) { + System.out.println(jsono.get(keys.next().toString()) + " "); + } + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + private static void DetailedHistoryExample() { + String publish_key = "demo"; + String subscribe_key = "demo"; + String secret_key = "demo"; + String cipher_key = "enigma"; // (Cipher key is optional) + String channel = "hello_world"; + int count = 1; + + Pubnub pubnub = new Pubnub( + publish_key, + subscribe_key, + secret_key, + cipher_key, + true + ); + + // Get History + JSONArray response = pubnub.detailedHistory(channel, count); + + // Print Response from PubNub JSONP REST Service + System.out.println(response); + + try { + if (response != null) { + for (int i = 0; i < response.length(); i ++) { + JSONObject jsono = response.optJSONObject(i); + if (jsono != null) { + @SuppressWarnings("rawtypes") + Iterator keys = jsono.keys(); + while (keys.hasNext()) { + System.out.println(jsono.get(keys.next().toString()) + " "); + } + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + private static void TimestampExample() { + String publish_key = "demo"; + String subscribe_key = "demo"; + String secret_key = "demo"; + String cipher_key = ""; // (Cipher key is optional) + + Pubnub pubnub = new Pubnub( + publish_key, + subscribe_key, + secret_key, + cipher_key, + true + ); + + // Print Server Time + System.out.println("Time: " + Double.toString(pubnub.time())); + } + + private static void SubscribeExample() { + String publish_key = "demo"; + String subscribe_key = "demo"; + String secret_key = "demo"; + String cipher_key = ""; // (Cipher key is optional) + String channel = "hello_world"; + + Pubnub pubnub = new Pubnub( + publish_key, + subscribe_key, + secret_key, + cipher_key, + true + ); + + // Callback Interface when a Message is Received + class Receiver implements Callback { + + public boolean subscribeCallback(String channel, Object message) { + + try { + if (message instanceof JSONObject) { + JSONObject obj = (JSONObject) message; + @SuppressWarnings("rawtypes") + Iterator keys = obj.keys(); + while (keys.hasNext()) { + System.out.print(obj.get(keys.next().toString()) + " "); + } + System.out.println(); + } else if (message instanceof String) { + String obj = (String) message; + System.out.print(obj + " "); + System.out.println(); + } else if (message instanceof JSONArray) { + JSONArray obj = (JSONArray) message; + System.out.print(obj.toString() + " "); + System.out.println(); + } + } catch (Exception e) { + e.printStackTrace(); + } + // Continue Listening? + return true; + } + + @Override + public void errorCallback(String channel, Object message) { + System.err.println("Channel:" + channel + "-" + message.toString()); + + } + + @Override + public void connectCallback(String channel) { + System.out.println("Connected to channel :" + channel); + System.out.println("Waiting for a message from publisher ..."); + } + + @Override + public void reconnectCallback(String channel) { + System.out.println("Reconnected to channel :" + channel); + } + + @Override + public void disconnectCallback(String channel) { + System.out.println("Disconnected to channel :" + channel); + } + + @Override + public boolean presenceCallback(String channel, Object message) { + return false; + } + } + + HashMap args = new HashMap(6); + args.put("channel", channel); + args.put("callback", new Receiver()); // callback to get response + + // Listen for Messages (Subscribe) + pubnub.subscribe(args); + } + + private static void PresenceExample() { + String publish_key = "demo"; + String subscribe_key = "demo"; + String secret_key = "demo"; + String cipher_key = ""; // (Cipher key is optional) + String channel = "hello_world"; + + Pubnub pubnub = new Pubnub( + publish_key, + subscribe_key, + secret_key, + cipher_key, + true + ); + + // Callback Interface when a Message is Received + class Receiver implements Callback { + + public boolean presenceCallback(String channel, Object message) { + + try { + if (message instanceof JSONObject) { + JSONObject obj = (JSONObject) message; + @SuppressWarnings("rawtypes") + Iterator keys = obj.keys(); + while (keys.hasNext()) { + System.out.print(obj.get(keys.next().toString()) + " "); + } + System.out.println(); + } else if (message instanceof String) { + String obj = (String) message; + System.out.print(obj + " "); + System.out.println(); + } else if (message instanceof JSONArray) { + JSONArray obj = (JSONArray) message; + System.out.print(obj.toString() + " "); + System.out.println(); + } + } catch (Exception e) { + e.printStackTrace(); + } + // Continue Listening? + return true; + } + + @Override + public void errorCallback(String channel, Object message) { + System.err.println("Channel:" + channel + "-" + message.toString()); + + } + + @Override + public void connectCallback(String channel) { + System.out.println("Connected to channel :" + channel); + System.out.println("Waiting for subscribe or unsubscribe message ..."); + } + + @Override + public void reconnectCallback(String channel) { + System.out.println("Reconnected to channel :" + channel); + } + + @Override + public void disconnectCallback(String channel) { + System.out.println("Disconnected to channel :" + channel); + } + + @Override + public boolean subscribeCallback(String channel, Object message) { + return false; + } + } + + HashMap args = new HashMap(6); + args.put("channel", channel + "-pnpres"); + args.put("callback", new Receiver()); // callback to get response + + // Listen for Messages (Presence) + pubnub.presence(args); + } + + private static void HereNowExample() { + String publish_key = "demo"; + String subscribe_key = "demo"; + String secret_key = "demo"; + String cipher_key = ""; // (Cipher key is optional) + String channel = "hello_world"; + + Pubnub pubnub = new Pubnub( + publish_key, + subscribe_key, + secret_key, + cipher_key, + true + ); + + // Get Here Now + JSONArray response = pubnub.here_now(channel); + + // Print Response from PubNub JSONP REST Service + System.out.println(response); + + try { + if (response != null) { + for (int i = 0; i < response.length(); i ++) { + JSONObject jsono = response.optJSONObject(i); + if (jsono != null) { + @SuppressWarnings("rawtypes") + Iterator keys = jsono.keys(); + while (keys.hasNext()) { + System.out.println(jsono.get(keys.next().toString()) + " "); + } + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/gwt/3.3/src/pubnub/unit_test/PubnubUnitTest.java b/gwt/3.3/src/pubnub/unit_test/PubnubUnitTest.java new file mode 100644 index 000000000..c95509df9 --- /dev/null +++ b/gwt/3.3/src/pubnub/unit_test/PubnubUnitTest.java @@ -0,0 +1,550 @@ +package pubnub.unit_test; + +import static org.junit.Assert.*; + +import java.util.HashMap; +import java.util.Iterator; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.junit.Test; + +import pubnub.api.Callback; +import pubnub.api.Pubnub; + +public class PubnubUnitTest { + + private static boolean deliveryStatus = false; + private Pubnub pubnub = new Pubnub( + "demo", + "demo", + "", + "", + true + ); + private String channel = "hello_world"; + private int limit = 1; + + @Test + public void testPublishHashMapOfStringObject() { + pubnub.CIPHER_KEY = "enigma"; + JSONObject message = new JSONObject(); + try { + message.put("text", "Hello World!"); + } catch (org.json.JSONException jsonError) { + jsonError.printStackTrace(); + } + + HashMap args = new HashMap(2); + args.put("channel", channel); + args.put("message", message); + JSONArray response = null; + response = pubnub.publish(args); + + try { + assertFalse(response.get(2).toString().equals("0")); + System.out.println("PASS: TestPublish"); + } catch (JSONException e) { + fail("FAIL: TestPublish"); + } + } + + @Test + public void testSubscribeHashMapOfStringObject() { + pubnub.CIPHER_KEY = ""; + // Callback Interface when a Message is Received + class Receiver implements Callback { + + public boolean subscribeCallback(String channel, Object message) { + + try { + if (message instanceof JSONObject) { + JSONObject obj = (JSONObject) message; + @SuppressWarnings("rawtypes") + Iterator keys = obj.keys(); + while (keys.hasNext()) { + System.out.print(obj.get(keys.next().toString()) + " "); + } + System.out.println(); + } else if (message instanceof String) { + String obj = (String) message; + System.out.print(obj + " "); + System.out.println(); + } else if (message instanceof JSONArray) { + JSONArray obj = (JSONArray) message; + System.out.print(obj.toString() + " "); + System.out.println(); + } + } catch (Exception e) { + e.printStackTrace(); + } + deliveryStatus = true; + // Continue Listening? + return false; + } + + @Override + public void errorCallback(String channel, Object message) { + System.err.println("Channel:" + channel + "-" + message.toString()); + + } + + @Override + public void connectCallback(String channel) { + System.out.println("Connected to channel :" + channel); + System.out.println("Waiting for a message from publisher ..."); + } + + @Override + public void reconnectCallback(String channel) { + System.out.println("Reconnected to channel :" + channel); + } + + @Override + public void disconnectCallback(String channel) { + System.out.println("Disconnected to channel :" + channel); + } + + @Override + public boolean presenceCallback(String channel, Object message) { + return false; + } + } + + HashMap args = new HashMap(6); + args.put("channel", channel); + args.put("callback", new Receiver()); + + deliveryStatus = false; + // Listen for Messages (Subscribe) + pubnub.subscribe(args); + JSONObject json = new JSONObject(); + try { + json.put("text", "hi"); + } catch (JSONException e) { + e.printStackTrace(); + } + pubnub.publish(channel, json); + while(!deliveryStatus); + assertTrue(deliveryStatus); + System.out.println("PASS: TestSubscribe"); + } + + @Test + public void testPresenceHashMapOfStringObject() { + pubnub.CIPHER_KEY = ""; + // Callback Interface when a Message is Received + class Receiver implements Callback { + + public boolean presenceCallback(String channel, Object message) { + + try { + if (message instanceof JSONObject) { + JSONObject obj = (JSONObject) message; + @SuppressWarnings("rawtypes") + Iterator keys = obj.keys(); + while (keys.hasNext()) { + System.out.print(obj.get(keys.next().toString()) + " "); + } + System.out.println(); + } else if (message instanceof String) { + String obj = (String) message; + System.out.print(obj + " "); + System.out.println(); + } else if (message instanceof JSONArray) { + JSONArray obj = (JSONArray) message; + System.out.print(obj.toString() + " "); + System.out.println(); + } + } catch (Exception e) { + e.printStackTrace(); + } + deliveryStatus = true; + // Continue Listening? + return false; + } + + @Override + public void errorCallback(String channel, Object message) { + System.err.println("Channel:" + channel + "-" + message.toString()); + } + + @Override + public void connectCallback(String channel) { + System.out.println("Connected to channel :" + channel); + System.out.println("Waiting for subscribe or unsubscribe message ..."); + } + + @Override + public void reconnectCallback(String channel) { + System.out.println("Reconnected to channel :" + channel); + } + + @Override + public void disconnectCallback(String channel) { + System.out.println("Disconnected to channel :" + channel); + } + + @Override + public boolean subscribeCallback(String channel, Object message) { + return false; + } + } + + HashMap args = new HashMap(6); + args.put("channel", channel + "-pnpres"); + args.put("callback", new Receiver()); // callback to get response + + deliveryStatus = false; + // Listen for Messages (Presence) + pubnub.presence(args); + while(!deliveryStatus); + assertTrue(deliveryStatus); + System.out.println("PASS: TestPresence"); + } + + @Test + public void testHere_now() { + pubnub.CIPHER_KEY = ""; + // Get Here Now + JSONArray response = pubnub.here_now(channel); + + try { + assertNotNull(response); + System.out.println("PASS: TestHere_Now"); + } catch (Exception e) { + fail("FAIL: TestHere_Now"); + } + } + + @Test + public void testUnencryptedHistoryHashMapOfStringObject() { + // Context setup + pubnub.CIPHER_KEY = ""; + JSONObject message = new JSONObject(); + try { + message.put("text", "Hello World!"); + } catch (org.json.JSONException jsonError) { + jsonError.printStackTrace(); + } + + HashMap args = new HashMap(2); + args.put("channel", channel); + args.put("message", message); + JSONArray response = null; + response = pubnub.publish(args); + + // Test begins + args = new HashMap(2); + args.put("channel", channel); + args.put("limit", limit); + + // Get History + response = pubnub.history(args); + + try { + assertNotNull(response); + System.out.println("PASS: TestUnencryptedHistory"); + } catch (Exception e) { + fail("FAIL: TestUnencryptedHistory"); + } + } + + @Test + public void testEncryptedHistoryHashMapOfStringObject() { + // Context setup + pubnub.CIPHER_KEY = "enigma"; + JSONObject message = new JSONObject(); + try { + message.put("text", "Hello World!"); + } catch (org.json.JSONException jsonError) { + jsonError.printStackTrace(); + } + + HashMap args = new HashMap(2); + args.put("channel", channel); + args.put("message", message); + JSONArray response = null; + response = pubnub.publish(args); + + // Test begins + args = new HashMap(2); + args.put("channel", channel); + args.put("limit", limit); + + // Get History + response = pubnub.history(args); + + try { + assertNotNull(response); + System.out.println("PASS: TestEncryptedHistory"); + } catch (Exception e) { + fail("FAIL: TestEncryptedHistory"); + } + } + + @Test + public void testUnencryptedDetailedHistory() + { + // Context setup for Detailed History + pubnub.CIPHER_KEY = ""; + int total_msg = 10; + long starttime = (long) pubnub.time(); + HashMap inputs = new HashMap(); + for (int i = 0; i < total_msg / 2; i++) + { + String msg = Integer.toString(i); + JSONObject json = new JSONObject(); + try { + json.put("text", msg); + } catch (JSONException e) { + e.printStackTrace(); + } + pubnub.publish(channel, json); + long t = (long) pubnub.time(); + inputs.put(t, msg); + System.out.println("Message # " + Integer.toString(i) + " published"); + } + + long midtime = (long) pubnub.time(); + for (int i = total_msg / 2; i < total_msg; i++) + { + String msg = Integer.toString(i); + JSONObject json = new JSONObject(); + try { + json.put("text", msg); + } catch (JSONException e) { + e.printStackTrace(); + } + pubnub.publish(channel, json); + long t = (long) pubnub.time(); + inputs.put(t, msg); + System.out.println("Message # " + Integer.toString(i) + " published"); + } + + long endtime = (long)pubnub.time(); + + // Get History + JSONArray response = pubnub.detailedHistory(channel, total_msg); + + // Print Response from PubNub JSONP REST Service + System.out.println(response); + + try { + assertNotNull(response); + System.out.println("PASS: TestUnencryptedDetailedHistory"); + } catch (Exception e) { + fail("FAIL: TestUnencryptedDetailedHistory"); + } + } + + @Test + public void testEncryptedDetailedHistory() + { + // Context setup for Detailed History + pubnub.CIPHER_KEY = "enigma"; + int total_msg = 10; + long starttime = (long) pubnub.time(); + HashMap inputs = new HashMap(); + for (int i = 0; i < total_msg / 2; i++) + { + String msg = Integer.toString(i); + JSONObject json = new JSONObject(); + try { + json.put("text", msg); + } catch (JSONException e) { + e.printStackTrace(); + } + pubnub.publish(channel, json); + long t = (long) pubnub.time(); + inputs.put(t, msg); + System.out.println("Message # " + Integer.toString(i) + " published"); + } + + long midtime = (long) pubnub.time(); + for (int i = total_msg / 2; i < total_msg; i++) + { + String msg = Integer.toString(i); + JSONObject json = new JSONObject(); + try { + json.put("text", msg); + } catch (JSONException e) { + e.printStackTrace(); + } + pubnub.publish(channel, json); + long t = (long) pubnub.time(); + inputs.put(t, msg); + System.out.println("Message # " + Integer.toString(i) + " published"); + } + + long endtime = (long)pubnub.time(); + + // Get History + JSONArray response = pubnub.detailedHistory(channel, total_msg); + + // Print Response from PubNub JSONP REST Service + System.out.println(response); + + try { + assertNotNull(response); + System.out.println("PASS: TestEncryptedDetailedHistory"); + } catch (Exception e) { + fail("FAIL: TestEncryptedDetailedHistory"); + } + } + + @Test + public void testUnencryptedDetailedHistoryParams() + { + // Context setup for Detailed History + pubnub.CIPHER_KEY = ""; + int total_msg = 10; + long starttime = (long) pubnub.time(); + HashMap inputs = new HashMap(); + for (int i = 0; i < total_msg / 2; i++) + { + String msg = Integer.toString(i); + JSONObject json = new JSONObject(); + try { + json.put("text", msg); + } catch (JSONException e) { + e.printStackTrace(); + } + pubnub.publish(channel, json); + long t = (long) pubnub.time(); + inputs.put(t, msg); + System.out.println("Message # " + Integer.toString(i) + " published"); + } + + long midtime = (long) pubnub.time(); + for (int i = total_msg / 2; i < total_msg; i++) + { + String msg = Integer.toString(i); + JSONObject json = new JSONObject(); + try { + json.put("text", msg); + } catch (JSONException e) { + e.printStackTrace(); + } + pubnub.publish(channel, json); + long t = (long) pubnub.time(); + inputs.put(t, msg); + System.out.println("Message # " + Integer.toString(i) + " published"); + } + + long endtime = (long)pubnub.time(); + + // Get History + JSONArray response; + System.out.println("DetailedHistory with start & end"); + response = pubnub.detailedHistory(channel, starttime, midtime, total_msg / 2, true); + System.out.println(response); + try { + assertNotNull(response); + } catch (Exception e) { + fail("FAIL: TestUnencryptedDetailedHistoryParams"); + } + + System.out.println("DetailedHistory with start & reverse = true"); + response = pubnub.detailedHistory(channel, midtime, -1, total_msg / 2, true); + System.out.println(response); + try { + assertNotNull(response); + } catch (Exception e) { + fail("FAIL: TestUnencryptedDetailedHistoryParams"); + } + + System.out.println("DetailedHistory with start & reverse = false"); + response = pubnub.detailedHistory(channel, midtime, -1, total_msg / 2, false); + System.out.println(response); + try { + assertNotNull(response); + System.out.println("PASS: TestUnencryptedDetailedHistoryParams"); + } catch (Exception e) { + fail("FAIL: TestUnencryptedDetailedHistoryParams"); + } + } + + @Test + public void testEncryptedDetailedHistoryParams() + { + // Context setup for Detailed History + pubnub.CIPHER_KEY = "enigma"; + int total_msg = 10; + long starttime = (long) pubnub.time(); + HashMap inputs = new HashMap(); + for (int i = 0; i < total_msg / 2; i++) + { + String msg = Integer.toString(i); + JSONObject json = new JSONObject(); + try { + json.put("text", msg); + } catch (JSONException e) { + e.printStackTrace(); + } + pubnub.publish(channel, json); + long t = (long) pubnub.time(); + inputs.put(t, msg); + System.out.println("Message # " + Integer.toString(i) + " published"); + } + + long midtime = (long) pubnub.time(); + for (int i = total_msg / 2; i < total_msg; i++) + { + String msg = Integer.toString(i); + JSONObject json = new JSONObject(); + try { + json.put("text", msg); + } catch (JSONException e) { + e.printStackTrace(); + } + pubnub.publish(channel, json); + long t = (long) pubnub.time(); + inputs.put(t, msg); + System.out.println("Message # " + Integer.toString(i) + " published"); + } + + long endtime = (long)pubnub.time(); + + // Get History + JSONArray response; + System.out.println("DetailedHistory with start & end"); + response = pubnub.detailedHistory(channel, starttime, midtime, total_msg / 2, true); + System.out.println(response); + try { + assertNotNull(response); + } catch (Exception e) { + fail("FAIL: TestEncryptedDetailedHistoryParams"); + } + + System.out.println("DetailedHistory with start & reverse = true"); + response = pubnub.detailedHistory(channel, midtime, -1, total_msg / 2, true); + System.out.println(response); + try { + assertNotNull(response); + } catch (Exception e) { + fail("FAIL: TestEncryptedDetailedHistoryParams"); + } + + System.out.println("DetailedHistory with start & reverse = false"); + response = pubnub.detailedHistory(channel, midtime, -1, total_msg / 2, false); + System.out.println(response); + try { + assertNotNull(response); + System.out.println("PASS: TestEncryptedDetailedHistoryParams"); + } catch (Exception e) { + fail("FAIL: TestEncryptedDetailedHistoryParams"); + } + } + + @Test + public void testTime() { + assertNotNull(pubnub.time()); + } + + @Test + public void testUuid() { + assertNotNull(Pubnub.uuid()); + } +} diff --git a/gwt/3.3/src/pubnub/unit_test/PubnubUnitTestRunner.java b/gwt/3.3/src/pubnub/unit_test/PubnubUnitTestRunner.java new file mode 100644 index 000000000..99c4d0e19 --- /dev/null +++ b/gwt/3.3/src/pubnub/unit_test/PubnubUnitTestRunner.java @@ -0,0 +1,24 @@ +package pubnub.unit_test; + +import org.junit.runner.JUnitCore; +import org.junit.runner.Result; +import org.junit.runner.notification.Failure; + +public class PubnubUnitTestRunner { + + public static void main(String[] args) { + Result result = JUnitCore.runClasses(PubnubUnitTest.class); + for (Failure failure : result.getFailures()) { + System.out.println(failure.toString()); + } + if (result.getFailureCount() != 0) + { + System.out.println("Pubnub Unit Test Failed: # of failures - " + result.getFailureCount()); + } + else + { + System.out.println("Pubnub Unit Test Completed Successfully."); + } + } + +} diff --git a/gwt/3.3/test/PubnubExample.jar b/gwt/3.3/test/PubnubExample.jar new file mode 100644 index 000000000..883d76008 Binary files /dev/null and b/gwt/3.3/test/PubnubExample.jar differ diff --git a/gwt/3.3/test/PubnubUnitTest.jar b/gwt/3.3/test/PubnubUnitTest.jar new file mode 100644 index 000000000..624380e87 Binary files /dev/null and b/gwt/3.3/test/PubnubUnitTest.jar differ diff --git a/gwt/README.md b/gwt/README.md new file mode 100644 index 000000000..7aeca6160 --- /dev/null +++ b/gwt/README.md @@ -0,0 +1,15 @@ +##### YOU MUST HAVE A PUBNUB ACCOUNT TO USE THE API. +##### http://www.pubnub.com/account + +## PubNub 3.3 Real-time Cloud Push API - GWT + +www.pubnub.com - PubNub Real-time Push Service in the Cloud. +http://www.pubnub.com/tutorial/java-push-api + +Please reference the unit-tests and examples for usage on basic functionality, +including presence(), here_now(), and detailedHistory(). + +To run the example app, copy the pubnubexample.war in gwt/3.3/examples/PubnubExample/ to the webapps dir of tomcat, +and restart tomcat. Then visit :/pubnubexample/PubnubExample.html + +You can find a running demo of the example app running here: http://geremy.pubnub.com:8080/pubnubexample/PubnubExample.html \ No newline at end of file diff --git a/j2me/Pubnub-MicroEdition-3.5.1.jar b/j2me/Pubnub-MicroEdition-3.5.1.jar new file mode 100644 index 000000000..d43aae951 Binary files /dev/null and b/j2me/Pubnub-MicroEdition-3.5.1.jar differ diff --git a/j2me/Pubnub-MicroEdition-3.6.0.jar b/j2me/Pubnub-MicroEdition-3.6.0.jar new file mode 100644 index 000000000..5f8be3884 Binary files /dev/null and b/j2me/Pubnub-MicroEdition-3.6.0.jar differ diff --git a/j2me/Pubnub-MicroEdition-3.6.1.jar b/j2me/Pubnub-MicroEdition-3.6.1.jar new file mode 100644 index 000000000..644c039f1 Binary files /dev/null and b/j2me/Pubnub-MicroEdition-3.6.1.jar differ diff --git a/j2me/Pubnub-MicroEdition-3.6.2.jar b/j2me/Pubnub-MicroEdition-3.6.2.jar new file mode 100644 index 000000000..579c93ada Binary files /dev/null and b/j2me/Pubnub-MicroEdition-3.6.2.jar differ diff --git a/j2me/Pubnub-MicroEdition-3.6.3.jar b/j2me/Pubnub-MicroEdition-3.6.3.jar new file mode 100644 index 000000000..cb39b9df1 Binary files /dev/null and b/j2me/Pubnub-MicroEdition-3.6.3.jar differ diff --git a/j2me/Pubnub-MicroEdition-3.7.0.jar b/j2me/Pubnub-MicroEdition-3.7.0.jar new file mode 100644 index 000000000..94678b3f8 Binary files /dev/null and b/j2me/Pubnub-MicroEdition-3.7.0.jar differ diff --git a/j2me/Pubnub-MicroEdition-3.8.0.jar b/j2me/Pubnub-MicroEdition-3.8.0.jar new file mode 100644 index 000000000..ce7a882d1 Binary files /dev/null and b/j2me/Pubnub-MicroEdition-3.8.0.jar differ diff --git a/j2me/Pubnub-MicroEdition-3.8.1.jar b/j2me/Pubnub-MicroEdition-3.8.1.jar new file mode 100644 index 000000000..3be2504d3 Binary files /dev/null and b/j2me/Pubnub-MicroEdition-3.8.1.jar differ diff --git a/j2me/Pubnub-MicroEdition-3.9.0.jar b/j2me/Pubnub-MicroEdition-3.9.0.jar new file mode 100644 index 000000000..a2dd13f26 Binary files /dev/null and b/j2me/Pubnub-MicroEdition-3.9.0.jar differ diff --git a/j2me/Pubnub-MicroEdition-4.0.0.jar b/j2me/Pubnub-MicroEdition-4.0.0.jar new file mode 100644 index 000000000..c7802d8fc Binary files /dev/null and b/j2me/Pubnub-MicroEdition-4.0.0.jar differ diff --git a/j2me/Pubnub-MicroEdition-5.0.0.jar b/j2me/Pubnub-MicroEdition-5.0.0.jar new file mode 100644 index 000000000..61234d932 Binary files /dev/null and b/j2me/Pubnub-MicroEdition-5.0.0.jar differ diff --git a/j2me/README.md b/j2me/README.md new file mode 100644 index 000000000..4ca16bef8 --- /dev/null +++ b/j2me/README.md @@ -0,0 +1,247 @@ +## PubNub 3.3 Real-time Cloud Push API - J2ME +### YOU MUST HAVE A PUBNUB ACCOUNT TO USE THE API. +### http://www.pubnub.com/account + +PubNub is a Massively Scalable Real-time Service for Web and Mobile Games. +This is a cloud-based service for broadcasting Real-time messages +to thousands of web and mobile clients simultaneously. + +#### Example configuration + +-Project tested on Netbeans 7 IDE and Java ME SDK 3.0 Device Manager +-Device Configuration - CLDC-1.1 +-Device Profile - MIDP-2.0 + + +####Init + +```java + Pubnub pubnub = new Pubnub( + "demo", // PUBLISH_KEY + "demo", // SUBSCRIBE_KEY + "", // SECRET_KEY + "", // CIPHER_KEY (optional) + false // SSL_ON? + ); +``` + + +####Callback +Set Callback when pubnub object create. +```java + public interface Callback { + public abstract void publishCallback(String channel,Object message,Object responce); + public abstract void subscribeCallback(String channel,Object message); + public abstract void historyCallback(String channel,Object message); + public abstract void errorCallback(String channel, Object message); + public abstract void connectCallback(String channel); + public abstract void reconnectCallback(String channel); + public abstract void disconnectCallback(String channel); + public abstract void hereNowCallback(String channel,Object message); + public abstract void presenceCallback(String channel,Object message); + public abstract void detailedHistoryCallback(String channel,Object message); + } +``` +####Publish + +```java + try { + // Create JSON Message + JSONObject message = new JSONObject(); + // Create Hashtable parameter + message.put("some_key", "Hello World!"); + + Hashtable args = new Hashtable(2); + args.put("channel", "hello_world"); // Channel Name + args.put("message", message); // JSON Message + _pubnub.publish(args); + + } catch (JSONException ex) { + ex.printStackTrace(); + } +``` +Pass result to Publish Callback + +```java + public void publishCallback(String channel, Object message, Object response) { + JSONArray meg = (JSONArray) response; + System.out.println("Message sent response:" + message.toString() + + " on channel:" + channel); + try { + int success = Integer.parseInt(meg.get(0).toString()); + if (success == 1) { + stringItem.setLabel("Publish"); + stringItem.setText("Message sent successfully on channel:" + + channel + "\n" + message.toString()); + } else { + stringItem.setLabel("Publish"); + stringItem.setText("Message sent failure on channel:" + channel + + "\n" + message.toString()); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } +``` + +####Subscribe + +```java + // Callback Interface when a Message is Received + public void subscribeCallback(String channel, Object message) { + System.out.println("Message recevie on channel:" + channel + + " Message:" + message.toString()); + try { + if (message instanceof JSONObject) { + JSONObject obj = (JSONObject) message; + Alert a = new Alert("Received", obj.toString(), null, null); + a.setTimeout(Alert.FOREVER); + getDisplay().setCurrent(a, form); + + Enumeration keys = obj.keys(); + while (keys.hasMoreElements()) { + System.out.println(obj.get(keys.nextElement().toString()) + + " "); + } + + } else if (message instanceof String) { + String obj = (String) message; + System.out.print(obj + " "); + System.out.println(); + + Alert a = new Alert("Received", obj.toString(), null, null); + a.setTimeout(Alert.FOREVER); + getDisplay().setCurrent(a, form); + } else if (message instanceof JSONArray) { + JSONArray obj = (JSONArray) message; + System.out.print(obj.toString() + " "); + System.out.println(); + + Alert a = new Alert("Received", obj.toString(), null, null); + a.setTimeout(Alert.FOREVER); + getDisplay().setCurrent(a, form); + } + } catch (Exception e) { + e.printStackTrace(); + } + + } + + // Callback Interface when a channel is connected + public void connectCallback(String channel) { + System.out.println("Connect channel:" + channel); + } + + // Callback Interface when a channel is reconnected + public void reconnectCallback(String channel) { + System.out.println("Reconnect channel:" + channel); + } + + // Callback Interface when a channel is disconnected + public void disconnectCallback(String channel) { + System.out.println("Disconnect channel:" + channel); + } + + // Callback Interface when error occurs + public void errorCallback(String channel, Object message) { + System.out.println("Error on channel:" + channel + " Message:" + message.toString()); + } + + Hashtable args = new Hashtable(6); + args.put("channel", "hello_world"); + // Listen for Messages (Subscribe) + _pubnub.subscribe(args); + +``` + +####History +###DEPRECATED! Please use / migrate existing to detailedHistory() (see below) + +```java + // Create HashMap parameter + Hashtable args = new Hashtable(2); + args.put("channel", "hello_world"); + args.put("limit", new Integer(2)); // Limit + + // Get History + _pubnub.history(args); + + public void historyCallback(String channel, Object message) { + JSONArray meg = (JSONArray) message; + System.out.println("History recevie on channel:" + channel + " Message:" + meg.toString()); + + stringItem.setLabel("History"); + stringItem.setText("History recevie on channel:" + channel + "\n" + meg.toString()); + } +``` + +####Detailed History +Retrieve published messages. +#####Required Parameters +'channel'- Channel name +#####Options Parameters +######'start'- Start timetoken +######'end'- End timetoken +######'reverse'- false = oldest first (default), true = newest first +######'count'-Number of History messages. Defaults to 100. + +```java + Hashtable args = new Hashtable(); + args.put("channel", Channel); + args.put("count", 2+""); + _pubnub.detailedHistory(args); + + //Callback + public void detailedHistoryCallback(String channel, Object message) { + stringItem.setLabel("DetailedHistory"); + stringItem.setText("channel:" + channel + "\n" + message); + } +``` + + +####Unsubscribe + +```java + // Create Hashtable parameter + Hashtable args = new Hashtable(1); + String channel = "hello_world"; + args.put("channel", channel); + _pubnub.unsubscribe(args); +``` + +####Time + +```java + // Get server time + long time = pubnub.time(); + System.out.println("Time : "+time); +``` + +####here_now + +```java + // Who is currently on the channel? + Hashtable args = new Hashtable(); + args.put("channel", channel); + pubnub.here_now(args); + + + + public void hereNowCallback(String channel, Object message) { + stringItem.setLabel("HereNow"); + stringItem.setText("HereNow on channel:" + channel + "\n" + message.toString()); + } +``` + + +#### Presence +Join a subscriber list on a channel. Callback events can be, Join - Shows availability on a channel or Leave - Disconnected to channel means removed from the list of subscribers. +```java + _pubnub.presence(Channel); + + //Callback + public void presenceCallback(String channel, Object message) { + stringItem.setLabel("Presence"); + stringItem.setText("channel:" + channel + "\n" + message.toString()); + } +``` \ No newline at end of file diff --git a/j2me/build.xml b/j2me/build.xml new file mode 100644 index 000000000..bd786d47e --- /dev/null +++ b/j2me/build.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/j2me/examples/PubnubExample/PubnubExample.jad b/j2me/examples/PubnubExample/PubnubExample.jad new file mode 100644 index 000000000..e121143eb --- /dev/null +++ b/j2me/examples/PubnubExample/PubnubExample.jad @@ -0,0 +1,8 @@ +MIDlet-1: PubnubExample,,com.pubnub.examples.me.PubnubExample +MIDlet-Jar-Size: 133733 +MIDlet-Jar-URL: PubnubExample.jar +MIDlet-Name: PubnubExample MIDlet Suite +MIDlet-Vendor: MIDlet Suite Vendor +MIDlet-Version: 1.0.0 +MicroEdition-Configuration: CLDC-1.1 +MicroEdition-Profile: MIDP-2.0 diff --git a/j2me/examples/PubnubExample/PubnubExample.jar b/j2me/examples/PubnubExample/PubnubExample.jar new file mode 100644 index 000000000..b68cb9475 Binary files /dev/null and b/j2me/examples/PubnubExample/PubnubExample.jar differ diff --git a/j2me/examples/PubnubExample/src/com/pubnub/examples/me/DetailedHistory.java b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/DetailedHistory.java new file mode 100644 index 000000000..7c518ddf8 --- /dev/null +++ b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/DetailedHistory.java @@ -0,0 +1,58 @@ +package com.pubnub.examples.me; + +import java.util.Hashtable; + +import javax.microedition.lcdui.ChoiceGroup; +import javax.microedition.lcdui.Command; +import javax.microedition.lcdui.CommandListener; +import javax.microedition.lcdui.Display; +import javax.microedition.lcdui.Displayable; +import javax.microedition.lcdui.Form; +import javax.microedition.lcdui.TextField; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class DetailedHistory extends PubnubCommand { + + public DetailedHistory(Pubnub pubnub, Display display, Form menu) { + super(pubnub, display, menu, "Detailed History"); + } + + protected void initForm() { + final TextField txtChannel = new TextField("Channel : ", "", 255, TextField.ANY); + final TextField txtCount = new TextField("Count : ", "1", 10, TextField.NUMERIC); + final ChoiceGroup cg = new ChoiceGroup("Reverse?",ChoiceGroup.EXCLUSIVE); + cg.append("Yes", null); + cg.append("No", null); + + form = new Form("History"); + form.append(txtChannel); + form.append(txtCount); + form.append(cg); + form.addCommand(new Command("Get History", Command.OK, 2)); + + form.setCommandListener(new CommandListener() { + public void commandAction(Command arg0, Displayable arg1) { + + + _pubnub.detailedHistory(txtChannel.getString(), + Integer.parseInt(txtCount.getString()), + cg.isSelected(0)?true:false, + new Callback() { + public void successCallback(String channel, Object message) { + notifyUser(message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(channel + " : " + message.toString()); + } + }); + display.setCurrent(menu); + + }}); + + + } + +} diff --git a/j2me/examples/PubnubExample/src/com/pubnub/examples/me/DisconnectAndResubscribe.java b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/DisconnectAndResubscribe.java new file mode 100644 index 000000000..d1beb95f5 --- /dev/null +++ b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/DisconnectAndResubscribe.java @@ -0,0 +1,21 @@ +package com.pubnub.examples.me; + +import javax.microedition.lcdui.Display; +import javax.microedition.lcdui.Form; + +import com.pubnub.api.Pubnub; + +public class DisconnectAndResubscribe extends PubnubCommand { + + public DisconnectAndResubscribe(Pubnub pubnub, Display display, Form menu) { + super(pubnub, display, menu, "Disconnect & Resub"); + } + + public void handler() { + _pubnub.disconnectAndResubscribe(); + } + protected void initForm() { + + } + +} diff --git a/j2me/examples/PubnubExample/src/com/pubnub/examples/me/HereNow.java b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/HereNow.java new file mode 100644 index 000000000..eb59824ee --- /dev/null +++ b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/HereNow.java @@ -0,0 +1,42 @@ +package com.pubnub.examples.me; + +import javax.microedition.lcdui.Command; +import javax.microedition.lcdui.CommandListener; +import javax.microedition.lcdui.Display; +import javax.microedition.lcdui.Displayable; +import javax.microedition.lcdui.Form; +import javax.microedition.lcdui.TextField; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class HereNow extends PubnubCommand { + + public HereNow(Pubnub pubnub, Display display, Form menu) { + super(pubnub, display, menu,"Here Now"); + } + + protected void initForm() { + final TextField txtChannel = new TextField("Channel: ", "", 255, TextField.ANY); + form = new Form("Here Now"); + form.append(txtChannel); + form.addCommand(new Command("Here Now", Command.OK, 2)); + + form.setCommandListener(new CommandListener() { + public void commandAction(Command arg0, Displayable arg1) { + _pubnub.hereNow(txtChannel.getString(), new Callback() { + public void successCallback(String channel, Object message) { + notifyUser(message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(channel + " : " + message.toString()); + } + }); + display.setCurrent(menu); + + }}); + + } + +} diff --git a/j2me/examples/PubnubExample/src/com/pubnub/examples/me/History.java b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/History.java new file mode 100644 index 000000000..b68b711f5 --- /dev/null +++ b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/History.java @@ -0,0 +1,44 @@ +package com.pubnub.examples.me; + +import javax.microedition.lcdui.Command; +import javax.microedition.lcdui.CommandListener; +import javax.microedition.lcdui.Display; +import javax.microedition.lcdui.Displayable; +import javax.microedition.lcdui.Form; +import javax.microedition.lcdui.TextField; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class History extends PubnubCommand { + + public History(Pubnub pubnub, Display display, Form menu) { + super(pubnub, display, menu, "History"); + } + + protected void initForm() { + final TextField txtChannel = new TextField("Channel : ", "", 255, TextField.ANY); + final TextField txtCount = new TextField("Count : ", "", 10, TextField.NUMERIC); + form = new Form("History"); + form.append(txtChannel); + form.append(txtCount); + form.addCommand(new Command("Get History", Command.OK, 2)); + + form.setCommandListener(new CommandListener() { + public void commandAction(Command arg0, Displayable arg1) { + _pubnub.history(txtChannel.getString(), Integer.parseInt(txtCount.getString()), new Callback() { + public void successCallback(String channel, Object message) { + notifyUser(message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(channel + " : " + message.toString()); + } + }); + display.setCurrent(menu); + + }}); + + } + +} diff --git a/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Presence.java b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Presence.java new file mode 100644 index 000000000..b090bd273 --- /dev/null +++ b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Presence.java @@ -0,0 +1,49 @@ +package com.pubnub.examples.me; + +import java.util.Hashtable; + +import javax.microedition.lcdui.Command; +import javax.microedition.lcdui.CommandListener; +import javax.microedition.lcdui.Display; +import javax.microedition.lcdui.Displayable; +import javax.microedition.lcdui.Form; +import javax.microedition.lcdui.TextField; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class Presence extends PubnubCommand { + + public Presence(Pubnub pubnub, Display display, Form menu) { + super(pubnub, display, menu, "Presence"); + } + + protected void initForm() { + final TextField txtChannel = new TextField("Channel: ", "", 255, TextField.ANY); + form = new Form("Subscribe"); + form.append(txtChannel); + form.addCommand(new Command("Subscribe", Command.OK, 2)); + + form.setCommandListener(new CommandListener() { + public void commandAction(Command arg0, Displayable arg1) { + + try { + _pubnub.presence(txtChannel.getString(), new Callback() { + public void successCallback(String channel, Object message) { + notifyUser("Channel " + channel + " : " + message.toString()); + } + public void errorCallback(String channel, Object message) { + notifyUser("Channel " + channel + " : " + message.toString()); + } + }); + display.setCurrent(menu); + + } catch (Exception e) { + + } + + }}); + + } + +} diff --git a/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Publish.java b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Publish.java new file mode 100644 index 000000000..ad1617d6c --- /dev/null +++ b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Publish.java @@ -0,0 +1,63 @@ +package com.pubnub.examples.me; + +import java.util.Hashtable; + +import javax.microedition.lcdui.Command; +import javax.microedition.lcdui.CommandListener; +import javax.microedition.lcdui.Display; +import javax.microedition.lcdui.Displayable; +import javax.microedition.lcdui.Form; +import javax.microedition.lcdui.TextField; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; +import com.pubnub.api.PubnubException; + +import org.json.me.JSONException; +import org.json.me.JSONObject; + +public class Publish extends PubnubCommand { + + + public Publish(Pubnub pubnub, Display display, Form menu) { + super(pubnub, display,menu, "Publish"); + cmd = new Command("Publish", Command.ITEM, 0); + } + + protected void initForm() { + final TextField txtChannel = new TextField("Channel: ", "", 255, TextField.ANY); + final TextField txtMessage = new TextField("Message: ", "", 255, TextField.ANY); + form = new Form("Publish"); + form.append(txtChannel); + form.append(txtMessage); + form.addCommand(new Command("Publish", Command.OK, 2)); + + form.setCommandListener(new CommandListener() { + public void commandAction(Command arg0, Displayable arg1) { + try { + JSONObject message = new JSONObject(); + message.put("message", txtMessage.getString()); + + Hashtable args = new Hashtable(2); + args.put("channel", txtChannel.getString()); // Channel Name + args.put("message", message); // JSON Message + _pubnub.publish(args, new Callback() { + public void successCallback(String channel, Object message) { + notifyUser(message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(channel + " : " + message.toString()); + } + }); + display.setCurrent(menu); + + } catch (JSONException ex) { + + } + + }}); + + } + +} diff --git a/j2me/examples/PubnubExample/src/com/pubnub/examples/me/PubnubCommand.java b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/PubnubCommand.java new file mode 100644 index 000000000..9683fb0a5 --- /dev/null +++ b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/PubnubCommand.java @@ -0,0 +1,76 @@ +package com.pubnub.examples.me; + +import java.util.Enumeration; + +import javax.microedition.lcdui.Alert; +import javax.microedition.lcdui.Command; +import javax.microedition.lcdui.CommandListener; +import javax.microedition.lcdui.Display; +import javax.microedition.lcdui.Form; + +import org.json.me.JSONArray; +import org.json.me.JSONObject; + +import com.pubnub.api.Pubnub; + +public abstract class PubnubCommand { + + protected Display display; + protected Form menu; + protected Form form; + protected Pubnub _pubnub; + + protected Command cmd; + + + protected abstract void initForm(); + + public PubnubCommand(Pubnub pubnub, Display display, Form menu, String command) { + this.display = display; + this.menu = menu; + this._pubnub = pubnub; + this.cmd = new Command(command, Command.ITEM, 0); + } + + public void notifyUser(Object message) { + try { + if (message instanceof JSONObject) { + JSONObject obj = (JSONObject) message; + Alert a = new Alert("Received", obj.toString(), null, null); + a.setTimeout(Alert.FOREVER); + display.setCurrent(a, menu); + + Enumeration keys = obj.keys(); + while (keys.hasMoreElements()) { + } + + } else if (message instanceof String) { + String obj = (String) message; + Alert a = new Alert("Received", obj.toString(), null, null); + a.setTimeout(Alert.FOREVER); + display.setCurrent(a, menu); + } else if (message instanceof JSONArray) { + JSONArray obj = (JSONArray) message; + Alert a = new Alert("Received", obj.toString(), null, null); + a.setTimeout(Alert.FOREVER); + display.setCurrent(a, menu); + } + } catch (Exception e) { + + } + + } + + public void handler() { + + if (form == null) + initForm(); + display.setCurrent(form); + + } + + public Command getCommand() { + return cmd; + } + +} diff --git a/j2me/examples/PubnubExample/src/com/pubnub/examples/me/PubnubDemoConsole.java b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/PubnubDemoConsole.java new file mode 100644 index 000000000..a62c56ccb --- /dev/null +++ b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/PubnubDemoConsole.java @@ -0,0 +1,106 @@ +package com.pubnub.examples.me; + +import javax.microedition.midlet.MIDlet; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; +import com.pubnub.api.PubnubException; + +import java.util.Enumeration; +import java.util.Hashtable; +import javax.microedition.lcdui.*; + +import org.json.me.JSONArray; +import org.json.me.JSONException; +import org.json.me.JSONObject; + +public class PubnubDemoConsole extends MIDlet { + + private boolean midletPaused = false; + + Pubnub _pubnub; + Display display; + + PubnubMenu menu; + + public PubnubDemoConsole() { + } + + + + + +private void init() { + _pubnub = new Pubnub("demo", "demo", "demo", false); + display = Display.getDisplay(this); + menu = new PubnubMenu(_pubnub, display, this); + +} + +/** + * Performs an action assigned to the Mobile Device - MIDlet Started point. + */ +public void startMIDlet() { + init(); + switchDisplayable(null, menu.getMenu()); + _pubnub.setResumeOnReconnect(true); +} + +/** + * Performs an action assigned to the Mobile Device - MIDlet Resumed point. + */ +public void resumeMIDlet() { +} + +public void switchDisplayable(Alert alert, Displayable nextDisplayable) { + Display display = this.display; + if (alert == null) { + display.setCurrent(nextDisplayable); + } else { + display.setCurrent(alert, nextDisplayable); + } +} + +/** + * Exits MIDlet. + */ +public void exitMIDlet() { + switchDisplayable(null, null); + destroyApp(true); + notifyDestroyed(); +} + +/** + * Called when MIDlet is started. Checks whether the MIDlet have been + * already started and initialize/starts or resumes the MIDlet. + */ +public void startApp() { + + if (midletPaused) { + resumeMIDlet(); + } else { + + startMIDlet(); + } + midletPaused = false; +} + +/** + * Called when MIDlet is paused. + */ +public void pauseApp() { + midletPaused = true; +} + +/** + * Called to signal the MIDlet to terminate. + * + * @param unconditional + * if true, then the MIDlet has to be unconditionally terminated + * and all resources has to be released. + */ +public void destroyApp(boolean unconditional) { +} + + +} diff --git a/j2me/examples/PubnubExample/src/com/pubnub/examples/me/PubnubMenu.java b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/PubnubMenu.java new file mode 100644 index 000000000..94d6f807d --- /dev/null +++ b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/PubnubMenu.java @@ -0,0 +1,118 @@ +package com.pubnub.examples.me; + +import javax.microedition.lcdui.Command; +import javax.microedition.lcdui.CommandListener; +import javax.microedition.lcdui.Display; +import javax.microedition.lcdui.Displayable; +import javax.microedition.lcdui.Form; + +import com.pubnub.api.Pubnub; + +public class PubnubMenu { + private Form menu; + private Pubnub pubnub; + private Display display; + private PubnubDemoConsole app; + public PubnubMenu(Pubnub pubnub, Display display, PubnubDemoConsole app) { + this.pubnub = pubnub; + this.display = display; + this.app = app; + } + + public Form getMenu() { + final Publish publish; + final History history; + final Subscribe subscribe; + final DetailedHistory detailedHistory; + final HereNow hereNow; + final Presence presence; + final Unsubscribe unsubscribe; + + final ToggleResumeOnReconnect toggleResumeOnReconnect; + final Time time; + final DisconnectAndResubscribe disconnectAndResubscribe; + if (menu == null) { + final Command exitCommand; + final Command publishCommand; + final Command historyCommand; + final Command subscribeCommand; + final Command timeCommand; + + final Command unsubscribeCommand; + + final Command hereNowCommand; + final Command presenceCommand; + final Command detailedHistoryCommand; + final Command disconnectAndResubscribeCommand; + final Command toggleResumeOnReconnectCommand; + + menu = new Form("Pubnub Demo Console"); + publish = new Publish(pubnub, display, menu); + history = new History(pubnub, display, menu); + subscribe = new Subscribe(pubnub,display,menu); + presence = new Presence(pubnub,display,menu); + detailedHistory = new DetailedHistory(pubnub,display,menu); + hereNow = new HereNow(pubnub,display,menu); + unsubscribe = new Unsubscribe(pubnub,display,menu); + toggleResumeOnReconnect = new ToggleResumeOnReconnect(pubnub,display,menu); + disconnectAndResubscribe = new DisconnectAndResubscribe(pubnub,display,menu); + time = new Time(pubnub,display,menu); + + + toggleResumeOnReconnectCommand = new Command("ToggleResumeOnReconnect", Command.ITEM, 0); + menu.addCommand(toggleResumeOnReconnectCommand); + disconnectAndResubscribeCommand = new Command("DisconnectAndResubscribe",Command.ITEM, 0); + menu.addCommand(disconnectAndResubscribeCommand); + detailedHistoryCommand = new Command("DetailedHistory", Command.ITEM, 0); + menu.addCommand(detailedHistoryCommand); + presenceCommand = new Command("Presence", Command.ITEM, 0); + menu.addCommand(presenceCommand); + publishCommand = publish.getCommand(); + menu.addCommand(publishCommand); + timeCommand = new Command("Time", Command.ITEM, 2); + menu.addCommand(timeCommand); + historyCommand = new Command("History", Command.ITEM, 1); + menu.addCommand(historyCommand); + subscribeCommand = new Command("Subscribe", Command.ITEM, 0); + menu.addCommand(subscribeCommand); + unsubscribeCommand = new Command("Unsubscribe", Command.ITEM, 0); + menu.addCommand(unsubscribeCommand); + + hereNowCommand = new Command("HereNow", Command.ITEM, 1); + menu.addCommand(hereNowCommand); + exitCommand = new Command("Exit", Command.EXIT, 0); + menu.addCommand(exitCommand); + menu.setCommandListener(new CommandListener() { + + public void commandAction(Command command, Displayable displayable) { + if (command == exitCommand) { + app.exitMIDlet(); + } else if (command == historyCommand) { + history.handler(); + } else if (command == publishCommand) { + publish.handler(); + } else if (command == subscribeCommand) { + subscribe.handler(); + } else if (command == timeCommand) { + time.handler(); + } else if (command == unsubscribeCommand) { + unsubscribe.handler(); + } else if (command == hereNowCommand) { + hereNow.handler(); + } else if (command == presenceCommand) { + presence.handler(); + } else if (command == detailedHistoryCommand) { + detailedHistory.handler(); + } else if (command == disconnectAndResubscribeCommand) { + disconnectAndResubscribe.handler(); + } else if (command == toggleResumeOnReconnectCommand) { + toggleResumeOnReconnect.handler(); + } + + }}); + } + + return menu; + +} +} diff --git a/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Subscribe.java b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Subscribe.java new file mode 100644 index 000000000..66b32a2cc --- /dev/null +++ b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Subscribe.java @@ -0,0 +1,64 @@ +package com.pubnub.examples.me; + +import java.util.Hashtable; + +import javax.microedition.lcdui.Command; +import javax.microedition.lcdui.CommandListener; +import javax.microedition.lcdui.Display; +import javax.microedition.lcdui.Displayable; +import javax.microedition.lcdui.Form; +import javax.microedition.lcdui.TextField; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class Subscribe extends PubnubCommand { + + public Subscribe(Pubnub pubnub, Display display, Form menu) { + super(pubnub, display, menu, "Subscribe"); + } + + protected void initForm() { + final TextField txtChannel = new TextField("Channel: ", "", 255, TextField.ANY); + form = new Form("Subscribe"); + form.append(txtChannel); + form.addCommand(new Command("Subscribe", Command.OK, 2)); + + form.setCommandListener(new CommandListener() { + public void commandAction(Command arg0, Displayable arg1) { + Hashtable args = new Hashtable(); + args.put("channel", txtChannel.getString()); + + try { + _pubnub.subscribe(args, new Callback() { + public void connectCallback(String channel) { + notifyUser("CONNECT on channel:" + channel); + } + + public void disconnectCallback(String channel) { + notifyUser("DISCONNECT on channel:" + channel); + } + + public void reconnectCallback(String channel) { + notifyUser("RECONNECT on channel:" + channel); + } + + public void successCallback(String channel, Object message) { + notifyUser("Channel " + channel + " : " + message.toString()); + } + public void errorCallback(String channel, Object message) { + notifyUser("Channel " + channel + " : " + message.toString()); + } + }); + display.setCurrent(menu); + + } catch (Exception e) { + + } + + }}); + + + } + +} diff --git a/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Time.java b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Time.java new file mode 100644 index 000000000..20f7dfb30 --- /dev/null +++ b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Time.java @@ -0,0 +1,28 @@ +package com.pubnub.examples.me; + +import javax.microedition.lcdui.Display; +import javax.microedition.lcdui.Form; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class Time extends PubnubCommand { + + public Time(Pubnub pubnub, Display display, Form menu) { + super(pubnub, display, menu, "Time"); + } + + protected void initForm() { + } + public void handler() { + _pubnub.time( new Callback() { + public void successCallback(String channel, Object message) { + notifyUser(message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser(message.toString()); + } + }); + } +} diff --git a/j2me/examples/PubnubExample/src/com/pubnub/examples/me/ToggleResumeOnReconnect.java b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/ToggleResumeOnReconnect.java new file mode 100644 index 000000000..57bbcf036 --- /dev/null +++ b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/ToggleResumeOnReconnect.java @@ -0,0 +1,22 @@ +package com.pubnub.examples.me; + +import javax.microedition.lcdui.Display; +import javax.microedition.lcdui.Form; + +import com.pubnub.api.Pubnub; + +public class ToggleResumeOnReconnect extends PubnubCommand { + + public ToggleResumeOnReconnect(Pubnub pubnub, Display display, Form menu) { + super(pubnub, display, menu, "Toggle Resume on Reconnect"); + } + + public void handler() { + _pubnub.setResumeOnReconnect((_pubnub.isResumeOnReconnect())?false:true); + } + + protected void initForm() { + + } + +} diff --git a/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Unsubscribe.java b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Unsubscribe.java new file mode 100644 index 000000000..561706a8f --- /dev/null +++ b/j2me/examples/PubnubExample/src/com/pubnub/examples/me/Unsubscribe.java @@ -0,0 +1,34 @@ +package com.pubnub.examples.me; + +import javax.microedition.lcdui.Command; +import javax.microedition.lcdui.CommandListener; +import javax.microedition.lcdui.Display; +import javax.microedition.lcdui.Displayable; +import javax.microedition.lcdui.Form; +import javax.microedition.lcdui.TextField; + +import com.pubnub.api.Pubnub; + +public class Unsubscribe extends PubnubCommand { + + public Unsubscribe(Pubnub pubnub, Display display, Form menu) { + super(pubnub, display, menu, "Unsubscribe"); + } + + protected void initForm() { + final TextField txtChannel = new TextField("Channel: ", "", 255, TextField.ANY); + form = new Form("Unsubscribe"); + form.append(txtChannel); + form.addCommand(new Command("Unsubscribe", Command.OK, 2)); + + form.setCommandListener(new CommandListener() { + public void commandAction(Command arg0, Displayable arg1) { + _pubnub.unsubscribe(txtChannel.getString()); + display.setCurrent(menu); + + }}); + + + } + +} diff --git a/j2me/libs/bouncycastle.jar b/j2me/libs/bouncycastle.jar new file mode 100644 index 000000000..61c4c38d7 Binary files /dev/null and b/j2me/libs/bouncycastle.jar differ diff --git a/j2me/libs/cldc_1.1.jar b/j2me/libs/cldc_1.1.jar new file mode 100644 index 000000000..670fe0a1b Binary files /dev/null and b/j2me/libs/cldc_1.1.jar differ diff --git a/j2me/libs/jsonme.jar b/j2me/libs/jsonme.jar new file mode 100644 index 000000000..a55f7dcad Binary files /dev/null and b/j2me/libs/jsonme.jar differ diff --git a/j2me/libs/jsr177_1.0.jar b/j2me/libs/jsr177_1.0.jar new file mode 100644 index 000000000..9ab4f2b87 Binary files /dev/null and b/j2me/libs/jsr177_1.0.jar differ diff --git a/j2me/libs/midp_2.0.jar b/j2me/libs/midp_2.0.jar new file mode 100644 index 000000000..0eb005a99 Binary files /dev/null and b/j2me/libs/midp_2.0.jar differ diff --git a/j2me/libs/tinylinegzip.jar b/j2me/libs/tinylinegzip.jar new file mode 100644 index 000000000..40cfcd1ca Binary files /dev/null and b/j2me/libs/tinylinegzip.jar differ diff --git a/j2me/src/com/pubnub/api/Pubnub.java b/j2me/src/com/pubnub/api/Pubnub.java new file mode 100644 index 000000000..8f5e374fa --- /dev/null +++ b/j2me/src/com/pubnub/api/Pubnub.java @@ -0,0 +1,85 @@ +package com.pubnub.api; + +import org.bouncycastle.util.SecureRandom; + + +public class Pubnub extends PubnubCore { + + public Pubnub(String publish_key, String subscribe_key, String secret_key, + String cipher_key, boolean ssl_on) { + super(publish_key, subscribe_key, secret_key, cipher_key, ssl_on); + } + + public Pubnub(String publish_key, String subscribe_key, String secret_key, + boolean ssl_on) { + super(publish_key, subscribe_key, secret_key, "", ssl_on); + } + + + public Pubnub(String publish_key, String subscribe_key) { + super(publish_key, subscribe_key, "", "", false); + } + + public Pubnub(String publish_key, String subscribe_key, boolean ssl) { + super(publish_key, subscribe_key, "", "", ssl); + } + + public Pubnub(String publish_key, String subscribe_key, String secret_key) { + super(publish_key, subscribe_key, secret_key, "", false); + } + + /** + * UUID + * + * 32 digit UUID generation at client side. + * + * @return String uuid. + */ + public String uuid() { + + String valueBeforeMD5; + String valueAfterMD5; + SecureRandom mySecureRand = new SecureRandom(); + String s_id = String.valueOf(PubnubCore.class.hashCode()); + StringBuffer sbValueBeforeMD5 = new StringBuffer(); + try { + long time = System.currentTimeMillis(); + long rand = 0; + rand = mySecureRand.nextLong(); + sbValueBeforeMD5.append(s_id); + sbValueBeforeMD5.append(":"); + sbValueBeforeMD5.append(Long.toString(time)); + sbValueBeforeMD5.append(":"); + sbValueBeforeMD5.append(Long.toString(rand)); + valueBeforeMD5 = sbValueBeforeMD5.toString(); + byte[] array = PubnubCrypto.md5(valueBeforeMD5); + StringBuffer sb = new StringBuffer(); + for (int j = 0; j < array.length; ++j) { + int b = array[j] & 0xFF; + if (b < 0x10) { + sb.append('0'); + } + sb.append(Integer.toHexString(b)); + } + valueAfterMD5 = sb.toString(); + String raw = valueAfterMD5.toUpperCase(); + sb = new StringBuffer(); + sb.append(raw.substring(0, 8)); + sb.append("-"); + sb.append(raw.substring(8, 12)); + sb.append("-"); + sb.append(raw.substring(12, 16)); + sb.append("-"); + sb.append(raw.substring(16, 20)); + sb.append("-"); + sb.append(raw.substring(20)); + return sb.toString(); + } catch (Exception e) { + return null; + } + } + + protected String getUserAgent() { + return "J2me/3.4"; + } +} diff --git a/j2me/src1/com/pubnub/api/HttpClientCore.java b/j2me/src1/com/pubnub/api/HttpClientCore.java new file mode 100644 index 000000000..2f317e736 --- /dev/null +++ b/j2me/src1/com/pubnub/api/HttpClientCore.java @@ -0,0 +1,195 @@ +package com.pubnub.api; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Enumeration; +import java.util.Hashtable; + +import javax.microedition.io.Connector; +import javax.microedition.io.HttpConnection; + +import com.tinyline.util.GZIPInputStream; + +public class HttpClientCore extends HttpClient { + private int requestTimeout = 310000; + private int connectionTimeout = 5000; + private HttpConnection hc; + + private void init() { + + } + + public HttpClientCore(int connectionTimeout, int requestTimeout, Hashtable headers) { + init(); + this.setRequestTimeout(requestTimeout); + this.setConnectionTimeout(connectionTimeout); + this._headers = headers; + } + + + public int getRequestTimeout() { + return requestTimeout; + } + + public void setRequestTimeout(int requestTimeout) { + this.requestTimeout = requestTimeout; + } + + private String readResponse(HttpConnection hconn) { + InputStream in = null; + String prefix = ""; + try { + StringBuffer b = new StringBuffer(); + int ch; + b.append(prefix); + in = hconn.openInputStream(); + if ("gzip".equals(hconn.getEncoding())) + in= new GZIPInputStream(in); + + byte[] data = null; + ByteArrayOutputStream tmp = new ByteArrayOutputStream(); + + while ((ch = in.read()) != -1) { + tmp.write(ch); + } + data = tmp.toByteArray(); + tmp.close(); + b.append(new String(data, "UTF-8")); + + if (b.length() > 0) { + return b.toString(); + } else + return null; + + } catch (IOException ioe) { + return null; + } finally { + if (in != null) { + try { + in.close(); + } catch (IOException e) { + } + } + } + } + + public boolean isRedirect(int rc) { + return (rc == HttpConnection.HTTP_MOVED_PERM + || rc == HttpConnection.HTTP_MOVED_TEMP + || rc == HttpConnection.HTTP_SEE_OTHER || rc == HttpConnection.HTTP_TEMP_REDIRECT); + } + + public boolean isOk(int rc) { + return (rc == HttpConnection.HTTP_OK); + } + + public boolean checkResponse(int rc) { + + return (rc == HttpConnection.HTTP_OK || isRedirect(rc)); + } + + public HttpResponse fetch(String url) throws IOException { + return fetch(url, null); + } + + public HttpResponse fetch(String url, Hashtable headers) throws IOException { + if (url == null) + throw new IOException("Invalid Url"); + + int follow = 5; + int rc = 0; + hc = null; + String response = null; + + while (follow-- > 0) { + + hc = (HttpConnection) Connector.open(url, Connector.READ_WRITE, + true); + hc.setRequestMethod(HttpConnection.GET); + if (_headers != null) { + Enumeration en = _headers.keys(); + while (en.hasMoreElements()) { + String key = (String) en.nextElement(); + String val = (String) _headers.get(key); + hc.setRequestProperty(key, val); + } + } + if (headers != null) { + Enumeration en = headers.keys(); + while (en.hasMoreElements()) { + String key = (String) en.nextElement(); + String val = (String) headers.get(key); + hc.setRequestProperty(key, val); + } + } + + rc = hc.getResponseCode(); + + + + if (!checkResponse(rc)) { + break; + } else if (!isRedirect(rc)) { + break; + } + + url = hc.getHeaderField("Location"); + + if (url == null) { + throw new IOException("No Location header"); + } + + if (url.startsWith("/")) { + StringBuffer b = new StringBuffer(); + b.append("http://"); + b.append(hc.getHost()); + b.append(':'); + b.append(hc.getPort()); + b.append(url); + url = b.toString(); + } else if (url.startsWith("ttp:")) { + url = "h" + url; + } + hc.close(); + } + + if (follow == 0) { + throw new IOException("Too many redirects"); + } + + response = readResponse(hc); + hc.close(); + return new HttpResponse(rc, response); + } + + public int getConnectionTimeout() { + // TODO Auto-generated method stub + return 0; + } + + public void setConnectionTimeout(int connectionTimeout) { + // TODO Auto-generated method stub + + } + + public void abortCurrentRequest() { + // TODO Auto-generated method stub + + } + + public boolean checkResponseSuccess(int rc) { + return (rc == HttpConnection.HTTP_OK); + } + + public void shutdown() { + try { + if (hc != null) { + hc.close(); + } + + } catch (IOException e) { + + } + } +} diff --git a/j2me/src1/com/pubnub/api/NonSubscribeManager.java b/j2me/src1/com/pubnub/api/NonSubscribeManager.java new file mode 100644 index 000000000..503e71ad8 --- /dev/null +++ b/j2me/src1/com/pubnub/api/NonSubscribeManager.java @@ -0,0 +1,13 @@ +package com.pubnub.api; + +class NonSubscribeManager extends AbstractNonSubscribeManager { + + public NonSubscribeManager(String name, int connectionTimeout, + int requestTimeout) { + super(name, connectionTimeout, requestTimeout); + } + + public void clearRequestQueue() { + _waiting.removeAllElements(); + } +} diff --git a/j2me/src1/com/pubnub/api/PubnubCrypto.java b/j2me/src1/com/pubnub/api/PubnubCrypto.java new file mode 100644 index 000000000..cb5d8f40a --- /dev/null +++ b/j2me/src1/com/pubnub/api/PubnubCrypto.java @@ -0,0 +1,43 @@ +package com.pubnub.api; + +import org.bouncycastle.crypto.digests.SHA256Digest; +import org.bouncycastle.crypto.macs.HMac; +import org.bouncycastle.crypto.params.KeyParameter; +import org.bouncycastle.util.BigInteger; + +public class PubnubCrypto extends PubnubCryptoCore { + + public PubnubCrypto(String CIPHER_KEY) { + super(CIPHER_KEY); + } + + /** + * Sign Message + * + * @param String + * input + * @return String as HashText + */ + public String getHMacSHA256(String secret_key, String input) { + + String signature = "0"; + try { + HMac m = new HMac(new SHA256Digest()); + m.init(new KeyParameter(secret_key.getBytes("UTF-8"))); + byte[] bytes = input.getBytes("UTF-8"); + m.update(bytes, 0, bytes.length); + byte[] mac = new byte[m.getMacSize()]; + m.doFinal(mac, 0); + BigInteger number = new BigInteger(1,mac); + String hashtext = number.toString(); + signature = hashtext; + } catch (java.io.UnsupportedEncodingException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + + return signature; + } + +} diff --git a/j2me/src1/com/pubnub/api/PubnubUtil.java b/j2me/src1/com/pubnub/api/PubnubUtil.java new file mode 100644 index 000000000..58f7cceba --- /dev/null +++ b/j2me/src1/com/pubnub/api/PubnubUtil.java @@ -0,0 +1,129 @@ +package com.pubnub.api; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; + +public class PubnubUtil extends PubnubUtilCore { + + + private static String replace( String str, String pattern, String replace ) + { + int s = 0; + int e = 0; + StringBuffer result = new StringBuffer(); + + while ( (e = str.indexOf( pattern, s ) ) >= 0 ) + { + result.append(str.substring( s, e ) ); + result.append( replace ); + s = e+pattern.length(); + } + result.append( str.substring( s ) ); + return result.toString(); + } + + /** + * Returns encoded String + * + * @param sUrl + * , input string + * @return , encoded string + */ + public static String urlEncode(String sUrl) { + try { + return replace(encode(sUrl, "UTF-8"),"+", "%20"); + } catch (UnsupportedEncodingException e) { + return null; + } + } + + + public static String encode(String s, String enc) + throws UnsupportedEncodingException { + + boolean needToChange = false; + boolean wroteUnencodedChar = false; + int maxBytesPerChar = 10; + StringBuffer out = new StringBuffer(s.length()); + ByteArrayOutputStream buf = new ByteArrayOutputStream(maxBytesPerChar); + + OutputStreamWriter writer = new OutputStreamWriter(buf, enc); + + for (int i = 0; i < s.length(); i++) { + int c = (int) s.charAt(i); + if (dontNeedEncoding(c)) { + if (c == ' ') { + c = '+'; + needToChange = true; + } + out.append((char)c); + wroteUnencodedChar = true; + } else { + try { + if (wroteUnencodedChar) { + writer = new OutputStreamWriter(buf, enc); + wroteUnencodedChar = false; + } + writer.write(c); + if (c >= 0xD800 && c <= 0xDBFF) { + + if ( (i+1) < s.length()) { + int d = (int) s.charAt(i+1); + if (d >= 0xDC00 && d <= 0xDFFF) { + writer.write(d); + i++; + } + } + } + writer.flush(); + } catch(IOException e) { + buf.reset(); + continue; + } + byte[] ba = buf.toByteArray(); + for (int j = 0; j < ba.length; j++) { + out.append('%'); + char ch = CCharacter.forDigit((ba[j] >> 4) & 0xF, 16); + out.append(ch); + ch = CCharacter.forDigit(ba[j] & 0xF, 16); + out.append(ch); + } + buf.reset(); + needToChange = true; + } + } + + return (needToChange? out.toString() : s); + } + + static class CCharacter { + public static char forDigit(int digit, int radix) { + if ((digit >= radix) || (digit < 0)) { + return '\0'; + } + if ((radix < Character.MIN_RADIX) || (radix > Character.MAX_RADIX)) { + return '\0'; + } + if (digit < 10) { + return (char)('0' + digit); + } + return (char)('a' - 10 + digit); + } + } + public static boolean dontNeedEncoding(int ch){ + int len = _dontNeedEncoding.length(); + boolean en = false; + for(int i =0;i< len;i++){ + if(_dontNeedEncoding.charAt(i) == ch) + { + en = true; + break; + } + } + + return en; + } + private static String _dontNeedEncoding = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -_.*"; +} diff --git a/j2me/src1/com/pubnub/api/SubscribeManager.java b/j2me/src1/com/pubnub/api/SubscribeManager.java new file mode 100644 index 000000000..13e090f20 --- /dev/null +++ b/j2me/src1/com/pubnub/api/SubscribeManager.java @@ -0,0 +1,24 @@ +package com.pubnub.api; + +class SubscribeManager extends AbstractSubscribeManager { + + public SubscribeManager(String name, int connectionTimeout, + int requestTimeout) { + super(name, connectionTimeout, requestTimeout); + } + + public void resetWorkersConnections() { + for (int i = 0; i < _workers.length; i++){ + _workers[i].die(); + _workers[i].interruptWorker(); + Worker w = getWorker(); + w.setThread(new Thread(w,name)); + _workers[i] = w; + w.startWorker(); + } + } + + public void clearRequestQueue() { + _waiting.removeAllElements(); + } +} diff --git a/j2me/src1/com/pubnub/api/SubscribeWorker.java b/j2me/src1/com/pubnub/api/SubscribeWorker.java new file mode 100644 index 000000000..be8a155fb --- /dev/null +++ b/j2me/src1/com/pubnub/api/SubscribeWorker.java @@ -0,0 +1,67 @@ +package com.pubnub.api; + +import java.util.Hashtable; +import java.util.Vector; + +class SubscribeWorker extends AbstractSubscribeWorker { + + SubscribeWorker(Vector _requestQueue, int connectionTimeout, + int requestTimeout, int maxRetries, int retryInterval, Hashtable headers) { + super(_requestQueue, connectionTimeout, requestTimeout, + maxRetries, retryInterval, headers); + } + + void process(HttpRequest hreq) { + HttpResponse hresp = null; + int currentRetryAttempt = (hreq.isDar())?1:maxRetries; + log.verbose("disconnectAndResubscribe is " + hreq.isDar()); + while (!_die && currentRetryAttempt <= maxRetries) { + try { + log.debug(hreq.getUrl()); + hresp = httpclient.fetch(hreq.getUrl(), hreq.getHeaders()); + if (hresp != null + && httpclient.checkResponseSuccess(hresp + .getStatusCode())) { + currentRetryAttempt = 1; + break; + } + } /*catch (SocketTimeoutException e) { + log.verbose("No Traffic , Read Timeout Exception in Fetch : " + e.toString()); + if (hreq.isDar()) { + hreq.getResponseHandler().handleBackFromDar(hreq); + return; + } + break; + + } */catch (Exception e) { + log.verbose("Retry Attempt : " + ((currentRetryAttempt == maxRetries)?"last":String.valueOf(currentRetryAttempt)) + + " Exception in Fetch : " + e.toString()); + currentRetryAttempt++; + } + + try { + Thread.sleep(retryInterval); + } catch (InterruptedException e) { + } + } + if (!_die) { + if (hresp == null) { + log.debug("Error in fetching url : " + hreq.getUrl()); + if (hreq.isDar()) { + log.verbose("Exhausted number of retries"); + hreq.getResponseHandler().handleTimeout(hreq); + } else { + hreq.getResponseHandler().handleError(hreq, "Request Timeout"); + } + return; + } + log.debug(hresp.getResponse()); + hreq.getResponseHandler().handleResponse(hreq, hresp.getResponse()); + } + + } + public void shutdown() { + if (httpclient != null) httpclient.shutdown(); + } + +} diff --git a/j2me/srcLogging/com/pubnub/api/Logger.java b/j2me/srcLogging/com/pubnub/api/Logger.java new file mode 100644 index 000000000..087a1208d --- /dev/null +++ b/j2me/srcLogging/com/pubnub/api/Logger.java @@ -0,0 +1,32 @@ +package com.pubnub.api; + + + +class Logger extends AbstractLogger { + private Class _class; + + public Logger(Class _class) { + this._class = _class; + } + + protected void nativeDebug(String s) { + System.out.println("["+Thread.activeCount()+ "] Thread ID : " + Thread.currentThread().hashCode() + " " + s); + + } + + protected void nativeVerbose(String s) { + System.out.println("["+Thread.activeCount()+ "] Thread ID : " + Thread.currentThread().hashCode() + " " + s); + } + + + protected void nativeError(String s) { + System.out.println("["+Thread.activeCount()+ "] Thread ID : " + Thread.currentThread().hashCode() + " " + s); + + } + + protected void nativeInfo(String s) { + System.out.println("["+Thread.activeCount()+ "] Thread ID : " + Thread.currentThread().hashCode() + " " + s); + + } + +} diff --git a/java/CHANGELOG b/java/CHANGELOG new file mode 100644 index 000000000..941924f9c --- /dev/null +++ b/java/CHANGELOG @@ -0,0 +1,13 @@ +CHANGELOG + +02-20-2013 - 800478550d9dfa19ae626ee7fd0f774f35254e1b +. added additional versioning support for maven +. jar refactor + +02-01-2013 - 8a686c91cb546787a6be7810b96b806c33cf96e7 +. client is now fully asyncronous +. added enhanced multiplexed subscribe support +. better error handling added to example app +. improved keep-alive handling +. support for chunked responses +. improved logging diff --git a/java/Pubnub-StandardEdition-3.5.1.jar b/java/Pubnub-StandardEdition-3.5.1.jar new file mode 100644 index 000000000..d279c82fb Binary files /dev/null and b/java/Pubnub-StandardEdition-3.5.1.jar differ diff --git a/java/Pubnub-StandardEdition-3.6.0.jar b/java/Pubnub-StandardEdition-3.6.0.jar new file mode 100644 index 000000000..b3f8432cd Binary files /dev/null and b/java/Pubnub-StandardEdition-3.6.0.jar differ diff --git a/java/Pubnub-StandardEdition-3.6.1.jar b/java/Pubnub-StandardEdition-3.6.1.jar new file mode 100644 index 000000000..b5bd7c5e3 Binary files /dev/null and b/java/Pubnub-StandardEdition-3.6.1.jar differ diff --git a/java/Pubnub-StandardEdition-3.6.2.jar b/java/Pubnub-StandardEdition-3.6.2.jar new file mode 100644 index 000000000..192d3cf14 Binary files /dev/null and b/java/Pubnub-StandardEdition-3.6.2.jar differ diff --git a/java/Pubnub-StandardEdition-3.6.3.jar b/java/Pubnub-StandardEdition-3.6.3.jar new file mode 100644 index 000000000..11c08ac45 Binary files /dev/null and b/java/Pubnub-StandardEdition-3.6.3.jar differ diff --git a/java/Pubnub-StandardEdition-3.7.0.jar b/java/Pubnub-StandardEdition-3.7.0.jar new file mode 100644 index 000000000..c9aae9e50 Binary files /dev/null and b/java/Pubnub-StandardEdition-3.7.0.jar differ diff --git a/java/Pubnub-StandardEdition-3.8.0.jar b/java/Pubnub-StandardEdition-3.8.0.jar new file mode 100644 index 000000000..6c98295d3 Binary files /dev/null and b/java/Pubnub-StandardEdition-3.8.0.jar differ diff --git a/java/Pubnub-StandardEdition-3.8.1.jar b/java/Pubnub-StandardEdition-3.8.1.jar new file mode 100644 index 000000000..2ae5da58f Binary files /dev/null and b/java/Pubnub-StandardEdition-3.8.1.jar differ diff --git a/java/Pubnub-StandardEdition-3.9.0.jar b/java/Pubnub-StandardEdition-3.9.0.jar new file mode 100644 index 000000000..026c7be54 Binary files /dev/null and b/java/Pubnub-StandardEdition-3.9.0.jar differ diff --git a/java/Pubnub-StandardEdition-4.0.0.jar b/java/Pubnub-StandardEdition-4.0.0.jar new file mode 100644 index 000000000..b84704641 Binary files /dev/null and b/java/Pubnub-StandardEdition-4.0.0.jar differ diff --git a/java/Pubnub-StandardEdition-5.0.0.jar b/java/Pubnub-StandardEdition-5.0.0.jar new file mode 100644 index 000000000..a55cc345e Binary files /dev/null and b/java/Pubnub-StandardEdition-5.0.0.jar differ diff --git a/java/README.md b/java/README.md new file mode 100644 index 000000000..e89abb9ab --- /dev/null +++ b/java/README.md @@ -0,0 +1,121 @@ +##### YOU MUST HAVE A PUBNUB ACCOUNT TO USE THE API. +##### http://www.pubnub.com/account + +## PubNub 3.5 Real-time Cloud Push API - JAVA + +www.pubnub.com - PubNub Real-time Push Service in the Cloud. + +Please reference the demo app in 3.4/jars/PubnubDemoConsole.jar for an example of using PubNub +Asyncronously in your applications! + +Additional Java docs are available at 3.4/doc/index.html +###To browse source +Checkout [srcPubnubApi](/java/srcPubnubApi) + +###To setup with your IDE: + +1. Add new project with java/ as the root +2. Set the new project source as java/srcPubnubApi +3. Add java/Pubnub-Standardedition-3.5.jar and 3.5/libs/*.jar as project libaries +4. You should be able to run PubnubDemoConsole and PubnubExample via your IDE + +###To build from the CL, run: +``` +$ ant clean build +$ ant +``` + +###To test from the CL, run: +``` +$ ant test +``` + +###To be really cool and clean, build, and test at once! +``` +$ ant clean build test +``` + +###To run the DemoConsole: +``` +$ cd jars +$ java -jar PubnubDemoConsole.jar +``` + +###Heres an example of running PubnubDemoConsole: + +``` +$~/pubnub/java/java/jars$ java -jar PubnubDemoConsole.jar +HINT: To test Re-connect and catch-up + Disconnect your machine from network/internet and + re-connect your machine after sometime +Enable SSL ? Enter Y for Yes, else N +N + +SSL not enabled +Enter cipher key for encryption feature +If you don't want to avail at this time, press ENTER + +No Cipher key provided +ENTER 1 FOR Subscribe (Currently subscribed to no channels.) +ENTER 2 FOR Publish +ENTER 3 FOR Presence +ENTER 4 FOR Detailed History +ENTER 5 FOR Here_Now +ENTER 6 FOR Unsubscribe +ENTER 7 FOR Presence-Unsubscribe +ENTER 8 FOR Time +ENTER 9 FOR EXIT OR QUIT +ENTER 10 FOR Disconnect-And-Resubscribe +ENTER 11 FOR Toggle Resume On Reconnect + +ENTER 0 to display this menu +1 +Subscribe: Enter Channel name +hello_world +Subscribed to following channels: +hello_world +ENTER 1 FOR Subscribe (Currently subscribed to hello_world) +ENTER 2 FOR Publish +ENTER 3 FOR Presence +ENTER 4 FOR Detailed History +ENTER 5 FOR Here_Now +ENTER 6 FOR Unsubscribe +ENTER 7 FOR Presence-Unsubscribe +ENTER 8 FOR Time +ENTER 9 FOR EXIT OR QUIT +ENTER 10 FOR Disconnect-And-Resubscribe +ENTER 11 FOR Toggle Resume On Reconnect + +ENTER 0 to display this menu + +SUBSCRIBE : CONNECT on channel:hello_world +1 +Subscribe: Enter Channel name +my_channel +Subscribed to following channels: +hello_world : my_channel +ENTER 1 FOR Subscribe (Currently subscribed to hello_world,my_channel) +ENTER 2 FOR Publish +ENTER 3 FOR Presence +ENTER 4 FOR Detailed History +ENTER 5 FOR Here_Now +ENTER 6 FOR Unsubscribe +ENTER 7 FOR Presence-Unsubscribe +ENTER 8 FOR Time +ENTER 9 FOR EXIT OR QUIT +ENTER 10 FOR Disconnect-And-Resubscribe +ENTER 11 FOR Toggle Resume On Reconnect + +ENTER 0 to display this menu +SUBSCRIBE : CONNECT on channel:my_channel +2 +Publish: Enter Channel name +hello_world +Enter the message for publish. To exit loop enter QUIT +"hello, world!" +PUBLISH : [1,"Sent","13597534956712683"] +SUBSCRIBE : hello_world : class java.lang.String : hello, world! +SUBSCRIBE : hello_world : class java.lang.String : 3ZoxkVMB97lf09jpFU9gtw== +SUBSCRIBE : hello_world : class java.lang.String : 3ZoxkVMB97lf09jpFU9gtw== +``` +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/pubnub/java/trend.png)](https://bitdeli.com/free "Bitdeli Badge") diff --git a/java/build.xml b/java/build.xml new file mode 100644 index 000000000..c714e11b9 --- /dev/null +++ b/java/build.xml @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/doc/allclasses-frame.html b/java/doc/allclasses-frame.html new file mode 100644 index 000000000..284375415 --- /dev/null +++ b/java/doc/allclasses-frame.html @@ -0,0 +1,41 @@ + + + + + + +All Classes + + + + + + + + + + + +All Classes +
+ + + + + +
Callback +
+Pubnub +
+PubnubError +
+PubnubException +
+PubnubUtil +
+PubnubUtilCore +
+
+ + + diff --git a/java/doc/allclasses-noframe.html b/java/doc/allclasses-noframe.html new file mode 100644 index 000000000..b3cfb1f14 --- /dev/null +++ b/java/doc/allclasses-noframe.html @@ -0,0 +1,41 @@ + + + + + + +All Classes + + + + + + + + + + + +All Classes +
+ + + + + +
Callback +
+Pubnub +
+PubnubError +
+PubnubException +
+PubnubUtil +
+PubnubUtilCore +
+
+ + + diff --git a/java/doc/com/pubnub/api/Callback.html b/java/doc/com/pubnub/api/Callback.html new file mode 100644 index 000000000..1c0ef89d8 --- /dev/null +++ b/java/doc/com/pubnub/api/Callback.html @@ -0,0 +1,355 @@ + + + + + + +Callback + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +com.pubnub.api +
+Class Callback

+
+java.lang.Object
+  extended by com.pubnub.api.Callback
+
+
+
+
public abstract class Callback
extends java.lang.Object
+ + +

+Abstract class to be subclassed by objects being passed as callbacks to + Pubnub APIs Default implementation for all methods is blank +

+ +

+

+
Author:
+
Pubnub
+
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
Callback() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidconnectCallback(java.lang.String channel, + java.lang.Object message) + +
+          This callback will be invoked on getting connected to a channel
+ voiddisconnectCallback(java.lang.String channel, + java.lang.Object message) + +
+          This callback is invoked on getting disconnected from a channel
+abstract  voiderrorCallback(java.lang.String channel, + java.lang.Object message) + +
+          This callback will be invoked when an error occurs
+ voidreconnectCallback(java.lang.String channel, + java.lang.Object message) + +
+          This callback is invoked on getting reconnected to a channel after + getting disconnected
+abstract  voidsuccessCallback(java.lang.String channel, + java.lang.Object message) + +
+          This callback will be invoked when a message is received on the channel
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+Callback

+
+public Callback()
+
+
+ + + + + + + + +
+Method Detail
+ +

+successCallback

+
+public abstract void successCallback(java.lang.String channel,
+                                     java.lang.Object message)
+
+
This callback will be invoked when a message is received on the channel +

+

+
Parameters:
channel - Channel Name
message - Message
+
+
+
+ +

+errorCallback

+
+public abstract void errorCallback(java.lang.String channel,
+                                   java.lang.Object message)
+
+
This callback will be invoked when an error occurs +

+

+
Parameters:
channel - Channel Name
message - Message
+
+
+
+ +

+connectCallback

+
+public void connectCallback(java.lang.String channel,
+                            java.lang.Object message)
+
+
This callback will be invoked on getting connected to a channel +

+

+
Parameters:
channel - Channel Name
+
+
+
+ +

+reconnectCallback

+
+public void reconnectCallback(java.lang.String channel,
+                              java.lang.Object message)
+
+
This callback is invoked on getting reconnected to a channel after + getting disconnected +

+

+
Parameters:
channel - Channel Name
+
+
+
+ +

+disconnectCallback

+
+public void disconnectCallback(java.lang.String channel,
+                               java.lang.Object message)
+
+
This callback is invoked on getting disconnected from a channel +

+

+
Parameters:
channel - Channel Name
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/java/doc/com/pubnub/api/Pubnub.html b/java/doc/com/pubnub/api/Pubnub.html new file mode 100644 index 000000000..b0bc3cfb0 --- /dev/null +++ b/java/doc/com/pubnub/api/Pubnub.html @@ -0,0 +1,1445 @@ + + + + + + +Pubnub + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +com.pubnub.api +
+Class Pubnub

+
+java.lang.Object
+  extended by com.pubnub.api.Pubnub
+
+
+
+
public class Pubnub
extends java.lang.Object
+ + +

+Pubnub object facilitates querying channels for messages and listening on + channels for presence/message events +

+ +

+

+
Author:
+
Pubnub
+
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + +
+Constructor Summary
Pubnub(java.lang.String publish_key, + java.lang.String subscribe_key) + +
+          Pubnub Constructor
Pubnub(java.lang.String publish_key, + java.lang.String subscribe_key, + boolean ssl) + +
+           
Pubnub(java.lang.String publish_key, + java.lang.String subscribe_key, + java.lang.String secret_key) + +
+           
Pubnub(java.lang.String publish_key, + java.lang.String subscribe_key, + java.lang.String secret_key, + boolean ssl_on) + +
+          Pubnub Constructor
Pubnub(java.lang.String publish_key, + java.lang.String subscribe_key, + java.lang.String secret_key, + java.lang.String cipher_key, + boolean ssl_on) + +
+          Pubnub Constructor
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voiddetailedHistory(java.lang.String channel, + boolean reverse, + Callback callback) + +
+          Read DetailedHistory for a channel.
+ voiddetailedHistory(java.lang.String channel, + int count, + boolean reverse, + Callback callback) + +
+          Read DetailedHistory for a channel.
+ voiddetailedHistory(java.lang.String channel, + int count, + Callback callback) + +
+          Read DetailedHistory for a channel.
+ voiddetailedHistory(java.lang.String channel, + long start, + boolean reverse, + Callback callback) + +
+          Read DetailedHistory for a channel.
+ voiddetailedHistory(java.lang.String channel, + long start, + long end, + boolean reverse, + Callback callback) + +
+          Read DetailedHistory for a channel.
+ voiddetailedHistory(java.lang.String channel, + long start, + long end, + Callback callback) + +
+          Read DetailedHistory for a channel.
+ voiddetailedHistory(java.lang.String channel, + long start, + long end, + int count, + boolean reverse, + Callback callback) + +
+          Read DetailedHistory for a channel.
+ voiddisconnectAndResubscribe() + +
+          Disconnect from all channels, and resubscribe
+ voiddisconnectAndResubscribe(java.lang.String errorMessage) + +
+          Disconnect from all channels, and resubscribe
+ voiddisconnectAndResubscribeWithTimetoken(java.lang.String timetoken) + +
+          Disconnect from all channels, and resubscribe
+ voiddisconnectAndResubscribeWithTimetoken(java.lang.String timetoken, + java.lang.String errorMessage) + +
+          Disconnect from all channels, and resubscribe
+ java.lang.StringgetAuthKey() + +
+          This method return auth key.
+ java.lang.StringgetCurrentlySubscribedChannelNames() + +
+          This method returns all channel names currently subscribed to in form of + a comma separated String
+ java.lang.String[]getSubscribedChannelsArray() + +
+          This method returns array of channel names, currently subscribed to
+ voidhereNow(java.lang.String channel, + Callback callback) + +
+          Read presence information from a channel
+ voidhistory(java.util.Hashtable args) + +
+          Read history from a channel.
+ voidhistory(java.lang.String channel, + int limit, + Callback callback) + +
+          Read history from a channel.
+ booleanisResumeOnReconnect() + +
+          This method returns the state of Resume on Reconnect setting
+ voidpresence(java.lang.String channel, + Callback callback) + +
+          Listen for presence of subscribers on a channel
+ voidpublish(java.util.Hashtable args) + +
+          Send a message to a channel.
+ voidpublish(java.util.Hashtable args, + Callback callback) + +
+          Send a message to a channel.
+ voidpublish(java.lang.String channel, + java.lang.Double message, + Callback callback) + +
+          Send a message to a channel.
+ voidpublish(java.lang.String channel, + java.lang.Integer message, + Callback callback) + +
+          Send a message to a channel.
+ voidpublish(java.lang.String channel, + org.json.JSONArray message, + Callback callback) + +
+          Send a message to a channel.
+ voidpublish(java.lang.String channel, + org.json.JSONObject message, + Callback callback) + +
+          Send a message to a channel.
+ voidpublish(java.lang.String channel, + java.lang.String message, + Callback callback) + +
+          Send a message to a channel.
+ voidsetAuthKey(java.lang.String authKey) + +
+          This method sets auth key.
+ voidsetMaxRetries(int maxRetries) + +
+          This methods sets maximum number of retries for subscribe.
+ voidsetNonSubscribeTimeout(int timeout) + +
+          This method set timeout value for non subscribe operations like publish, + history, hereNow.
+ voidsetOrigin(java.lang.String origin) + +
+          Sets origin value, default is "pubsub"
+ voidsetResumeOnReconnect(boolean resumeOnReconnect) + +
+          If Resume on Reconnect is set to true, then Pubnub catches up on + reconnection after disconnection.
+ voidsetRetryInterval(int retryInterval) + +
+          This method sets retry interval for subscribe.
+ voidsetSubscribeTimeout(int timeout) + +
+          This method sets timeout value for subscribe/presence.
+ voidsetUUID(java.lang.String uuid) + +
+          Sets value for UUID
+ voidsetUUID(java.util.UUID uuid) + +
+          Sets value for UUID
+ voidshutdown() + +
+          This method when called stops Pubnub threads
+ voidsubscribe(java.util.Hashtable args) + +
+          Listen for a message on a channel.
+ voidsubscribe(java.util.Hashtable args, + Callback callback) + +
+          Listen for a message on a channel.
+ voidsubscribe(java.lang.String[] channelsArr, + Callback callback) + +
+          Listen for a message on a channel.
+ voidsubscribe(java.lang.String[] channelsArr, + Callback callback, + java.lang.String timetoken) + +
+          Listen for a message on a channel.
+ voidtime(Callback callback) + +
+          Read current time from PubNub Cloud.
+ voidunsetAuthKey() + +
+          This method unsets auth key.
+ voidunsubscribe(java.util.Hashtable args) + +
+          Unsubscribe/Disconnect from channel.
+ voidunsubscribe(java.lang.String channel) + +
+          Unsubscribe/Disconnect from channel.
+ voidunsubscribe(java.lang.String[] channels) + +
+          Unsubscribe from channels.
+ voidunsubscribeAll() + +
+          Unsubscribe from all channel.
+ voidunsubscribePresence(java.lang.String channel) + +
+          Unsubscribe from presence channel.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+Pubnub

+
+public Pubnub(java.lang.String publish_key,
+              java.lang.String subscribe_key,
+              java.lang.String secret_key,
+              java.lang.String cipher_key,
+              boolean ssl_on)
+
+
Pubnub Constructor +

+

+
Parameters:
publish_key - Publish Key
subscribe_key - Subscribe Key
secret_key - Secret Key
cipher_key - Cipher Key
ssl_on - SSL on ?
+
+
+ +

+Pubnub

+
+public Pubnub(java.lang.String publish_key,
+              java.lang.String subscribe_key,
+              java.lang.String secret_key,
+              boolean ssl_on)
+
+
Pubnub Constructor +

+

+
Parameters:
publish_key - Publish key
subscribe_key - Subscribe Key
secret_key - Secret Key
ssl_on - SSL on ?
+
+
+ +

+Pubnub

+
+public Pubnub(java.lang.String publish_key,
+              java.lang.String subscribe_key)
+
+
Pubnub Constructor +

+

+
Parameters:
publish_key - Publish Key
subscribe_key - Subscribe Key
+
+
+ +

+Pubnub

+
+public Pubnub(java.lang.String publish_key,
+              java.lang.String subscribe_key,
+              boolean ssl)
+
+
+
Parameters:
publish_key - Publish Key
subscribe_key - Subscribe Key
ssl -
+
+
+ +

+Pubnub

+
+public Pubnub(java.lang.String publish_key,
+              java.lang.String subscribe_key,
+              java.lang.String secret_key)
+
+
+
Parameters:
publish_key -
subscribe_key -
secret_key -
+
+ + + + + + + + +
+Method Detail
+ +

+setUUID

+
+public void setUUID(java.util.UUID uuid)
+
+
Sets value for UUID +

+

+
Parameters:
uuid - UUID value for Pubnub client
+
+
+
+ +

+setSubscribeTimeout

+
+public void setSubscribeTimeout(int timeout)
+
+
This method sets timeout value for subscribe/presence. Default value is + 310000 milliseconds i.e. 310 seconds +

+

+
+
+
+
Parameters:
timeout - Timeout value in milliseconds for subscribe/presence
+
+
+
+ +

+setNonSubscribeTimeout

+
+public void setNonSubscribeTimeout(int timeout)
+
+
This method set timeout value for non subscribe operations like publish, + history, hereNow. Default value is 15000 milliseconds i.e. 15 seconds. +

+

+
+
+
+
Parameters:
timeout - Timeout value in milliseconds for Non subscribe operations + like publish, history, hereNow
+
+
+
+ +

+shutdown

+
+public void shutdown()
+
+
This method when called stops Pubnub threads +

+

+
+
+
+
+ +

+isResumeOnReconnect

+
+public boolean isResumeOnReconnect()
+
+
This method returns the state of Resume on Reconnect setting +

+

+ +
Returns:
Current state of Resume On Reconnect Setting
+
+
+
+ +

+setRetryInterval

+
+public void setRetryInterval(int retryInterval)
+
+
This method sets retry interval for subscribe. Pubnub API will make + maxRetries attempts to connect to pubnub servers. These attemtps will be + made at an interval of retryInterval milliseconds. +

+

+
Parameters:
retryInterval - Retry Interval in milliseconds
+
+
+
+ +

+setMaxRetries

+
+public void setMaxRetries(int maxRetries)
+
+
This methods sets maximum number of retries for subscribe. Pubnub API + will make maxRetries attempts to connect to pubnub servers before timing + out. +

+

+
Parameters:
maxRetries - Max number of retries
+
+
+
+ +

+getCurrentlySubscribedChannelNames

+
+public java.lang.String getCurrentlySubscribedChannelNames()
+
+
This method returns all channel names currently subscribed to in form of + a comma separated String +

+

+ +
Returns:
Comma separated string with all channel names currently + subscribed
+
+
+
+ +

+setResumeOnReconnect

+
+public void setResumeOnReconnect(boolean resumeOnReconnect)
+
+
If Resume on Reconnect is set to true, then Pubnub catches up on + reconnection after disconnection. If false, then messages sent on the + channel between disconnection and reconnection are not received. +

+

+
Parameters:
resumeOnReconnect - True or False setting for Resume on Reconnect
+
+
+
+ +

+setUUID

+
+public void setUUID(java.lang.String uuid)
+
+
Sets value for UUID +

+

+
Parameters:
uuid - UUID value for Pubnub client
+
+
+
+ +

+publish

+
+public void publish(java.lang.String channel,
+                    org.json.JSONObject message,
+                    Callback callback)
+
+
Send a message to a channel. +

+

+
Parameters:
channel - Channel name
message - JSONObject to be published
callback - object of sub class of Callback class
+
+
+
+ +

+publish

+
+public void publish(java.lang.String channel,
+                    org.json.JSONArray message,
+                    Callback callback)
+
+
Send a message to a channel. +

+

+
Parameters:
channel - Channel name
message - JSONOArray to be published
callback - object of sub class of Callback class
+
+
+
+ +

+publish

+
+public void publish(java.lang.String channel,
+                    java.lang.String message,
+                    Callback callback)
+
+
Send a message to a channel. +

+

+
Parameters:
channel - Channel name
message - String to be published
callback - object of sub class of Callback class
+
+
+
+ +

+publish

+
+public void publish(java.lang.String channel,
+                    java.lang.Integer message,
+                    Callback callback)
+
+
Send a message to a channel. +

+

+
Parameters:
channel - Channel name
message - Integer to be published
callback - object of sub class of Callback class
+
+
+
+ +

+publish

+
+public void publish(java.lang.String channel,
+                    java.lang.Double message,
+                    Callback callback)
+
+
Send a message to a channel. +

+

+
Parameters:
channel - Channel name
message - Double to be published
callback - object of sub class of Callback class
+
+
+
+ +

+publish

+
+public void publish(java.util.Hashtable args,
+                    Callback callback)
+
+
Send a message to a channel. +

+

+
Parameters:
args - Hashtable containing channel name, message.
callback - object of sub class of Callback class
+
+
+
+ +

+publish

+
+public void publish(java.util.Hashtable args)
+
+
Send a message to a channel. +

+

+
Parameters:
args - Hashtable containing channel name, message, callback
+
+
+
+ +

+presence

+
+public void presence(java.lang.String channel,
+                     Callback callback)
+              throws PubnubException
+
+
Listen for presence of subscribers on a channel +

+

+
Parameters:
channel - Name of the channel on which to listen for join/leave i.e. + presence events
callback - object of sub class of Callback class +
Throws: +
PubnubException - Throws PubnubException if Callback is null
+
+
+
+ +

+hereNow

+
+public void hereNow(java.lang.String channel,
+                    Callback callback)
+
+
Read presence information from a channel +

+

+
Parameters:
channel - Channel name
callback - object of sub class of Callback class
+
+
+
+ +

+history

+
+public void history(java.lang.String channel,
+                    int limit,
+                    Callback callback)
+
+
Read history from a channel. +

+

+
Parameters:
channel - Channel Name
limit - Upper limit on number of messages in response
+
+
+
+ +

+history

+
+public void history(java.util.Hashtable args)
+
+
Read history from a channel. +

+

+
Parameters:
args - Hashtable containing channel name, limit, Callback
+
+
+
+ +

+detailedHistory

+
+public void detailedHistory(java.lang.String channel,
+                            long start,
+                            long end,
+                            int count,
+                            boolean reverse,
+                            Callback callback)
+
+
Read DetailedHistory for a channel. +

+

+
Parameters:
channel - Channel name for which detailed history is required
start - Start time
end - End time
count - Upper limit on number of messages to be returned
reverse - True if messages need to be in reverse order
callback - Callback
+
+
+
+ +

+detailedHistory

+
+public void detailedHistory(java.lang.String channel,
+                            long start,
+                            boolean reverse,
+                            Callback callback)
+
+
Read DetailedHistory for a channel. +

+

+
Parameters:
channel - Channel name for which detailed history is required
start - Start time
reverse - True if messages need to be in reverse order
callback - Callback
+
+
+
+ +

+detailedHistory

+
+public void detailedHistory(java.lang.String channel,
+                            long start,
+                            long end,
+                            Callback callback)
+
+
Read DetailedHistory for a channel. +

+

+
Parameters:
channel - Channel name for which detailed history is required
start - Start time
end - End time
callback - Callback
+
+
+
+ +

+detailedHistory

+
+public void detailedHistory(java.lang.String channel,
+                            long start,
+                            long end,
+                            boolean reverse,
+                            Callback callback)
+
+
Read DetailedHistory for a channel. +

+

+
Parameters:
channel - Channel name for which detailed history is required
start - Start time
end - End time
reverse - True if messages need to be in reverse order
callback - Callback
+
+
+
+ +

+detailedHistory

+
+public void detailedHistory(java.lang.String channel,
+                            int count,
+                            boolean reverse,
+                            Callback callback)
+
+
Read DetailedHistory for a channel. +

+

+
Parameters:
channel - Channel name for which detailed history is required
count - Upper limit on number of messages to be returned
reverse - True if messages need to be in reverse order
callback - Callback
+
+
+
+ +

+detailedHistory

+
+public void detailedHistory(java.lang.String channel,
+                            boolean reverse,
+                            Callback callback)
+
+
Read DetailedHistory for a channel. +

+

+
Parameters:
channel - Channel name for which detailed history is required
reverse - True if messages need to be in reverse order
callback - Callback
+
+
+
+ +

+detailedHistory

+
+public void detailedHistory(java.lang.String channel,
+                            int count,
+                            Callback callback)
+
+
Read DetailedHistory for a channel. +

+

+
Parameters:
channel - Channel name for which detailed history is required
callback - Callback
+
+
+
+ +

+time

+
+public void time(Callback callback)
+
+
Read current time from PubNub Cloud. +

+

+
Parameters:
callback - Callback
+
+
+
+ +

+unsubscribe

+
+public void unsubscribe(java.lang.String[] channels)
+
+
Unsubscribe from channels. +

+

+
Parameters:
channels - String[] array containing channel names as string.
+
+
+
+ +

+unsubscribeAll

+
+public void unsubscribeAll()
+
+
Unsubscribe from all channel. +

+

+
+
+
+
+ +

+unsubscribePresence

+
+public void unsubscribePresence(java.lang.String channel)
+
+
Unsubscribe from presence channel. +

+

+
Parameters:
channel - channel name as String.
+
+
+
+ +

+unsubscribe

+
+public void unsubscribe(java.lang.String channel)
+
+
Unsubscribe/Disconnect from channel. +

+

+
Parameters:
channel - channel name as String.
+
+
+
+ +

+unsubscribe

+
+public void unsubscribe(java.util.Hashtable args)
+
+
Unsubscribe/Disconnect from channel. +

+

+
Parameters:
args - Hashtable containing channel name.
+
+
+
+ +

+subscribe

+
+public void subscribe(java.util.Hashtable args,
+                      Callback callback)
+               throws PubnubException
+
+
Listen for a message on a channel. +

+

+
Parameters:
args - Hashtable containing channel name
callback - Callback +
Throws: +
PubnubException - Throws PubnubException if Callback is null
+
+
+
+ +

+subscribe

+
+public void subscribe(java.util.Hashtable args)
+               throws PubnubException
+
+
Listen for a message on a channel. +

+

+
Parameters:
args - Hashtable containing channel name, callback +
Throws: +
PubnubException - Throws PubnubException if Callback is null
+
+
+
+ +

+subscribe

+
+public void subscribe(java.lang.String[] channelsArr,
+                      Callback callback)
+               throws PubnubException
+
+
Listen for a message on a channel. +

+

+
Parameters:
channelsArr - Array of channel names (string) to listen on
callback - Callback +
Throws: +
PubnubException - Throws PubnubException if Callback is null
+
+
+
+ +

+subscribe

+
+public void subscribe(java.lang.String[] channelsArr,
+                      Callback callback,
+                      java.lang.String timetoken)
+               throws PubnubException
+
+
Listen for a message on a channel. +

+

+
Parameters:
channelsArr - Array of channel names (string) to listen on
callback - Callback +
Throws: +
PubnubException - Throws PubnubException if Callback is null
+
+
+
+ +

+disconnectAndResubscribeWithTimetoken

+
+public void disconnectAndResubscribeWithTimetoken(java.lang.String timetoken)
+
+
Disconnect from all channels, and resubscribe +

+

+
+
+
+
+ +

+disconnectAndResubscribeWithTimetoken

+
+public void disconnectAndResubscribeWithTimetoken(java.lang.String timetoken,
+                                                  java.lang.String errorMessage)
+
+
Disconnect from all channels, and resubscribe +

+

+
+
+
+
+ +

+disconnectAndResubscribe

+
+public void disconnectAndResubscribe()
+
+
Disconnect from all channels, and resubscribe +

+

+
+
+
+
+ +

+disconnectAndResubscribe

+
+public void disconnectAndResubscribe(java.lang.String errorMessage)
+
+
Disconnect from all channels, and resubscribe +

+

+
+
+
+
+ +

+getSubscribedChannelsArray

+
+public java.lang.String[] getSubscribedChannelsArray()
+
+
This method returns array of channel names, currently subscribed to +

+

+ +
Returns:
Array of channel names
+
+
+
+ +

+setOrigin

+
+public void setOrigin(java.lang.String origin)
+
+
Sets origin value, default is "pubsub" +

+

+
Parameters:
origin - Origin value
+
+
+
+ +

+getAuthKey

+
+public java.lang.String getAuthKey()
+
+
This method return auth key. Return null if not set +

+

+ +
Returns:
Auth Key. null if auth key not set
+
+
+
+ +

+setAuthKey

+
+public void setAuthKey(java.lang.String authKey)
+
+
This method sets auth key. +

+

+
Parameters:
authKey - . 0 length string or null unsets auth key
+
+
+
+ +

+unsetAuthKey

+
+public void unsetAuthKey()
+
+
This method unsets auth key. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/java/doc/com/pubnub/api/PubnubError.html b/java/doc/com/pubnub/api/PubnubError.html new file mode 100644 index 000000000..759e2293e --- /dev/null +++ b/java/doc/com/pubnub/api/PubnubError.html @@ -0,0 +1,722 @@ + + + + + + +PubnubError + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +com.pubnub.api +
+Class PubnubError

+
+java.lang.Object
+  extended by com.pubnub.api.PubnubError
+
+
+
+
public class PubnubError
extends java.lang.Object
+ + +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static PubnubErrorPNERR_5000_TIMEOUT + +
+           
+static PubnubErrorPNERR_5001_ENCRYPTION_ERROR + +
+           
+static PubnubErrorPNERR_5002_ERR_DECRYPTION_ERROR + +
+           
+static PubnubErrorPNERR_5003_INVALID_JSON + +
+           
+static PubnubErrorPNERR_5004_JSON_ERROR + +
+           
+static PubnubErrorPNERR_5005_JSON_ERROR + +
+           
+static PubnubErrorPNERR_5006_MALFORMED_URL + +
+           
+static PubnubErrorPNERR_5007_PUBNUB_ERROR + +
+           
+static PubnubErrorPNERR_5008_URL_OPEN + +
+           
+static PubnubErrorPNERR_5009_PROTOCOL_EXCEPTION + +
+           
+static PubnubErrorPNERR_5010_CONNECT_EXCEPTION + +
+           
+static PubnubErrorPNERR_5011_HTTP_RC_ERROR + +
+           
+static PubnubErrorPNERR_5012_GETINPUTSTREAM + +
+           
+static PubnubErrorPNERR_5013_GETINPUTSTREAM + +
+           
+static PubnubErrorPNERR_5014_READINPUT + +
+           
+static PubnubErrorPNERR_5015_INVALID_JSON + +
+           
+static PubnubErrorPNERR_5016_BAD_REQUEST + +
+           
+static PubnubErrorPNERR_5017_HTTP_ERROR + +
+           
+static PubnubErrorPNERR_5018_HTTP_ERROR + +
+           
+static PubnubErrorPNERR_5019_HTTP_ERROR + +
+           
+static PubnubErrorPNERR_5020_BAD_GATEWAY + +
+           
+static PubnubErrorPNERR_5021_CLIENT_TIMEOUT + +
+           
+static PubnubErrorPNERR_5022_GATEWAY_TIMEOUT + +
+           
+static PubnubErrorPNERR_5023_INTERNAL_ERROR + +
+           
+static PubnubErrorPNERR_5024_DECRYPTION_ERROR + +
+           
+static PubnubErrorPNERR_5025_DECRYPTION_ERROR + +
+           
+static PubnubErrorPNERR_5026_PARSING_ERROR + +
+           
+  + + + + + + + + + + + +
+Method Summary
+ java.lang.StringtoString() + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+PNERR_5000_TIMEOUT

+
+public static final PubnubError PNERR_5000_TIMEOUT
+
+
+
+
+
+ +

+PNERR_5001_ENCRYPTION_ERROR

+
+public static final PubnubError PNERR_5001_ENCRYPTION_ERROR
+
+
+
+
+
+ +

+PNERR_5002_ERR_DECRYPTION_ERROR

+
+public static final PubnubError PNERR_5002_ERR_DECRYPTION_ERROR
+
+
+
+
+
+ +

+PNERR_5003_INVALID_JSON

+
+public static final PubnubError PNERR_5003_INVALID_JSON
+
+
+
+
+
+ +

+PNERR_5004_JSON_ERROR

+
+public static final PubnubError PNERR_5004_JSON_ERROR
+
+
+
+
+
+ +

+PNERR_5005_JSON_ERROR

+
+public static final PubnubError PNERR_5005_JSON_ERROR
+
+
+
+
+
+ +

+PNERR_5006_MALFORMED_URL

+
+public static final PubnubError PNERR_5006_MALFORMED_URL
+
+
+
+
+
+ +

+PNERR_5007_PUBNUB_ERROR

+
+public static final PubnubError PNERR_5007_PUBNUB_ERROR
+
+
+
+
+
+ +

+PNERR_5008_URL_OPEN

+
+public static final PubnubError PNERR_5008_URL_OPEN
+
+
+
+
+
+ +

+PNERR_5009_PROTOCOL_EXCEPTION

+
+public static final PubnubError PNERR_5009_PROTOCOL_EXCEPTION
+
+
+
+
+
+ +

+PNERR_5010_CONNECT_EXCEPTION

+
+public static final PubnubError PNERR_5010_CONNECT_EXCEPTION
+
+
+
+
+
+ +

+PNERR_5011_HTTP_RC_ERROR

+
+public static final PubnubError PNERR_5011_HTTP_RC_ERROR
+
+
+
+
+
+ +

+PNERR_5012_GETINPUTSTREAM

+
+public static final PubnubError PNERR_5012_GETINPUTSTREAM
+
+
+
+
+
+ +

+PNERR_5013_GETINPUTSTREAM

+
+public static final PubnubError PNERR_5013_GETINPUTSTREAM
+
+
+
+
+
+ +

+PNERR_5014_READINPUT

+
+public static final PubnubError PNERR_5014_READINPUT
+
+
+
+
+
+ +

+PNERR_5015_INVALID_JSON

+
+public static final PubnubError PNERR_5015_INVALID_JSON
+
+
+
+
+
+ +

+PNERR_5016_BAD_REQUEST

+
+public static final PubnubError PNERR_5016_BAD_REQUEST
+
+
+
+
+
+ +

+PNERR_5017_HTTP_ERROR

+
+public static final PubnubError PNERR_5017_HTTP_ERROR
+
+
+
+
+
+ +

+PNERR_5018_HTTP_ERROR

+
+public static final PubnubError PNERR_5018_HTTP_ERROR
+
+
+
+
+
+ +

+PNERR_5019_HTTP_ERROR

+
+public static final PubnubError PNERR_5019_HTTP_ERROR
+
+
+
+
+
+ +

+PNERR_5020_BAD_GATEWAY

+
+public static final PubnubError PNERR_5020_BAD_GATEWAY
+
+
+
+
+
+ +

+PNERR_5021_CLIENT_TIMEOUT

+
+public static final PubnubError PNERR_5021_CLIENT_TIMEOUT
+
+
+
+
+
+ +

+PNERR_5022_GATEWAY_TIMEOUT

+
+public static final PubnubError PNERR_5022_GATEWAY_TIMEOUT
+
+
+
+
+
+ +

+PNERR_5023_INTERNAL_ERROR

+
+public static final PubnubError PNERR_5023_INTERNAL_ERROR
+
+
+
+
+
+ +

+PNERR_5024_DECRYPTION_ERROR

+
+public static final PubnubError PNERR_5024_DECRYPTION_ERROR
+
+
+
+
+
+ +

+PNERR_5025_DECRYPTION_ERROR

+
+public static final PubnubError PNERR_5025_DECRYPTION_ERROR
+
+
+
+
+
+ +

+PNERR_5026_PARSING_ERROR

+
+public static final PubnubError PNERR_5026_PARSING_ERROR
+
+
+
+
+ + + + + + + + +
+Method Detail
+ +

+toString

+
+public java.lang.String toString()
+
+
+
Overrides:
toString in class java.lang.Object
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/java/doc/com/pubnub/api/PubnubException.html b/java/doc/com/pubnub/api/PubnubException.html new file mode 100644 index 000000000..07d2de3ae --- /dev/null +++ b/java/doc/com/pubnub/api/PubnubException.html @@ -0,0 +1,337 @@ + + + + + + +PubnubException + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +com.pubnub.api +
+Class PubnubException

+
+java.lang.Object
+  extended by java.lang.Throwable
+      extended by java.lang.Exception
+          extended by com.pubnub.api.PubnubException
+
+
+
All Implemented Interfaces:
java.io.Serializable
+
+
+
+
public class PubnubException
extends java.lang.Exception
+ + +

+PubnubException is thrown by various Pubnub APIs +

+ +

+

+
Author:
+
PubnubCore
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + + +
+Constructor Summary
PubnubException(PubnubError pubnubError) + +
+          Constructor for PubnubException Class with error message as argument
PubnubException(PubnubError pubnubError, + java.lang.String s) + +
+          Constructor for PubnubException Class with error message as argument
PubnubException(java.lang.String s) + +
+          Constructor for PubnubException Class with error message as argument
+  + + + + + + + + + + + + + + + +
+Method Summary
+ PubnubErrorgetPubnubError() + +
+           
+ java.lang.StringtoString() + +
+          Read the exception error message
+ + + + + + + +
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+PubnubException

+
+public PubnubException(java.lang.String s)
+
+
Constructor for PubnubException Class with error message as argument +

+

+
Parameters:
s - Error message
+
+
+ +

+PubnubException

+
+public PubnubException(PubnubError pubnubError)
+
+
Constructor for PubnubException Class with error message as argument +

+

+
Parameters:
pubnubError - Error message
+
+
+ +

+PubnubException

+
+public PubnubException(PubnubError pubnubError,
+                       java.lang.String s)
+
+
Constructor for PubnubException Class with error message as argument +

+

+
Parameters:
s - Error message
+
+ + + + + + + + +
+Method Detail
+ +

+toString

+
+public java.lang.String toString()
+
+
Read the exception error message +

+

+
Overrides:
toString in class java.lang.Throwable
+
+
+ +
Returns:
String
+
+
+
+ +

+getPubnubError

+
+public PubnubError getPubnubError()
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/java/doc/com/pubnub/api/PubnubUtil.html b/java/doc/com/pubnub/api/PubnubUtil.html new file mode 100644 index 000000000..a2e4b7609 --- /dev/null +++ b/java/doc/com/pubnub/api/PubnubUtil.html @@ -0,0 +1,261 @@ + + + + + + +PubnubUtil + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +com.pubnub.api +
+Class PubnubUtil

+
+java.lang.Object
+  extended by com.pubnub.api.PubnubUtilCore
+      extended by com.pubnub.api.PubnubUtil
+
+
+
+
public class PubnubUtil
extends PubnubUtilCore
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
PubnubUtil() + +
+           
+  + + + + + + + + + + + +
+Method Summary
+static java.lang.StringurlEncode(java.lang.String sUrl) + +
+          Returns encoded String
+ + + + + + + +
Methods inherited from class com.pubnub.api.PubnubUtilCore
hashtableKeysToArray, hashTableKeysToDelimitedString, joinString, splitString
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+PubnubUtil

+
+public PubnubUtil()
+
+
+ + + + + + + + +
+Method Detail
+ +

+urlEncode

+
+public static java.lang.String urlEncode(java.lang.String sUrl)
+
+
Returns encoded String +

+

+
Parameters:
sUrl - , input string +
Returns:
, encoded string
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/java/doc/com/pubnub/api/PubnubUtilCore.html b/java/doc/com/pubnub/api/PubnubUtilCore.html new file mode 100644 index 000000000..d999a7b4b --- /dev/null +++ b/java/doc/com/pubnub/api/PubnubUtilCore.html @@ -0,0 +1,334 @@ + + + + + + +PubnubUtilCore + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +com.pubnub.api +
+Class PubnubUtilCore

+
+java.lang.Object
+  extended by com.pubnub.api.PubnubUtilCore
+
+
+
Direct Known Subclasses:
PubnubUtil
+
+
+
+
public class PubnubUtilCore
extends java.lang.Object
+ + +

+

+
Author:
+
PubnubCore
+
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
PubnubUtilCore() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+static java.lang.String[]hashtableKeysToArray(java.util.Hashtable ht) + +
+          Returns string keys in a hashtable as array of string
+static java.lang.StringhashTableKeysToDelimitedString(java.util.Hashtable ht, + java.lang.String delimiter) + +
+          Returns string keys in a hashtable as delimited string
+static java.lang.StringjoinString(java.lang.String[] sourceArray, + java.lang.String delimiter) + +
+          Takes String[] of tokens, and String delimiter as input and returns + joined String
+static java.lang.String[]splitString(java.lang.String source, + java.lang.String delimiter) + +
+          Takes source and delimiter string as inputs and returns splitted string + in form of tokens in String array
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+PubnubUtilCore

+
+public PubnubUtilCore()
+
+
+ + + + + + + + +
+Method Detail
+ +

+splitString

+
+public static java.lang.String[] splitString(java.lang.String source,
+                                             java.lang.String delimiter)
+
+
Takes source and delimiter string as inputs and returns splitted string + in form of tokens in String array +

+

+
Parameters:
source - , input String
delimiter - , delimiter to split on +
Returns:
String[] , tokens in and array
+
+
+
+ +

+joinString

+
+public static java.lang.String joinString(java.lang.String[] sourceArray,
+                                          java.lang.String delimiter)
+
+
Takes String[] of tokens, and String delimiter as input and returns + joined String +

+

+
Parameters:
sourceArray - , input tokens in String array
delimiter - , delimiter to join on +
Returns:
String , string of tokens joined by delimiter
+
+
+
+ +

+hashtableKeysToArray

+
+public static java.lang.String[] hashtableKeysToArray(java.util.Hashtable ht)
+
+
Returns string keys in a hashtable as array of string +

+

+
Parameters:
ht - , Hashtable +
Returns:
, string array with hash keys string
+
+
+
+ +

+hashTableKeysToDelimitedString

+
+public static java.lang.String hashTableKeysToDelimitedString(java.util.Hashtable ht,
+                                                              java.lang.String delimiter)
+
+
Returns string keys in a hashtable as delimited string +

+

+
Parameters:
ht - , Hashtable
delimiter - , String +
Returns:
, string array with hash keys string
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/java/doc/com/pubnub/api/package-frame.html b/java/doc/com/pubnub/api/package-frame.html new file mode 100644 index 000000000..02050c758 --- /dev/null +++ b/java/doc/com/pubnub/api/package-frame.html @@ -0,0 +1,51 @@ + + + + + + +com.pubnub.api + + + + + + + + + + + +com.pubnub.api + + + + +
+Classes  + +
+Callback +
+Pubnub +
+PubnubError +
+PubnubUtil +
+PubnubUtilCore
+ + + + + + +
+Exceptions  + +
+PubnubException
+ + + + diff --git a/java/doc/com/pubnub/api/package-summary.html b/java/doc/com/pubnub/api/package-summary.html new file mode 100644 index 000000000..29d76a204 --- /dev/null +++ b/java/doc/com/pubnub/api/package-summary.html @@ -0,0 +1,185 @@ + + + + + + +com.pubnub.api + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package com.pubnub.api +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+Class Summary
CallbackAbstract class to be subclassed by objects being passed as callbacks to + Pubnub APIs Default implementation for all methods is blank
PubnubPubnub object facilitates querying channels for messages and listening on + channels for presence/message events
PubnubError 
PubnubUtil 
PubnubUtilCore 
+  + +

+ + + + + + + + + +
+Exception Summary
PubnubExceptionPubnubException is thrown by various Pubnub APIs
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/java/doc/com/pubnub/api/package-tree.html b/java/doc/com/pubnub/api/package-tree.html new file mode 100644 index 000000000..c1b36049e --- /dev/null +++ b/java/doc/com/pubnub/api/package-tree.html @@ -0,0 +1,153 @@ + + + + + + +com.pubnub.api Class Hierarchy + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package com.pubnub.api +

+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/java/doc/constant-values.html b/java/doc/constant-values.html new file mode 100644 index 000000000..8ed60e159 --- /dev/null +++ b/java/doc/constant-values.html @@ -0,0 +1,142 @@ + + + + + + +Constant Field Values + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Constant Field Values

+
+
+Contents
    +
+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/java/doc/deprecated-list.html b/java/doc/deprecated-list.html new file mode 100644 index 000000000..9fd6b91c9 --- /dev/null +++ b/java/doc/deprecated-list.html @@ -0,0 +1,142 @@ + + + + + + +Deprecated List + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Deprecated API

+
+
+Contents
    +
+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/java/doc/help-doc.html b/java/doc/help-doc.html new file mode 100644 index 000000000..648f649cd --- /dev/null +++ b/java/doc/help-doc.html @@ -0,0 +1,209 @@ + + + + + + +API Help + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+How This API Document Is Organized

+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

+Package

+
+ +

+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    +
  • Interfaces (italic)
  • Classes
  • Enums
  • Exceptions
  • Errors
  • Annotation Types
+
+

+Class/Interface

+
+ +

+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description +

    +

  • Nested Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary +

    +

  • Field Detail
  • Constructor Detail
  • Method Detail
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+ +

+Annotation Type

+
+ +

+Each annotation type has its own separate page with the following sections:

    +
  • Annotation Type declaration
  • Annotation Type description
  • Required Element Summary
  • Optional Element Summary
  • Element Detail
+
+ +

+Enum

+
+ +

+Each enum has its own separate page with the following sections:

    +
  • Enum declaration
  • Enum description
  • Enum Constant Summary
  • Enum Constant Detail
+
+

+Tree (Class Hierarchy)

+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    +
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+

+Deprecated API

+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+

+Index

+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+

+Prev/Next

+These links take you to the next or previous class, interface, package, or related page.

+Frames/No Frames

+These links show and hide the HTML frames. All pages are available with or without frames. +

+

+Serialized Form

+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +

+

+Constant Field Values

+The Constant Field Values page lists the static final fields and their values. +

+ + +This help file applies to API documentation generated using the standard doclet. + +
+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/java/doc/index-all.html b/java/doc/index-all.html new file mode 100644 index 000000000..596a047c3 --- /dev/null +++ b/java/doc/index-all.html @@ -0,0 +1,356 @@ + + + + + + +Index + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +C D E G H J P R S T U
+

+C

+
+
Callback - Class in com.pubnub.api
Abstract class to be subclassed by objects being passed as callbacks to + Pubnub APIs Default implementation for all methods is blank
Callback() - +Constructor for class com.pubnub.api.Callback +
  +
com.pubnub.api - package com.pubnub.api
 
connectCallback(String, Object) - +Method in class com.pubnub.api.Callback +
This callback will be invoked on getting connected to a channel +
+
+

+D

+
+
disconnectCallback(String, Object) - +Method in class com.pubnub.api.Callback +
This callback is invoked on getting disconnected from a channel +
+
+

+E

+
+
errorCallback(String, Object) - +Method in class com.pubnub.api.Callback +
This callback will be invoked when an error occurs +
+
+

+G

+
+
getPubnubError() - +Method in exception com.pubnub.api.PubnubException +
  +
+
+

+H

+
+
hashtableKeysToArray(Hashtable) - +Static method in class com.pubnub.api.PubnubUtilCore +
Returns string keys in a hashtable as array of string +
hashTableKeysToDelimitedString(Hashtable, String) - +Static method in class com.pubnub.api.PubnubUtilCore +
Returns string keys in a hashtable as delimited string +
+
+

+J

+
+
joinString(String[], String) - +Static method in class com.pubnub.api.PubnubUtilCore +
Takes String[] of tokens, and String delimiter as input and returns + joined String +
+
+

+P

+
+
PNERR_5000_TIMEOUT - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5001_ENCRYPTION_ERROR - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5002_ERR_DECRYPTION_ERROR - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5003_INVALID_JSON - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5004_JSON_ERROR - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5005_JSON_ERROR - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5006_MALFORMED_URL - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5007_PUBNUB_ERROR - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5008_URL_OPEN - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5009_PROTOCOL_EXCEPTION - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5010_CONNECT_EXCEPTION - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5011_HTTP_RC_ERROR - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5012_GETINPUTSTREAM - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5013_GETINPUTSTREAM - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5014_READINPUT - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5015_INVALID_JSON - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5016_BAD_REQUEST - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5017_HTTP_ERROR - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5018_HTTP_ERROR - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5019_HTTP_ERROR - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5020_BAD_GATEWAY - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5021_CLIENT_TIMEOUT - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5022_GATEWAY_TIMEOUT - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5023_INTERNAL_ERROR - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5024_DECRYPTION_ERROR - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5025_DECRYPTION_ERROR - +Static variable in class com.pubnub.api.PubnubError +
  +
PNERR_5026_PARSING_ERROR - +Static variable in class com.pubnub.api.PubnubError +
  +
Pubnub - Class in com.pubnub.api
Pubnub object facilitates querying channels for messages and listening on + channels for presence/message events
Pubnub(String, String, String, String, boolean) - +Constructor for class com.pubnub.api.Pubnub +
Pubnub Constructor +
Pubnub(String, String, String, boolean) - +Constructor for class com.pubnub.api.Pubnub +
Pubnub Constructor +
Pubnub(String, String) - +Constructor for class com.pubnub.api.Pubnub +
Pubnub Constructor +
Pubnub(String, String, boolean) - +Constructor for class com.pubnub.api.Pubnub +
  +
Pubnub(String, String, String) - +Constructor for class com.pubnub.api.Pubnub +
  +
PubnubError - Class in com.pubnub.api
 
PubnubException - Exception in com.pubnub.api
PubnubException is thrown by various Pubnub APIs
PubnubException(String) - +Constructor for exception com.pubnub.api.PubnubException +
Constructor for PubnubException Class with error message as argument +
PubnubException(PubnubError) - +Constructor for exception com.pubnub.api.PubnubException +
Constructor for PubnubException Class with error message as argument +
PubnubException(PubnubError, String) - +Constructor for exception com.pubnub.api.PubnubException +
Constructor for PubnubException Class with error message as argument +
PubnubUtil - Class in com.pubnub.api
 
PubnubUtil() - +Constructor for class com.pubnub.api.PubnubUtil +
  +
PubnubUtilCore - Class in com.pubnub.api
 
PubnubUtilCore() - +Constructor for class com.pubnub.api.PubnubUtilCore +
  +
+
+

+R

+
+
reconnectCallback(String, Object) - +Method in class com.pubnub.api.Callback +
This callback is invoked on getting reconnected to a channel after + getting disconnected +
+
+

+S

+
+
setNonSubscribeTimeout(int) - +Method in class com.pubnub.api.Pubnub +
This method set timeout value for non subscribe operations like publish, + history, hereNow. +
setSubscribeTimeout(int) - +Method in class com.pubnub.api.Pubnub +
This method sets timeout value for subscribe/presence. +
setUUID(UUID) - +Method in class com.pubnub.api.Pubnub +
Sets value for UUID +
splitString(String, String) - +Static method in class com.pubnub.api.PubnubUtilCore +
Takes source and delimiter string as inputs and returns splitted string + in form of tokens in String array +
successCallback(String, Object) - +Method in class com.pubnub.api.Callback +
This callback will be invoked when a message is received on the channel +
+
+

+T

+
+
toString() - +Method in class com.pubnub.api.PubnubError +
  +
toString() - +Method in exception com.pubnub.api.PubnubException +
Read the exception error message +
+
+

+U

+
+
urlEncode(String) - +Static method in class com.pubnub.api.PubnubUtil +
Returns encoded String +
+
+C D E G H J P R S T U + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/java/doc/index.html b/java/doc/index.html new file mode 100644 index 000000000..f0d7ac961 --- /dev/null +++ b/java/doc/index.html @@ -0,0 +1,36 @@ + + + + + + +Generated Documentation (Untitled) + + + + + + + + +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="com/pubnub/api/package-summary.html">Non-frame version.</A> + + + diff --git a/java/doc/overview-tree.html b/java/doc/overview-tree.html new file mode 100644 index 000000000..9a54560b1 --- /dev/null +++ b/java/doc/overview-tree.html @@ -0,0 +1,155 @@ + + + + + + +Class Hierarchy + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For All Packages

+
+
+
Package Hierarchies:
com.pubnub.api
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/java/doc/package-list b/java/doc/package-list new file mode 100644 index 000000000..2970ef510 --- /dev/null +++ b/java/doc/package-list @@ -0,0 +1 @@ +com.pubnub.api diff --git a/java/doc/resources/inherit.gif b/java/doc/resources/inherit.gif new file mode 100644 index 000000000..c814867a1 Binary files /dev/null and b/java/doc/resources/inherit.gif differ diff --git a/java/doc/serialized-form.html b/java/doc/serialized-form.html new file mode 100644 index 000000000..f33ed2164 --- /dev/null +++ b/java/doc/serialized-form.html @@ -0,0 +1,184 @@ + + + + + + +Serialized Form + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Serialized Form

+
+
+ + + + + +
+Package com.pubnub.api
+ +

+ + + + + +
+Class com.pubnub.api.PubnubException extends java.lang.Exception implements Serializable
+ +

+ + + + + +
+Serialized Fields
+ +

+errormsg

+
+java.lang.String errormsg
+
+
+
+
+
+

+pubnubError

+
+PubnubError pubnubError
+
+
+
+
+ +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/java/doc/stylesheet.css b/java/doc/stylesheet.css new file mode 100644 index 000000000..6ea9e5161 --- /dev/null +++ b/java/doc/stylesheet.css @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF; color:#000000 } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ +.TableRowColor { background: #FFFFFF; color:#000000 } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} + diff --git a/java/examples/src/com/pubnub/examples/PubnubDemoConsole.java b/java/examples/src/com/pubnub/examples/PubnubDemoConsole.java new file mode 100644 index 000000000..720afcfd6 --- /dev/null +++ b/java/examples/src/com/pubnub/examples/PubnubDemoConsole.java @@ -0,0 +1,379 @@ +package com.pubnub.examples; + +import java.util.Hashtable; +import java.util.Scanner; + +import org.json.JSONArray; +import org.json.JSONObject; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; +import com.pubnub.api.PubnubException; +import com.pubnub.api.PubnubUtil; + +public class PubnubDemoConsole { + + Pubnub pubnub; + String publish_key = "demo"; + String subscribe_key = "demo"; + String secret_key = "demo"; + String cipher_key = ""; + boolean SSL; + Scanner reader; + + private void notifyUser(Object message) { + System.out.println(message.toString()); + } + + private void publish(String channel) { + System.out + .println("Enter the message for publish. To exit loop enter QUIT"); + String message = ""; + + while (true) { + Hashtable args = new Hashtable(2); + message = reader.nextLine(); + if (message.equalsIgnoreCase("QUIT")) { + break; + } + if (args.get("message") == null) { + try { + Integer i = Integer.parseInt(message); + args.put("message", i); + } catch (Exception e) { + + } + } + if (args.get("message") == null) { + try { + Double d = Double.parseDouble(message); + args.put("message", d); + } catch (Exception e) { + + } + } + if (args.get("message") == null) { + try { + JSONArray js = new JSONArray(message); + args.put("message", js); + } catch (Exception e) { + + } + } + if (args.get("message") == null) { + try { + JSONObject js = new JSONObject(message); + args.put("message", js); + } catch (Exception e) { + + } + } + if (args.get("message") == null) { + args.put("message", message); + } + + args.put("channel", channel); // Channel Name + pubnub.publish(args, new Callback() { + public void successCallback(String channel, Object message) { + notifyUser("PUBLISH : " + message); + } + + public void errorCallback(String channel, Object message) { + notifyUser("PUBLISH : " + message); + } + }); + } + + } + + private void subscribe(String channel) { + Hashtable args = new Hashtable(6); + args.put("channel", channel); + + try { + pubnub.subscribe(args, new Callback() { + public void connectCallback(String channel, Object message) { + notifyUser("SUBSCRIBE : CONNECT on channel:" + channel + + " : " + message.getClass() + " : " + + message.toString()); + } + + public void disconnectCallback(String channel, Object message) { + notifyUser("SUBSCRIBE : DISCONNECT on channel:" + + channel + " : " + message.getClass() + " : " + + message.toString()); + } + + public void reconnectCallback(String channel, Object message) { + notifyUser("SUBSCRIBE : RECONNECT on channel:" + channel + + " : " + message.getClass() + " : " + + message.toString()); + } + + public void successCallback(String channel, Object message) { + notifyUser("SUBSCRIBE : " + channel + " : " + + message.getClass() + " : " + message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser("SUBSCRIBE : ERROR on channel " + channel + + " : " + message.getClass() + " : " + + message.toString()); + } + }); + + } catch (Exception e) { + } + } + + private void presence(String channel) { + try { + pubnub.presence(channel, new Callback() { + public void successCallback(String channel, Object message) { + notifyUser("PRESENCE : " + message); + } + + public void errorCallback(String channel, Object message) { + notifyUser("PRESENCE : " + message); + } + }); + } catch (PubnubException e) { + + } + } + + private void detailedHistory(String channel) { + pubnub.detailedHistory(channel, 2, new Callback() { + public void successCallback(String channel, Object message) { + notifyUser("DETAILED HISTORY : " + message); + } + + public void errorCallback(String channel, Object message) { + notifyUser("DETAILED HISTORY : " + message); + } + }); + } + + private void hereNow(String channel) { + pubnub.hereNow(channel, new Callback() { + public void successCallback(String channel, Object message) { + notifyUser("HERE NOW : " + message); + } + + public void errorCallback(String channel, Object message) { + notifyUser("HERE NOW : " + message); + } + }); + } + + private void unsubscribe(String channel) { + pubnub.unsubscribe(channel); + } + + private void unsubscribePresence(String channel) { + pubnub.unsubscribePresence(channel); + } + + private void time() { + pubnub.time(new Callback() { + public void successCallback(String channel, Object message) { + notifyUser("TIME : " + message); + } + + public void errorCallback(String channel, Object message) { + notifyUser("TIME : " + message); + } + }); + } + + private void disconnectAndResubscribe() { + pubnub.disconnectAndResubscribe("Disconnect and Resubscribe Sent from Demo Console"); + + } + + private void disconnectAndResubscribeWithTimetoken(String timetoken) { + pubnub.disconnectAndResubscribeWithTimetoken(timetoken, "Disconnect and Resubscribe Sent from Demo Console"); + + } + + public void startDemo() { + reader = new Scanner(System.in); + System.out.println("HINT:\tTo test Re-connect and catch-up"); + System.out + .println("\tDisconnect your machine from network/internet and"); + System.out.println("\tre-connect your machine after sometime"); + + System.out.println("Enable SSL ? Enter Y for Yes, else N"); + String sslOn = reader.nextLine(); + System.out.println(sslOn); + this.SSL = (sslOn.equalsIgnoreCase("y")) ? true : false; + if (this.SSL) { + System.out.println("SSL enabled"); + } else { + System.out.println("SSL not enabled"); + } + + System.out.println("Enter cipher key for encryption feature"); + System.out + .println("If you don't want to avail at this time, press ENTER"); + this.cipher_key = reader.nextLine(); + if (this.cipher_key.length() == 0) { + System.out.println("No Cipher key provided"); + pubnub = new Pubnub(this.publish_key, this.subscribe_key, this.secret_key, this.SSL); + } else { + System.out.println("Cipher Key = " + this.cipher_key); + pubnub = new Pubnub(this.publish_key, this.subscribe_key, this.secret_key, this.cipher_key, + this.SSL); + } + + displayMenuOptions(); + + String channelName = null; + int command = 0; + while ((command = reader.nextInt()) != 9) { + reader.nextLine(); + switch (command) { + + case 0: + displayMenuOptions(); + case 1: + System.out.println("Subscribe: Enter Channel name"); + channelName = reader.nextLine(); + subscribe(channelName); + System.out.println("Subscribed to following channels: "); + System.out.println(PubnubUtil.joinString( + pubnub.getSubscribedChannelsArray(), " : ")); + break; + case 2: + System.out.println("Publish: Enter Channel name"); + channelName = reader.nextLine(); + publish(channelName); + break; + case 3: + System.out.println("Presence: Enter Channel name"); + channelName = reader.nextLine(); + presence(channelName); + break; + case 4: + System.out.println("Detailed History: Enter Channel name"); + channelName = reader.nextLine(); + detailedHistory(channelName); + break; + case 5: + System.out.println("Here Now : Enter Channel name"); + channelName = reader.nextLine(); + hereNow(channelName); + break; + case 6: + System.out.println("Unsubscribe: Enter Channel name"); + channelName = reader.nextLine(); + unsubscribe(channelName); + break; + case 7: + System.out.println("UnsubscribePresence : Enter Channel name"); + channelName = reader.nextLine(); + unsubscribePresence(channelName); + break; + case 8: + time(); + break; + case 10: + disconnectAndResubscribe(); + break; + case 11: + System.out.println("Disconnect and Resubscribe with timetoken : Enter timetoken"); + String timetoken = reader.nextLine(); + disconnectAndResubscribeWithTimetoken(timetoken); + break; + case 12: + pubnub.setResumeOnReconnect(pubnub.isResumeOnReconnect() ? false + : true); + System.out.println("RESUME ON RECONNECT : " + + pubnub.isResumeOnReconnect()); + break; + case 13: + System.out.println("Set Max Retries: Enter max retries"); + int maxRetries = reader.nextInt(); + reader.nextLine(); + setMaxRetries(maxRetries); + break; + case 14: + System.out.println("Set Retry Interval: Enter retry interval"); + int retryInterval = reader.nextInt(); + reader.nextLine(); + setRetryInterval(retryInterval); + break; + case 15: + System.out.println("Set Subscribe Timeout: Enter subscribe timeout in milliseconds"); + int subscribeTimeout = reader.nextInt(); + reader.nextLine(); + setSubscribeTimeout(subscribeTimeout); + break; + case 16: + System.out.println("Set Non subscribe Timeout: Enter non subscribe timeout in milliseconds"); + int nonSubscribeTimeout = reader.nextInt(); + reader.nextLine(); + setNonSubscribeTimeout(nonSubscribeTimeout); + break; + case 17: + System.out.println("Set/Unset Auth Key: Enter auth key string. Enter blank for unsetting key"); + String authKey = reader.nextLine(); + pubnub.setAuthKey(authKey); + break; + default: + System.out.println("Invalid Input"); + } + displayMenuOptions(); + } + System.out.println("Exiting"); + pubnub.shutdown(); + + } + + private void setMaxRetries(int maxRetries) { + pubnub.setMaxRetries(maxRetries); + } + + private void setRetryInterval(int retryInterval) { + pubnub.setRetryInterval(retryInterval); + } + + private void setSubscribeTimeout(int subscribeTimeout) { + pubnub.setSubscribeTimeout(subscribeTimeout); + } + + private void setNonSubscribeTimeout(int nonSubscribeTimeout) { + pubnub.setNonSubscribeTimeout(nonSubscribeTimeout); + } + + private void displayMenuOptions() { + System.out.println("ENTER 1 FOR Subscribe " + + "(Currently subscribed to " + + this.pubnub.getCurrentlySubscribedChannelNames() + ")"); + System.out.println("ENTER 2 FOR Publish"); + System.out.println("ENTER 3 FOR Presence"); + System.out.println("ENTER 4 FOR Detailed History"); + System.out.println("ENTER 5 FOR Here_Now"); + System.out.println("ENTER 6 FOR Unsubscribe"); + System.out.println("ENTER 7 FOR Presence-Unsubscribe"); + System.out.println("ENTER 8 FOR Time"); + System.out.println("ENTER 9 FOR EXIT OR QUIT"); + System.out.println("ENTER 10 FOR Disconnect-And-Resubscribe"); + System.out.println("ENTER 11 FOR Disconnect-And-Resubscribe with timetoken"); + System.out.println("ENTER 12 FOR Toggle Resume On Reconnect"); + System.out.println("ENTER 13 FOR Setting MAX Retries"); + System.out.println("ENTER 14 FOR Setting Retry Interval"); + System.out.println("ENTER 15 FOR Setting Subscribe Timeout"); + System.out.println("ENTER 16 FOR Setting Non Subscribe Timeout"); + System.out.println("ENTER 17 FOR Setting/Unsetting auth key1"); + System.out.println("\nENTER 0 to display this menu"); + } + + /** + * @param args + */ + public static void main(String[] args) { + new PubnubDemoConsole().startDemo(); + } + +} diff --git a/java/examples/src/com/pubnub/examples/PubnubPublishTest.java b/java/examples/src/com/pubnub/examples/PubnubPublishTest.java new file mode 100644 index 000000000..e92b8b878 --- /dev/null +++ b/java/examples/src/com/pubnub/examples/PubnubPublishTest.java @@ -0,0 +1,163 @@ +package com.pubnub.examples; + +import java.util.Hashtable; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; +import com.pubnub.api.PubnubException; + +public class PubnubPublishTest { + + String channel = "pubnub_java_api"; + String channel_enc = "pubnub_java_api_enc"; + + Pubnub _pubnub; + Pubnub _pubnub_enc; + + Object[] messages; + + public PubnubPublishTest() { + _pubnub = new Pubnub("demo", "demo", false); + _pubnub_enc = new Pubnub("demo", "demo", "demo", "demo", false); + messages = new Object[3]; + messages[0] = "This is a string message"; + JSONArray jsarr = new JSONArray(); + jsarr.put("This is json array"); + jsarr.put("One more entry in json array"); + messages[1] = jsarr; + JSONObject jsobj = new JSONObject(); + try { + jsobj.put("msg1", "Hi"); + jsobj.put("msg2", "Java"); + } catch (JSONException e) { + e.printStackTrace(); + } + messages[2] = jsobj; + } + + /** + * @param params + */ + public static void main(String[] params) { + + PubnubPublishTest ppt = new PubnubPublishTest(); + ppt.runSubscribe(); + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + } + ppt.runPublish(); + ppt.runHistory(); + ppt.runDetailedHistory(); + try { + Thread.sleep(20000); + } catch (InterruptedException e) { + } + ppt._pubnub.shutdown(); + ppt._pubnub_enc.shutdown(); + } + + public void runSubscribe() { + try { + _pubnub.subscribe(new String[] { channel }, new Callback() { + public void successCallback(String channel, Object message) { + notifyUser("RECV : " + channel + " : " + message.getClass() + + " : " + message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser("RECV : " + channel + " : " + message.getClass() + + " : " + message.toString()); + } + + }); + _pubnub_enc.subscribe(new String[] { channel_enc }, new Callback() { + public void successCallback(String channel, Object message) { + notifyUser("RECV : " + channel + " : " + message.getClass() + + " : " + message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser("RECV : " + channel + " : " + message.getClass() + + " : " + message.toString()); + } + }); + + } catch (PubnubException e) { + e.printStackTrace(); + } + + } + + public void runPublish() { + for (int i = 0; i < 3; i++) { + publish(_pubnub, channel, messages[i]); + publish(_pubnub_enc, channel_enc, messages[i]); + } + } + + public void runHistory() { + history(_pubnub, channel); + history(_pubnub_enc, channel_enc); + } + + public void runDetailedHistory() { + detailedHistory(_pubnub, channel); + detailedHistory(_pubnub_enc, channel_enc); + } + + private static void notifyUser(Object message) { + System.out.println(message.toString()); + } + + public void publish(Pubnub pubnub, String channel, final Object msg) { + Hashtable args = new Hashtable(2); + args.put("channel", channel); // Channel Name + args.put("message", msg); // JSON Message + pubnub.publish(args, new Callback() { + public void successCallback(String channel, Object message) { + notifyUser("SENT : " + channel + " : " + msg.getClass() + " : " + + message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser("SENT : " + channel + " : " + msg.getClass() + " : " + + message.toString()); + } + }); + } + + public void history(Pubnub pubnub, String channel) { + + pubnub.history(channel, 10, new Callback() { + public void successCallback(String channel, Object message) { + notifyUser("HISTORY : " + channel + " : " + message.getClass() + + " : " + message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser("HISTORY : " + channel + " : " + message.getClass() + + " : " + message.toString()); + } + }); + } + + public void detailedHistory(Pubnub pubnub, String channel) { + + pubnub.detailedHistory(channel, 10, new Callback() { + public void successCallback(String channel, Object message) { + notifyUser("DETAILED HISTORY : " + channel + " : " + + message.getClass() + " : " + message.toString()); + } + + public void errorCallback(String channel, Object message) { + notifyUser("DETAILED HISTORY : " + channel + " : " + + message.getClass() + " : " + message.toString()); + } + }); + } +} diff --git a/java/examples/src/com/pubnub/examples/PubnubTestClient.java b/java/examples/src/com/pubnub/examples/PubnubTestClient.java new file mode 100644 index 000000000..bce42d911 --- /dev/null +++ b/java/examples/src/com/pubnub/examples/PubnubTestClient.java @@ -0,0 +1,75 @@ +package com.pubnub.examples; + +import java.util.Hashtable; + +import com.pubnub.api.Callback; +import com.pubnub.api.Pubnub; + +public class PubnubTestClient { + Pubnub pubnub; + int recvSuccess; + int recvErrors; + int sendSuccess; + int sendErrors; + + PubnubTestClient() { + pubnub = new Pubnub("demo", "demo", "demo", false); + } + + public void runTest() { + Hashtable args = new Hashtable(); + args.put("channel", "TestClientChannel"); + try { + pubnub.subscribe(args, new Callback() { + + public void successCallback(String channel, Object message) { + recvSuccess++; + } + + public void errorCallback(String channel, Object message) { + recvErrors++; + } + }); + + } catch (Exception e) { + + } + Callback publishCb = new Callback() { + public void successCallback(String channel, Object message) { + sendSuccess++; + } + + public void errorCallback(String channel, Object message) { + System.out.println(message.toString()); + sendErrors++; + } + }; + args.put("message", "Test Client Message"); + for (int i = 0; i < 10; i++) { + pubnub.publish(args, publishCb); + try { + Thread.sleep(100); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println("Send Success : " + sendSuccess); + System.out.println("Send Errors : " + sendErrors); + System.out.println("Receive Success : " + recvSuccess); + System.out.println("Receive Errors : " + recvErrors); + } + System.out.println("Send Success : " + sendSuccess); + System.out.println("Send Errors : " + sendErrors); + System.out.println("Receive Success : " + recvSuccess); + System.out.println("Receive Errors : " + recvErrors); + + } + + /** + * @param args + */ + public static void main(String[] args) { + new PubnubTestClient().runTest(); + + } + +} diff --git a/java/jars/Pubnub-UnitTests-3.5.1.jar b/java/jars/Pubnub-UnitTests-3.5.1.jar new file mode 100644 index 000000000..a0cd22182 Binary files /dev/null and b/java/jars/Pubnub-UnitTests-3.5.1.jar differ diff --git a/java/jars/Pubnub-UnitTests-3.6.0.jar b/java/jars/Pubnub-UnitTests-3.6.0.jar new file mode 100644 index 000000000..b8cd9af3c Binary files /dev/null and b/java/jars/Pubnub-UnitTests-3.6.0.jar differ diff --git a/java/jars/Pubnub-UnitTests-3.6.1.jar b/java/jars/Pubnub-UnitTests-3.6.1.jar new file mode 100644 index 000000000..667683b49 Binary files /dev/null and b/java/jars/Pubnub-UnitTests-3.6.1.jar differ diff --git a/java/jars/Pubnub-UnitTests-3.6.2.jar b/java/jars/Pubnub-UnitTests-3.6.2.jar new file mode 100644 index 000000000..1b2bb1b2a Binary files /dev/null and b/java/jars/Pubnub-UnitTests-3.6.2.jar differ diff --git a/java/jars/Pubnub-UnitTests-3.6.3.jar b/java/jars/Pubnub-UnitTests-3.6.3.jar new file mode 100644 index 000000000..425ea263f Binary files /dev/null and b/java/jars/Pubnub-UnitTests-3.6.3.jar differ diff --git a/java/jars/Pubnub-UnitTests-3.7.0.jar b/java/jars/Pubnub-UnitTests-3.7.0.jar new file mode 100644 index 000000000..4287a7064 Binary files /dev/null and b/java/jars/Pubnub-UnitTests-3.7.0.jar differ diff --git a/java/jars/Pubnub-UnitTests-3.8.0.jar b/java/jars/Pubnub-UnitTests-3.8.0.jar new file mode 100644 index 000000000..19386258c Binary files /dev/null and b/java/jars/Pubnub-UnitTests-3.8.0.jar differ diff --git a/java/jars/Pubnub-UnitTests-3.8.1.jar b/java/jars/Pubnub-UnitTests-3.8.1.jar new file mode 100644 index 000000000..a6d732132 Binary files /dev/null and b/java/jars/Pubnub-UnitTests-3.8.1.jar differ diff --git a/java/jars/Pubnub-UnitTests-3.9.0.jar b/java/jars/Pubnub-UnitTests-3.9.0.jar new file mode 100644 index 000000000..c95c8b047 Binary files /dev/null and b/java/jars/Pubnub-UnitTests-3.9.0.jar differ diff --git a/java/jars/Pubnub-UnitTests-4.0.0.jar b/java/jars/Pubnub-UnitTests-4.0.0.jar new file mode 100644 index 000000000..41e5de63d Binary files /dev/null and b/java/jars/Pubnub-UnitTests-4.0.0.jar differ diff --git a/java/jars/Pubnub-UnitTests-5.0.0.jar b/java/jars/Pubnub-UnitTests-5.0.0.jar new file mode 100644 index 000000000..7be9e75e8 Binary files /dev/null and b/java/jars/Pubnub-UnitTests-5.0.0.jar differ diff --git a/java/jars/PubnubDemoConsole.jar b/java/jars/PubnubDemoConsole.jar new file mode 100644 index 000000000..1563a546f Binary files /dev/null and b/java/jars/PubnubDemoConsole.jar differ diff --git a/java/jars/PubnubExample.jar b/java/jars/PubnubExample.jar new file mode 100644 index 000000000..6d1848df1 Binary files /dev/null and b/java/jars/PubnubExample.jar differ diff --git a/java/libs/bcprov-jdk15on-1.47.jar b/java/libs/bcprov-jdk15on-1.47.jar new file mode 100644 index 000000000..0b80922e6 Binary files /dev/null and b/java/libs/bcprov-jdk15on-1.47.jar differ diff --git a/java/libs/hamcrest-all-1.3.jar b/java/libs/hamcrest-all-1.3.jar new file mode 100644 index 000000000..6f62ba00c Binary files /dev/null and b/java/libs/hamcrest-all-1.3.jar differ diff --git a/java/libs/json-20090211.jar b/java/libs/json-20090211.jar new file mode 100644 index 000000000..9f37e0dc5 Binary files /dev/null and b/java/libs/json-20090211.jar differ diff --git a/java/libs/junit-4.11.jar b/java/libs/junit-4.11.jar new file mode 100644 index 000000000..aaf744484 Binary files /dev/null and b/java/libs/junit-4.11.jar differ diff --git a/java/libs/log4j-1.2.17.jar b/java/libs/log4j-1.2.17.jar new file mode 100644 index 000000000..068867ebf Binary files /dev/null and b/java/libs/log4j-1.2.17.jar differ diff --git a/java/libs/org/eclipse/jdt/internal/jarinjarloader/JIJConstants.class b/java/libs/org/eclipse/jdt/internal/jarinjarloader/JIJConstants.class new file mode 100644 index 000000000..b0872594c Binary files /dev/null and b/java/libs/org/eclipse/jdt/internal/jarinjarloader/JIJConstants.class differ diff --git a/java/libs/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader$ManifestInfo.class b/java/libs/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader$ManifestInfo.class new file mode 100644 index 000000000..d54898040 Binary files /dev/null and b/java/libs/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader$ManifestInfo.class differ diff --git a/java/libs/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader.class b/java/libs/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader.class new file mode 100644 index 000000000..d3b7c8aac Binary files /dev/null and b/java/libs/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader.class differ diff --git a/java/libs/org/eclipse/jdt/internal/jarinjarloader/RsrcURLConnection.class b/java/libs/org/eclipse/jdt/internal/jarinjarloader/RsrcURLConnection.class new file mode 100644 index 000000000..3343bf373 Binary files /dev/null and b/java/libs/org/eclipse/jdt/internal/jarinjarloader/RsrcURLConnection.class differ diff --git a/java/libs/org/eclipse/jdt/internal/jarinjarloader/RsrcURLStreamHandler.class b/java/libs/org/eclipse/jdt/internal/jarinjarloader/RsrcURLStreamHandler.class new file mode 100644 index 000000000..2857910f9 Binary files /dev/null and b/java/libs/org/eclipse/jdt/internal/jarinjarloader/RsrcURLStreamHandler.class differ diff --git a/java/libs/org/eclipse/jdt/internal/jarinjarloader/RsrcURLStreamHandlerFactory.class b/java/libs/org/eclipse/jdt/internal/jarinjarloader/RsrcURLStreamHandlerFactory.class new file mode 100644 index 000000000..10277711a Binary files /dev/null and b/java/libs/org/eclipse/jdt/internal/jarinjarloader/RsrcURLStreamHandlerFactory.class differ diff --git a/java/libs/slf4j-api-1.7.5.jar b/java/libs/slf4j-api-1.7.5.jar new file mode 100644 index 000000000..8f004d390 Binary files /dev/null and b/java/libs/slf4j-api-1.7.5.jar differ diff --git a/java/libs/slf4j-log4j12-1.7.5.jar b/java/libs/slf4j-log4j12-1.7.5.jar new file mode 100644 index 000000000..f5298b5e9 Binary files /dev/null and b/java/libs/slf4j-log4j12-1.7.5.jar differ diff --git a/java/libs/slf4j-nop-1.7.5.jar b/java/libs/slf4j-nop-1.7.5.jar new file mode 100644 index 000000000..42f5c15a0 Binary files /dev/null and b/java/libs/slf4j-nop-1.7.5.jar differ diff --git a/java/libs/slf4j-simple-1.7.5.jar b/java/libs/slf4j-simple-1.7.5.jar new file mode 100644 index 000000000..eca11dd41 Binary files /dev/null and b/java/libs/slf4j-simple-1.7.5.jar differ diff --git a/java/pom.xml b/java/pom.xml new file mode 100644 index 000000000..5f303a668 --- /dev/null +++ b/java/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + + com.pubnub + pubnub + 5.0.0 + + jar + pubnub + PubNub is a cross-platform client-to-client (1:1 and 1:many) push service in the cloud, capable of broadcasting real-time messages to millions of web and mobile clients simultaneously, in less than a quarter second! + https://github.com/pubnub/java + + + https://github.com/pubnub/pubnub-api/blob/master/LICENSE + repo + + + + https://github.com/pubnub/java + scm:git:git://github.com/pubnub/java.git + + + + pubnub + Pubnub Inc. + support@pubnub.com + http://www.pubnub.com + + + + + + org.json + json + 5.0.0 + + + log4j + log4j + 5.0.0 + + + org.bouncycastle + bcprov-jdk16 + 5.0.0 + + + diff --git a/java/src/com/pubnub/api/Pubnub.java b/java/src/com/pubnub/api/Pubnub.java new file mode 100644 index 000000000..a62ffb4ee --- /dev/null +++ b/java/src/com/pubnub/api/Pubnub.java @@ -0,0 +1,123 @@ +package com.pubnub.api; + +import java.util.UUID; + +/** + * Pubnub object facilitates querying channels for messages and listening on + * channels for presence/message events + * + * @author Pubnub + * + */ + +public class Pubnub extends PubnubCore { + + /** + * Pubnub Constructor + * + * @param publish_key + * Publish Key + * @param subscribe_key + * Subscribe Key + * @param secret_key + * Secret Key + * @param cipher_key + * Cipher Key + * @param ssl_on + * SSL on ? + */ + public Pubnub(String publish_key, String subscribe_key, String secret_key, + String cipher_key, boolean ssl_on) { + super(publish_key, subscribe_key, secret_key, cipher_key, ssl_on); + } + + /** + * Pubnub Constructor + * + * @param publish_key + * Publish key + * @param subscribe_key + * Subscribe Key + * @param secret_key + * Secret Key + * @param ssl_on + * SSL on ? + */ + public Pubnub(String publish_key, String subscribe_key, String secret_key, + boolean ssl_on) { + super(publish_key, subscribe_key, secret_key, "", ssl_on); + } + + /** + * Pubnub Constructor + * + * @param publish_key + * Publish Key + * @param subscribe_key + * Subscribe Key + */ + public Pubnub(String publish_key, String subscribe_key) { + super(publish_key, subscribe_key, "", "", false); + } + + /** + * @param publish_key + * Publish Key + * @param subscribe_key + * Subscribe Key + * @param ssl + */ + public Pubnub(String publish_key, String subscribe_key, boolean ssl) { + super(publish_key, subscribe_key, "", "", ssl); + } + + /** + * @param publish_key + * @param subscribe_key + * @param secret_key + */ + public Pubnub(String publish_key, String subscribe_key, String secret_key) { + super(publish_key, subscribe_key, secret_key, "", false); + } + + /** + * Sets value for UUID + * + * @param uuid + * UUID value for Pubnub client + */ + public void setUUID(UUID uuid) { + this.UUID = uuid.toString(); + } + + protected String uuid() { + return java.util.UUID.randomUUID().toString(); + } + + /** + * This method sets timeout value for subscribe/presence. Default value is + * 310000 milliseconds i.e. 310 seconds + * + * @param timeout + * Timeout value in milliseconds for subscribe/presence + */ + public void setSubscribeTimeout(int timeout) { + super.setSubscribeTimeout(timeout); + } + + /** + * This method set timeout value for non subscribe operations like publish, + * history, hereNow. Default value is 15000 milliseconds i.e. 15 seconds. + * + * @param timeout + * Timeout value in milliseconds for Non subscribe operations + * like publish, history, hereNow + */ + public void setNonSubscribeTimeout(int timeout) { + super.setNonSubscribeTimeout(timeout); + } + + protected String getUserAgent() { + return "Java/3.4"; + } +} diff --git a/java/src1/com/pubnub/api/HttpClientCore.java b/java/src1/com/pubnub/api/HttpClientCore.java new file mode 100644 index 000000000..46cbb8d6e --- /dev/null +++ b/java/src1/com/pubnub/api/HttpClientCore.java @@ -0,0 +1,202 @@ +package com.pubnub.api; + +import java.io.ByteArrayOutputStream; +import java.util.zip.GZIPInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.ProtocolException; +import java.net.SocketTimeoutException; +import java.net.URL; +import java.util.Enumeration; +import java.util.Hashtable; + +import org.json.JSONArray; +import org.json.JSONException; + +import com.pubnub.api.PubnubException; + +class HttpClientCore extends HttpClient { + private int requestTimeout = 310000; + private int connectionTimeout = 5000; + HttpURLConnection connection; + protected static Logger log = new Logger(Worker.class); + + private void init() { + HttpURLConnection.setFollowRedirects(true); + } + + public HttpClientCore(int connectionTimeout, int requestTimeout, Hashtable headers) { + init(); + this.setRequestTimeout(requestTimeout); + this.setConnectionTimeout(connectionTimeout); + this._headers = headers; + } + + public int getRequestTimeout() { + return requestTimeout; + } + + public void setRequestTimeout(int requestTimeout) { + this.requestTimeout = requestTimeout; + } + + public int getConnectionTimeout() { + return connectionTimeout; + } + + public void setConnectionTimeout(int connectionTimeout) { + this.connectionTimeout = connectionTimeout; + } + + public boolean isRedirect(int rc) { + return (rc == HttpURLConnection.HTTP_MOVED_PERM + || rc == HttpURLConnection.HTTP_MOVED_TEMP || rc == HttpURLConnection.HTTP_SEE_OTHER); + } + + public boolean checkResponse(int rc) { + return (rc == HttpURLConnection.HTTP_OK || isRedirect(rc)); + } + + public boolean checkResponseSuccess(int rc) { + return (rc == HttpURLConnection.HTTP_OK); + } + + private static String readInput(InputStream in) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + byte bytes[] = new byte[1024]; + + int n = in.read(bytes); + + while (n != -1) { + out.write(bytes, 0, n); + n = in.read(bytes); + } + + return new String(out.toString()); + } + + public HttpResponse fetch(String url) throws PubnubException, SocketTimeoutException { + return fetch(url, null); + } + + public synchronized HttpResponse fetch(String url, Hashtable headers) + throws PubnubException, SocketTimeoutException { + URL urlobj = null; + try { + urlobj = new URL(url); + } catch (MalformedURLException e3) { + throw new PubnubException(PubnubError.PNERR_5006_MALFORMED_URL); + } + try { + connection = (HttpURLConnection) urlobj.openConnection(); + } catch (IOException e2) { + throw new PubnubException(PubnubError.PNERR_5008_URL_OPEN); + } + try { + connection.setRequestMethod("GET"); + } catch (ProtocolException e1) { + throw new PubnubException(PubnubError.PNERR_5009_PROTOCOL_EXCEPTION); + } + if (_headers != null) { + Enumeration en = _headers.keys(); + while (en.hasMoreElements()) { + String key = (String) en.nextElement(); + String val = (String) _headers.get(key); + connection.addRequestProperty(key, val); + } + } + if (headers != null) { + Enumeration en = headers.keys(); + while (en.hasMoreElements()) { + String key = (String) en.nextElement(); + String val = (String) headers.get(key); + connection.addRequestProperty(key, val); + } + } + connection.setReadTimeout(requestTimeout); + connection.setConnectTimeout(connectionTimeout); + + + try { + connection.connect(); + } + catch (SocketTimeoutException e) { + throw e; + } + catch (IOException e) { + throw new PubnubException(PubnubError.PNERR_5010_CONNECT_EXCEPTION); + } + + int rc = HttpURLConnection.HTTP_CLIENT_TIMEOUT; + try { + rc = connection.getResponseCode(); + } catch (IOException e) { + throw new PubnubException(PubnubError.PNERR_5011_HTTP_RC_ERROR); + } + + + InputStream is = null; + String encoding = connection.getContentEncoding(); + + if(encoding == null || !encoding.equals("gzip")) { + try { + is = connection.getInputStream(); + } catch (IOException e) { + if (rc == HttpURLConnection.HTTP_OK) + throw new PubnubException(PubnubError.PNERR_5012_GETINPUTSTREAM); + is = connection.getErrorStream(); + } + + } else { + try { + is = new GZIPInputStream(connection.getInputStream()); + } catch (IOException e) { + if (rc == HttpURLConnection.HTTP_OK) + throw new PubnubException(PubnubError.PNERR_5013_GETINPUTSTREAM); + is = connection.getErrorStream(); + } + } + + String page = null; + try { + page = readInput(is); + } catch (IOException e) { + throw new PubnubException(PubnubError.PNERR_5014_READINPUT); + } + + switch (rc) { + case HttpURLConnection.HTTP_FORBIDDEN: + return new HttpResponse( rc, ""); + case HttpURLConnection.HTTP_BAD_REQUEST: + try { + JSONArray jsarr = new JSONArray(page); + String error = jsarr.get(1).toString(); + throw new PubnubException(PubnubError.PNERR_5016_BAD_REQUEST, error); + } catch (JSONException e) { + throw new PubnubException(PubnubError.PNERR_5015_INVALID_JSON); + } + case HttpURLConnection.HTTP_BAD_GATEWAY: + throw new PubnubException(PubnubError.PNERR_5020_BAD_GATEWAY); + case HttpURLConnection.HTTP_CLIENT_TIMEOUT: + throw new PubnubException(PubnubError.PNERR_5021_CLIENT_TIMEOUT); + case HttpURLConnection.HTTP_GATEWAY_TIMEOUT: + throw new PubnubException(PubnubError.PNERR_5022_GATEWAY_TIMEOUT); + case HttpURLConnection.HTTP_INTERNAL_ERROR: + throw new PubnubException(PubnubError.PNERR_5023_INTERNAL_ERROR); + default: + break; + } + log.verbose("URL = " + url + " : RESPONSE = " + page); + return new HttpResponse(rc, page); + } + + public boolean isOk(int rc) { + return (rc == HttpURLConnection.HTTP_OK); + } + + public void shutdown() { + if (connection != null) connection.disconnect(); + } +} diff --git a/java/src1/com/pubnub/api/NonSubscribeManager.java b/java/src1/com/pubnub/api/NonSubscribeManager.java new file mode 100644 index 000000000..f8381a446 --- /dev/null +++ b/java/src1/com/pubnub/api/NonSubscribeManager.java @@ -0,0 +1,13 @@ +package com.pubnub.api; + +class NonSubscribeManager extends AbstractNonSubscribeManager { + + public NonSubscribeManager(String name, int connectionTimeout, + int requestTimeout) { + super(name, connectionTimeout, requestTimeout); + } + + public void clearRequestQueue() { + _waiting.clear(); + } +} diff --git a/java/src1/com/pubnub/api/PubnubCrypto.java b/java/src1/com/pubnub/api/PubnubCrypto.java new file mode 100644 index 000000000..8ffdda86b --- /dev/null +++ b/java/src1/com/pubnub/api/PubnubCrypto.java @@ -0,0 +1,9 @@ +package com.pubnub.api; + +class PubnubCrypto extends PubnubCryptoCore { + + public PubnubCrypto(String CIPHER_KEY) { + super(CIPHER_KEY); + } + +} diff --git a/java/src1/com/pubnub/api/PubnubUtil.java b/java/src1/com/pubnub/api/PubnubUtil.java new file mode 100644 index 000000000..eeb275c86 --- /dev/null +++ b/java/src1/com/pubnub/api/PubnubUtil.java @@ -0,0 +1,25 @@ +package com.pubnub.api; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + +public class PubnubUtil extends PubnubUtilCore { + + /** + * Returns encoded String + * + * @param sUrl + * , input string + * @return , encoded string + */ + public static String urlEncode(String sUrl) { + try { + return URLEncoder.encode(sUrl, "UTF-8").replace("+", "%20"); + } catch (UnsupportedEncodingException e) { + return null; + } + } +} diff --git a/java/src1/com/pubnub/api/SubscribeManager.java b/java/src1/com/pubnub/api/SubscribeManager.java new file mode 100644 index 000000000..31c670e7f --- /dev/null +++ b/java/src1/com/pubnub/api/SubscribeManager.java @@ -0,0 +1,13 @@ +package com.pubnub.api; + +class SubscribeManager extends AbstractSubscribeManager { + + public SubscribeManager(String name, int connectionTimeout, + int requestTimeout) { + super(name, connectionTimeout, requestTimeout); + } + + public void clearRequestQueue() { + _waiting.clear(); + } +} diff --git a/java/src1/com/pubnub/api/SubscribeWorker.java b/java/src1/com/pubnub/api/SubscribeWorker.java new file mode 100644 index 000000000..e73ce901e --- /dev/null +++ b/java/src1/com/pubnub/api/SubscribeWorker.java @@ -0,0 +1,72 @@ +package com.pubnub.api; + +import java.net.SocketTimeoutException; +import java.util.Hashtable; +import java.util.Vector; + +class SubscribeWorker extends AbstractSubscribeWorker { + + SubscribeWorker(Vector _requestQueue, int connectionTimeout, + int requestTimeout, int maxRetries, int retryInterval, Hashtable headers) { + super(_requestQueue, connectionTimeout, requestTimeout, + maxRetries, retryInterval, headers); + } + + void process(HttpRequest hreq) { + HttpResponse hresp = null; + int currentRetryAttempt = (hreq.isDar())?1:maxRetries; + log.verbose("disconnectAndResubscribe is " + hreq.isDar()); + while (!_die && currentRetryAttempt <= maxRetries) { + try { + log.debug(hreq.getUrl()); + hresp = httpclient.fetch(hreq.getUrl(), hreq.getHeaders()); + if (hresp != null + && httpclient.checkResponseSuccess(hresp + .getStatusCode())) { + currentRetryAttempt = 1; + break; + } + } catch (SocketTimeoutException e) { + log.verbose("No Traffic , Read Timeout Exception in Fetch : " + e.toString()); + if (_die) { + log.verbose("Asked to Die, Don't do back from DAR processing"); + break; + } + if (hreq.isDar()) { + hreq.getResponseHandler().handleBackFromDar(hreq); + return; + } + break; + + } catch (Exception e) { + log.verbose("Retry Attempt : " + ((currentRetryAttempt == maxRetries)?"last":currentRetryAttempt) + + " Exception in Fetch : " + e.toString()); + currentRetryAttempt++; + } + + try { + Thread.sleep(retryInterval); + } catch (InterruptedException e) { + } + } + if (!_die) { + if (hresp == null) { + log.debug("Error in fetching url : " + hreq.getUrl()); + if (hreq.isDar()) { + log.verbose("Exhausted number of retries"); + hreq.getResponseHandler().handleTimeout(hreq); + } else { + hreq.getResponseHandler().handleError(hreq, PubnubError.PNERR_5019_HTTP_ERROR.toString()); + } + return; + } + log.debug(hresp.getResponse()); + hreq.getResponseHandler().handleResponse(hreq, hresp.getResponse()); + } + + } + + public void shutdown() { + if (httpclient != null) httpclient.shutdown(); + } +} diff --git a/java/srcLogging/com/pubnub/api/Logger.java b/java/srcLogging/com/pubnub/api/Logger.java new file mode 100644 index 000000000..98b4d4d0d --- /dev/null +++ b/java/srcLogging/com/pubnub/api/Logger.java @@ -0,0 +1,34 @@ +package com.pubnub.api; + +import org.slf4j.LoggerFactory; + + +class Logger extends AbstractLogger { + private Class _class; + private org.slf4j.Logger log; + + public Logger(Class _class) { + this._class = _class; + this.log = LoggerFactory.getLogger(this._class); + } + + @Override + protected void nativeDebug(String s) { + log.debug(s); + } + + @Override + protected void nativeVerbose(String s) { + log.trace(s); + } + + @Override + protected void nativeError(String s) { + log.error(s); + } + + @Override + protected void nativeInfo(String s) { + log.info(s); + } +} diff --git a/java/srcPubnubApi/com/pubnub/api/AbstractLogger.java b/java/srcPubnubApi/com/pubnub/api/AbstractLogger.java new file mode 100644 index 000000000..2aac4d341 --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/AbstractLogger.java @@ -0,0 +1,46 @@ + +package com.pubnub.api; + +abstract class AbstractLogger { + + private static boolean LOGGING = false; + + private static String VERSION = ""; + + protected abstract void nativeDebug(String s); + + protected abstract void nativeVerbose(String s); + + protected abstract void nativeError(String s); + + protected abstract void nativeInfo(String s); + + private String prepareString(String s) { + return "[" + VERSION + "] : " + "[" + System.currentTimeMillis() + "] : " + + "["+Thread.activeCount() + + "] Thread ID : " + Thread.currentThread().getId() + + ", Thread Name : " + Thread.currentThread().getName() + + ", " + s; + } + + public void debug(String s) { + if (LOGGING) + nativeDebug(prepareString(s)); + } + + public void verbose(String s) { + if (LOGGING) + nativeVerbose(prepareString(s)); + } + + public void info(String s) { + if (LOGGING) + nativeInfo(prepareString(s)); + } + + public void error(String s) { + if (LOGGING) + nativeError(prepareString(s)); + } + +} diff --git a/java/srcPubnubApi/com/pubnub/api/Base64Encoder.java b/java/srcPubnubApi/com/pubnub/api/Base64Encoder.java new file mode 100644 index 000000000..c1eabb19b --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/Base64Encoder.java @@ -0,0 +1,170 @@ +package com.pubnub.api; + +/** + * Simple base64 encoder, can be implemented in other platforms. + * + */ +class Base64Encoder { + + // Mapping table from 6-bit nibbles to Base64 characters. + private static char[] map1 = new char[64]; + static { + int i = 0; + for (char c = 'A'; c <= 'Z'; c++) + map1[i++] = c; + for (char c = 'a'; c <= 'z'; c++) + map1[i++] = c; + for (char c = '0'; c <= '9'; c++) + map1[i++] = c; + map1[i++] = '+'; + map1[i++] = '/'; + } + + // Mapping table from Base64 characters to 6-bit nibbles. + private static byte[] map2 = new byte[128]; + static { + for (int i = 0; i < map2.length; i++) + map2[i] = -1; + for (int i = 0; i < 64; i++) + map2[map1[i]] = (byte) i; + } + + /** + * Encodes a string into Base64 format. No blanks or line breaks are + * inserted. + * + * @param s + * a String to be encoded. + * @return A String with the Base64 encoded data. + */ + public static String encodeString(String s) { + return new String(encode(s.getBytes())); + } + + /** + * Encodes a byte array into Base64 format. No blanks or line breaks are + * inserted. + * + * @param in + * an array containing the data bytes to be encoded. + * @return A character array with the Base64 encoded data. + */ + public static char[] encode(byte[] in) { + return encode(in, in.length); + } + + /** + * Encodes a byte array into Base64 format. No blanks or line breaks are + * inserted. + * + * @param in + * an array containing the data bytes to be encoded. + * @param iLen + * number of bytes to process in in. + * @return A character array with the Base64 encoded data. + */ + public static char[] encode(byte[] in, int iLen) { + int oDataLen = (iLen * 4 + 2) / 3; // output length without padding + int oLen = ((iLen + 2) / 3) * 4; // output length including padding + char[] out = new char[oLen]; + int ip = 0; + int op = 0; + while (ip < iLen) { + int i0 = in[ip++] & 0xff; + int i1 = ip < iLen ? in[ip++] & 0xff : 0; + int i2 = ip < iLen ? in[ip++] & 0xff : 0; + int o0 = i0 >>> 2; + int o1 = ((i0 & 3) << 4) | (i1 >>> 4); + int o2 = ((i1 & 0xf) << 2) | (i2 >>> 6); + int o3 = i2 & 0x3F; + out[op++] = map1[o0]; + out[op++] = map1[o1]; + out[op] = op < oDataLen ? map1[o2] : '='; + op++; + out[op] = op < oDataLen ? map1[o3] : '='; + op++; + } + return out; + } + + /** + * Decodes a string from Base64 format. + * + * @param s + * a Base64 String to be decoded. + * @return A String containing the decoded data. + * @throws IllegalArgumentException + * if the input is not valid Base64 encoded data. + */ + public static String decodeString(String s) { + return new String(decode(s)); + } + + /** + * Decodes a byte array from Base64 format. + * + * @param s + * a Base64 String to be decoded. + * @return An array containing the decoded data bytes. + * @throws IllegalArgumentException + * if the input is not valid Base64 encoded data. + */ + public static byte[] decode(String s) { + return decode(s.toCharArray()); + } + + /** + * Decodes a byte array from Base64 format. No blanks or line breaks are + * allowed within the Base64 encoded data. + * + * @param in + * a character array containing the Base64 encoded data. + * @return An array containing the decoded data bytes. + * @throws IllegalArgumentException + * if the input is not valid Base64 encoded data. + */ + public static byte[] decode(char[] in) { + int iLen = in.length; + if (iLen % 4 != 0) + throw new IllegalArgumentException( + "Length of Base64 encoded input string is not a multiple of 4."); + while (iLen > 0 && in[iLen - 1] == '=') + iLen--; + int oLen = (iLen * 3) / 4; + byte[] out = new byte[oLen]; + int ip = 0; + int op = 0; + while (ip < iLen) { + int i0 = in[ip++]; + int i1 = in[ip++]; + int i2 = ip < iLen ? in[ip++] : 'A'; + int i3 = ip < iLen ? in[ip++] : 'A'; + if (i0 > 127 || i1 > 127 || i2 > 127 || i3 > 127) + throw new IllegalArgumentException( + "Illegal character in Base64 encoded data."); + int b0 = map2[i0]; + int b1 = map2[i1]; + int b2 = map2[i2]; + int b3 = map2[i3]; + if (b0 < 0 || b1 < 0 || b2 < 0 || b3 < 0) + throw new IllegalArgumentException( + "Illegal character in Base64 encoded data."); + int o0 = (b0 << 2) | (b1 >>> 4); + int o1 = ((b1 & 0xf) << 4) | (b2 >>> 2); + int o2 = ((b2 & 3) << 6) | b3; + out[op++] = (byte) o0; + if (op < oLen) + out[op++] = (byte) o1; + if (op < oLen) + out[op++] = (byte) o2; + } + return out; + } + + /** + * This class is not instantiable. + */ + private Base64Encoder() { + } + +} // end class Base64Encoder diff --git a/java/srcPubnubApi/com/pubnub/api/Callback.java b/java/srcPubnubApi/com/pubnub/api/Callback.java new file mode 100644 index 000000000..d52656784 --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/Callback.java @@ -0,0 +1,61 @@ +package com.pubnub.api; + +/** + * Abstract class to be subclassed by objects being passed as callbacks to + * Pubnub APIs Default implementation for all methods is blank + * + * @author Pubnub + * + */ +public abstract class Callback { + + /** + * This callback will be invoked when a message is received on the channel + * + * @param channel + * Channel Name + * @param message + * Message + * + */ + public abstract void successCallback(String channel, Object message); + + /** + * This callback will be invoked when an error occurs + * + * @param channel + * Channel Name + * @param message + * Message + */ + public abstract void errorCallback(String channel, Object message); + + /** + * This callback will be invoked on getting connected to a channel + * + * @param channel + * Channel Name + */ + public void connectCallback(String channel, Object message) { + } + + /** + * This callback is invoked on getting reconnected to a channel after + * getting disconnected + * + * @param channel + * Channel Name + */ + public void reconnectCallback(String channel, Object message) { + } + + /** + * This callback is invoked on getting disconnected from a channel + * + * @param channel + * Channel Name + */ + public void disconnectCallback(String channel, Object message) { + } + +} diff --git a/java/srcPubnubApi/com/pubnub/api/Channel.java b/java/srcPubnubApi/com/pubnub/api/Channel.java new file mode 100644 index 000000000..d8ad32b6c --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/Channel.java @@ -0,0 +1,13 @@ +package com.pubnub.api; + +/** + * @author PubnubCore + * + */ +class Channel { + String name; + boolean connected; + boolean subscribed; + boolean error; + Callback callback; +} diff --git a/java/srcPubnubApi/com/pubnub/api/HttpClient.java b/java/srcPubnubApi/com/pubnub/api/HttpClient.java new file mode 100644 index 000000000..ac2ef4006 --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/HttpClient.java @@ -0,0 +1,42 @@ +package com.pubnub.api; + +import java.io.IOException; +import java.util.Hashtable; +import com.pubnub.api.PubnubException; + +abstract class HttpClient { + + protected Hashtable _headers; + + public static HttpClient getClient(int connectionTimeout, int requestTimeout, Hashtable headers) { + return new HttpClientCore(connectionTimeout, requestTimeout, headers); + } + + public void reset() { + shutdown(); + } + + public abstract int getRequestTimeout(); + + public abstract void setRequestTimeout(int requestTimeout); + + public abstract int getConnectionTimeout(); + + public abstract void setConnectionTimeout(int connectionTimeout); + + public abstract boolean isRedirect(int rc); + + public abstract boolean checkResponse(int rc); + + public abstract boolean checkResponseSuccess(int rc); + + public abstract boolean isOk(int rc); + + public abstract void shutdown(); + + public abstract HttpResponse fetch(String url) throws IOException, + PubnubException; + + public abstract HttpResponse fetch(String url, Hashtable headers) + throws IOException, PubnubException; +} diff --git a/java/srcPubnubApi/com/pubnub/api/HttpRequest.java b/java/srcPubnubApi/com/pubnub/api/HttpRequest.java new file mode 100644 index 000000000..e475983f3 --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/HttpRequest.java @@ -0,0 +1,118 @@ +package com.pubnub.api; + +import java.util.Enumeration; +import java.util.Hashtable; + +import com.pubnub.api.PubnubUtil; + +class HttpRequest { + private ResponseHandler responseHandler; + private Hashtable headers; + private String[] urlComponents; + private Hashtable params; + private String url; + private boolean dar; + private boolean subzero; + + public boolean isSubzero() { + return subzero; + } + + public void setSubzero(boolean subzero) { + this.subzero = subzero; + } + + public boolean isDar() { + return dar; + } + + public void setDar(boolean dar) { + this.dar = dar; + } + + public HttpRequest(String[] urlComponents, Hashtable params, + Hashtable headers, ResponseHandler rh) { + this.setUrlComponents(urlComponents); + this.setParams(params); + this.setHeaders(headers); + this.setResponseHandler(rh); + } + + public HttpRequest(String[] urlComponents, Hashtable params, + ResponseHandler rh) { + this.setUrlComponents(urlComponents); + this.setParams(params); + this.setResponseHandler(rh); + } + + public HttpRequest(String[] urlComponents, ResponseHandler rh) { + this.setUrlComponents(urlComponents); + this.setResponseHandler(rh); + } + + public String[] getUrlComponents() { + return urlComponents; + } + + public void setUrlComponents(String[] urlComponents) { + this.urlComponents = urlComponents; + } + + public Hashtable getParams() { + return params; + } + + public void setParams(Hashtable params) { + this.params = params; + } + + public ResponseHandler getResponseHandler() { + return responseHandler; + } + + public void setResponseHandler(ResponseHandler responseHandler) { + this.responseHandler = responseHandler; + } + + public Hashtable getHeaders() { + return headers; + } + + public void setHeaders(Hashtable headers) { + this.headers = headers; + } + + public String getUrl() { + + if (url != null) { + return url; + } + + String url = PubnubUtil.joinString(urlComponents, "/"); + + if (this.params != null) { + StringBuffer sb = new StringBuffer(); + sb.append(url).append("?"); + + Enumeration paramsKeys = this.params.keys(); + boolean first = true; + while (paramsKeys.hasMoreElements()) { + if (!first) { + sb.append("&"); + } else + first = false; + + String key = (String) paramsKeys.nextElement(); + sb.append(PubnubUtil.urlEncode((String) key)) + .append("=") + .append(PubnubUtil.urlEncode((String) this.params + .get(key))); + } + + url = sb.toString(); + } + this.url = url; + + return this.url; + } +} diff --git a/java/srcPubnubApi/com/pubnub/api/HttpResponse.java b/java/srcPubnubApi/com/pubnub/api/HttpResponse.java new file mode 100644 index 000000000..9e6732a11 --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/HttpResponse.java @@ -0,0 +1,28 @@ +package com.pubnub.api; + +class HttpResponse { + private int statusCode; + private String response; + + public String getResponse() { + return response; + } + + public void setResposnse(String resposnse) { + this.response = resposnse; + } + + public int getStatusCode() { + return statusCode; + } + + public void setStatusCode(int statusCode) { + this.statusCode = statusCode; + } + + public HttpResponse(int statusCode, String response) { + this.setResposnse(response); + this.setStatusCode(statusCode); + } + +} diff --git a/java/srcPubnubApi/com/pubnub/api/PubnubCore.java b/java/srcPubnubApi/com/pubnub/api/PubnubCore.java new file mode 100644 index 000000000..441ad5428 --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/PubnubCore.java @@ -0,0 +1,1386 @@ +package com.pubnub.api; + +import java.io.UnsupportedEncodingException; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Random; + +import org.bouncycastle.util.encoders.Hex; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +/** + * Pubnub object facilitates querying channels for messages and listening on + * channels for presence/message events + * + * @author Pubnub + * + */ + +abstract class PubnubCore { + + private String HOSTNAME = "pubsub"; + private int HOSTNAME_SUFFIX = 1; + private String DOMAIN = "pubnub.com"; + private String ORIGIN_STR = null; + private String PUBLISH_KEY = ""; + private String SUBSCRIBE_KEY = ""; + private String SECRET_KEY = ""; + private String CIPHER_KEY = ""; + private volatile String AUTH_STR = null; + private Hashtable params; + private volatile boolean resumeOnReconnect; + + private boolean SSL = true; + protected String UUID = null; + private Subscriptions subscriptions; + + protected SubscribeManager subscribeManager; + protected NonSubscribeManager nonSubscribeManager; + private volatile String _timetoken = "0"; + private volatile String _saved_timetoken = "0"; + + private String PRESENCE_SUFFIX = "-pnpres"; + private static String VERSION = ""; + private Random generator = new Random(); + + private static Logger log = new Logger(PubnubCore.class); + + protected abstract String getUserAgent(); + + /** + * This method when called stops Pubnub threads + */ + public void shutdown() { + nonSubscribeManager.stop(); + subscribeManager.stop(); + } + + /** + * This method returns the state of Resume on Reconnect setting + * + * @return Current state of Resume On Reconnect Setting + */ + public boolean isResumeOnReconnect() { + return resumeOnReconnect; + } + + /** + * This method sets retry interval for subscribe. Pubnub API will make + * maxRetries attempts to connect to pubnub servers. These attemtps will be + * made at an interval of retryInterval milliseconds. + * + * @param retryInterval + * Retry Interval in milliseconds + */ + public void setRetryInterval(int retryInterval) { + subscribeManager.setRetryInterval(retryInterval); + } + + /** + * This methods sets maximum number of retries for subscribe. Pubnub API + * will make maxRetries attempts to connect to pubnub servers before timing + * out. + * + * @param maxRetries + * Max number of retries + */ + public void setMaxRetries(int maxRetries) { + subscribeManager.setMaxRetries(maxRetries); + } + + private String getOrigin() { + if (ORIGIN_STR == null) { + // SSL On? + if (this.SSL) { + ORIGIN_STR = "https://" + HOSTNAME + "-" + + String.valueOf(HOSTNAME_SUFFIX) + "." + DOMAIN; + } else { + ORIGIN_STR = "http://" + HOSTNAME + "-" + + String.valueOf(HOSTNAME_SUFFIX) + "." + DOMAIN; + } + } + return ORIGIN_STR; + } + + private Hashtable hashtableClone(Hashtable ht) { + if (ht == null) + return null; + + Hashtable htresp = new Hashtable(); + Enumeration e = ht.keys(); + + while(e.hasMoreElements()) { + Object element = e.nextElement(); + htresp.put(element,ht.get(element)); + } + return htresp; + } + + + /** + * This method returns all channel names currently subscribed to in form of + * a comma separated String + * + * @return Comma separated string with all channel names currently + * subscribed + */ + public String getCurrentlySubscribedChannelNames() { + String currentChannels = subscriptions.getChannelString(); + return currentChannels.equals("") ? "no channels." : currentChannels; + } + + /** + * If Resume on Reconnect is set to true, then Pubnub catches up on + * reconnection after disconnection. If false, then messages sent on the + * channel between disconnection and reconnection are not received. + * + * @param resumeOnReconnect + * True or False setting for Resume on Reconnect + */ + public void setResumeOnReconnect(boolean resumeOnReconnect) { + this.resumeOnReconnect = resumeOnReconnect; + } + + /** + * Convert input String to JSONObject, JSONArray, or String + * + * @param str + * JSON data in string format + * + * @return JSONArray or JSONObject or String + */ + static Object stringToJSON(String str) { + Object obj = str; + try { + JSONArray jsarr = new JSONArray(str); + obj = jsarr; + } catch (JSONException e) { + try { + JSONObject jsobj = new JSONObject(str); + obj = jsobj; + } catch (JSONException ex) { + } + } + return obj; + } + + protected abstract String uuid(); + + /** + * Sets value for UUID + * + * @param uuid + * UUID value for Pubnub client + */ + public void setUUID(String uuid) { + this.UUID = uuid; + } + + /** + * + * Constructor for Pubnub Class + * + * @param publish_key + * Publish Key + * @param subscribe_key + * Subscribe Key + * @param secret_key + * Secret Key + * @param cipher_key + * Cipher Key + * @param ssl_on + * SSL enabled ? + */ + + public PubnubCore(String publish_key, String subscribe_key, + String secret_key, String cipher_key, boolean ssl_on) { + this.init(publish_key, subscribe_key, secret_key, cipher_key, ssl_on); + } + + /** + * + * Constructor for Pubnub Class + * + * @param publish_key + * Publish Key + * @param subscribe_key + * Subscribe Key + * @param secret_key + * Secret Key + * @param ssl_on + * SSL enabled ? + */ + + public PubnubCore(String publish_key, String subscribe_key, + String secret_key, boolean ssl_on) { + this.init(publish_key, subscribe_key, secret_key, "", ssl_on); + } + + /** + * + * Constructor for Pubnub Class + * + * @param publish_key + * Publish Key + * @param subscribe_key + * Subscribe Key + */ + + public PubnubCore(String publish_key, String subscribe_key) { + this.init(publish_key, subscribe_key, "", "", false); + } + + /** + * + * Constructor for Pubnub Class + * + * @param publish_key + * Publish Key + * @param subscribe_key + * Subscribe Key + */ + + public PubnubCore(String publish_key, String subscribe_key, boolean ssl) { + this.init(publish_key, subscribe_key, "", "", ssl); + } + + /** + * + * Constructor for Pubnub Class + * + * @param publish_key + * Publish Key + * @param subscribe_key + * Subscribe Key + * @param secret_key + * Secret Key + */ + public PubnubCore(String publish_key, String subscribe_key, + String secret_key) { + this.init(publish_key, subscribe_key, secret_key, "", false); + } + + /** + * + * Initialize PubNub Object State. + * + * @param publish_key + * @param subscribe_key + * @param secret_key + * @param cipher_key + * @param ssl_on + */ + private void init(String publish_key, String subscribe_key, + String secret_key, String cipher_key, boolean ssl_on) { + this.PUBLISH_KEY = publish_key; + this.SUBSCRIBE_KEY = subscribe_key; + this.SECRET_KEY = secret_key; + this.CIPHER_KEY = cipher_key; + this.SSL = ssl_on; + + if (UUID == null) + UUID = uuid(); + + if (subscriptions == null) + subscriptions = new Subscriptions(); + + if (subscribeManager == null) + subscribeManager = new SubscribeManager("Subscribe-Manager-" + System.identityHashCode(this) , 10000,310000); + + if (nonSubscribeManager == null) + nonSubscribeManager = new NonSubscribeManager("Non-Subscribe-Manager-" + System.identityHashCode(this), 10000, 15000); + + if ( params == null ) + params = new Hashtable(); + + subscribeManager.setHeader("V", VERSION); + subscribeManager.setHeader("Accept-Encoding", "gzip"); + subscribeManager.setHeader("User-Agent", getUserAgent()); + + nonSubscribeManager.setHeader("V", VERSION); + nonSubscribeManager.setHeader("Accept-Encoding", "gzip"); + nonSubscribeManager.setHeader("User-Agent", getUserAgent()); + + } + + /** + * This method sets timeout value for subscribe/presence. Default value is + * 310000 milliseconds i.e. 310 seconds + * + * @param timeout + * Timeout value in milliseconds for subscribe/presence + */ + protected void setSubscribeTimeout(int timeout) { + subscribeManager.setRequestTimeout(timeout); + this.disconnectAndResubscribe(); + } + + /** + * This method set timeout value for non subscribe operations like publish, + * history, hereNow. Default value is 15000 milliseconds i.e. 15 seconds. + * + * @param timeout + * Timeout value in milliseconds for Non subscribe operations + * like publish, history, hereNow + */ + protected void setNonSubscribeTimeout(int timeout) { + nonSubscribeManager.setRequestTimeout(timeout); + } + + /** + * Send a message to a channel. + * + * @param channel + * Channel name + * @param message + * JSONObject to be published + * @param callback + * object of sub class of Callback class + */ + public void publish(String channel, JSONObject message, Callback callback) { + Hashtable args = new Hashtable(); + args.put("channel", channel); + args.put("message", message); + args.put("callback", callback); + publish(args); + } + + /** + * Send a message to a channel. + * + * @param channel + * Channel name + * @param message + * JSONOArray to be published + * @param callback + * object of sub class of Callback class + */ + public void publish(String channel, JSONArray message, Callback callback) { + Hashtable args = new Hashtable(); + args.put("channel", channel); + args.put("message", message); + args.put("callback", callback); + publish(args); + } + + /** + * Send a message to a channel. + * + * @param channel + * Channel name + * @param message + * String to be published + * @param callback + * object of sub class of Callback class + */ + public void publish(String channel, String message, Callback callback) { + Hashtable args = new Hashtable(); + args.put("channel", channel); + args.put("message", message); + args.put("callback", callback); + publish(args); + } + + /** + * Send a message to a channel. + * + * @param channel + * Channel name + * @param message + * Integer to be published + * @param callback + * object of sub class of Callback class + */ + public void publish(String channel, Integer message, Callback callback) { + Hashtable args = new Hashtable(); + args.put("channel", channel); + args.put("message", message); + args.put("callback", callback); + publish(args); + } + + /** + * Send a message to a channel. + * + * @param channel + * Channel name + * @param message + * Double to be published + * @param callback + * object of sub class of Callback class + */ + public void publish(String channel, Double message, Callback callback) { + Hashtable args = new Hashtable(); + args.put("channel", channel); + args.put("message", message); + args.put("callback", callback); + publish(args); + } + + /** + * Send a message to a channel. + * + * @param args + * Hashtable containing channel name, message. + * @param callback + * object of sub class of Callback class + */ + public void publish(Hashtable args, Callback callback) { + args.put("callback", callback); + publish(args); + } + + /** + * Send a message to a channel. + * + * @param args + * Hashtable containing channel name, message, callback + */ + + public void publish(Hashtable args) { + + final String channel = (String) args.get("channel"); + final Object message = args.get("message"); + final Callback callback = (Callback) args.get("callback"); + String msgStr = message.toString(); + + if (this.CIPHER_KEY.length() > 0) { + // Encrypt Message + PubnubCrypto pc = new PubnubCrypto(this.CIPHER_KEY); + try { + msgStr = "\"" + pc.encrypt(msgStr) + "\""; + } catch (Exception e) { + JSONArray jsarr; + jsarr = new JSONArray(); + jsarr.put("0").put(PubnubError.PNERR_5001_ENCRYPTION_ERROR); + callback.errorCallback(channel, jsarr); + return; + } + } else { + if (message instanceof String) { + msgStr = "\"" + msgStr + "\""; + } + } + + // Generate String to Sign + String signature = "0"; + + if (this.SECRET_KEY.length() > 0) { + StringBuffer string_to_sign = new StringBuffer(); + string_to_sign.append(this.PUBLISH_KEY).append('/') + .append(this.SUBSCRIBE_KEY).append('/') + .append(this.SECRET_KEY).append('/').append(channel) + .append('/').append(msgStr); + + // Sign Message + try { + signature = new String(Hex.encode(PubnubCrypto + .md5(string_to_sign.toString())), "UTF-8"); + } catch (UnsupportedEncodingException e) { + + } + } + String[] urlComponents = { getOrigin(), "publish", this.PUBLISH_KEY, + this.SUBSCRIBE_KEY, PubnubUtil.urlEncode(signature), + PubnubUtil.urlEncode(channel), "0", + PubnubUtil.urlEncode(msgStr) }; + + HttpRequest hreq = new HttpRequest(urlComponents, params, + new ResponseHandler() { + public void handleResponse(HttpRequest hreq, String response) { + JSONArray jsarr; + try { + jsarr = new JSONArray(response); + } catch (JSONException e) { + handleError(hreq, response); + return; + } + callback.successCallback(channel, jsarr); + } + + public void handleError(HttpRequest hreq, String response) { + JSONArray jsarr; + jsarr = new JSONArray(); + jsarr.put("0").put("publish " + response); + jsarr.put(channel).put(message); + callback.errorCallback(channel, jsarr); + return; + } + }); + + _request(hreq, nonSubscribeManager); + } + + /** + * + * Listen for presence of subscribers on a channel + * + * @param channel + * Name of the channel on which to listen for join/leave i.e. + * presence events + * @param callback + * object of sub class of Callback class + * @exception PubnubException + * Throws PubnubException if Callback is null + */ + public void presence(String channel, Callback callback) + throws PubnubException { + Hashtable args = new Hashtable(2); + args.put("channel", channel + PRESENCE_SUFFIX); + args.put("callback", callback); + subscribe(args); + } + + /** + * Read presence information from a channel + * + * @param channel + * Channel name + * @param callback + * object of sub class of Callback class + */ + public void hereNow(final String channel, final Callback callback) { + + String[] urlargs = { getOrigin(), "v2", "presence", "sub_key", + this.SUBSCRIBE_KEY, "channel", channel }; + + HttpRequest hreq = new HttpRequest(urlargs, params, new ResponseHandler() { + public void handleResponse(HttpRequest hreq, String response) { + JSONObject jsobj; + try { + jsobj = new JSONObject(response); + } catch (JSONException e) { + handleError(hreq, response); + return; + } + callback.successCallback(channel, jsobj); + } + + public void handleError(HttpRequest hreq, String response) { + JSONArray jsarr; + jsarr = new JSONArray(); + jsarr.put("0").put("hereNow " + response); + + callback.errorCallback(channel, jsarr); + return; + } + }); + + _request(hreq, nonSubscribeManager); + } + + /** + * + * Read history from a channel. + * + * @param channel + * Channel Name + * @param limit + * Upper limit on number of messages in response + * + */ + public void history(String channel, int limit, Callback callback) { + Hashtable args = new Hashtable(2); + args.put("channel", channel); + args.put("limit", String.valueOf(limit)); + args.put("callback", callback); + history(args); + } + + /** + * + * Read history from a channel. + * + * @param args + * Hashtable containing channel name, limit, Callback + */ + public void history(Hashtable args) { + + final String channel = (String) args.get("channel"); + String limit = (String) args.get("limit"); + final Callback callback = (Callback) args.get("callback"); + + String[] urlargs = { getOrigin(), "history", this.SUBSCRIBE_KEY, + PubnubUtil.urlEncode(channel), "0", limit }; + + HttpRequest hreq = new HttpRequest(urlargs, params, new ResponseHandler() { + + public void handleResponse(HttpRequest hreq, String response) { + JSONArray respArr; + try { + respArr = new JSONArray(response); + decryptJSONArray(respArr); + callback.successCallback(channel, respArr); + } catch (Exception e) { + callback.errorCallback(channel, + PubnubError.PNERR_5004_JSON_ERROR); + } + } + + public void handleError(HttpRequest hreq, String response) { + JSONArray jsarr; + jsarr = new JSONArray(); + jsarr.put("0").put("history " + response); + callback.errorCallback(channel, jsarr); + return; + } + + }); + _request(hreq, nonSubscribeManager); + } + + /** + * + * Read DetailedHistory for a channel. + * + * @param channel + * Channel name for which detailed history is required + * @param start + * Start time + * @param end + * End time + * @param count + * Upper limit on number of messages to be returned + * @param reverse + * True if messages need to be in reverse order + * @param callback + * Callback + */ + public void detailedHistory(final String channel, long start, long end, + int count, boolean reverse, final Callback callback) { + Hashtable parameters = hashtableClone(params); + if (count == -1) + count = 100; + + parameters.put("count", String.valueOf(count)); + parameters.put("reverse", String.valueOf(reverse)); + + if (start != -1) + parameters.put("start", Long.toString(start).toLowerCase()); + + if (end != -1) + parameters.put("end", Long.toString(end).toLowerCase()); + + String[] urlargs = { getOrigin(), "v2", "history", "sub-key", + this.SUBSCRIBE_KEY, "channel", PubnubUtil.urlEncode(channel) }; + + HttpRequest hreq = new HttpRequest(urlargs, parameters, + new ResponseHandler() { + + public void handleResponse(HttpRequest hreq, String response) { + JSONArray respArr; + try { + respArr = new JSONArray(response); + decryptJSONArray((JSONArray) respArr.get(0)); + callback.successCallback(channel, respArr); + } catch (Exception e) { + callback.errorCallback(channel, + PubnubError.PNERR_5005_JSON_ERROR); + } + + } + + public void handleError(HttpRequest hreq, String response) { + JSONArray jsarr; + jsarr = new JSONArray(); + jsarr.put("0").put("detailedHistory " + response); + + callback.errorCallback(channel, jsarr); + return; + } + + }); + _request(hreq, nonSubscribeManager); + } + + /** + * + * Read DetailedHistory for a channel. + * + * @param channel + * Channel name for which detailed history is required + * @param start + * Start time + * @param reverse + * True if messages need to be in reverse order + * @param callback + * Callback + */ + public void detailedHistory(String channel, long start, boolean reverse, + Callback callback) { + detailedHistory(channel, start, -1, -1, reverse, callback); + } + + /** + * + * Read DetailedHistory for a channel. + * + * @param channel + * Channel name for which detailed history is required + * @param start + * Start time + * @param end + * End time + * @param callback + * Callback + */ + public void detailedHistory(String channel, long start, long end, + Callback callback) { + detailedHistory(channel, start, end, -1, false, callback); + } + + /** + * + * Read DetailedHistory for a channel. + * + * @param channel + * Channel name for which detailed history is required + * @param start + * Start time + * @param end + * End time + * @param reverse + * True if messages need to be in reverse order + * + * @param callback + * Callback + */ + public void detailedHistory(String channel, long start, long end, + boolean reverse, Callback callback) { + detailedHistory(channel, start, end, -1, reverse, callback); + } + + /** + * + * Read DetailedHistory for a channel. + * + * @param channel + * Channel name for which detailed history is required + * @param count + * Upper limit on number of messages to be returned + * @param reverse + * True if messages need to be in reverse order + * @param callback + * Callback + */ + public void detailedHistory(String channel, int count, boolean reverse, + Callback callback) { + detailedHistory(channel, -1, -1, count, reverse, callback); + } + + /** + * + * Read DetailedHistory for a channel. + * + * @param channel + * Channel name for which detailed history is required + * @param reverse + * True if messages need to be in reverse order + * @param callback + * Callback + */ + public void detailedHistory(String channel, boolean reverse, + Callback callback) { + detailedHistory(channel, -1, -1, -1, reverse, callback); + } + + /** + * + * Read DetailedHistory for a channel. + * + * @param channel + * Channel name for which detailed history is required + * @param callback + * Callback + */ + public void detailedHistory(String channel, int count, Callback callback) { + detailedHistory(channel, -1, -1, count, false, callback); + } + + /** + * Read current time from PubNub Cloud. + * + * @param callback + * Callback + */ + public void time(final Callback callback) { + + String[] url = { getOrigin(), "time", "0" }; + HttpRequest hreq = new HttpRequest(url, params, new ResponseHandler() { + + public void handleResponse(HttpRequest hreq, String response) { + callback.successCallback(null, response); + } + + public void handleError(HttpRequest hreq, String response) { + callback.errorCallback(null, "time " + response); + } + + }); + + _request(hreq, nonSubscribeManager); + } + + private boolean inputsValid(Hashtable args) throws PubnubException { + boolean channelMissing; + if (((Callback) args.get("callback")) == null) { + throw new PubnubException("Invalid Callback"); + } + Object _channels = args.get("channels"); + Object _channel = args.get("channel"); + + channelMissing = ((_channel == null || _channel.equals("")) && (_channels == null || _channels + .equals(""))) ? true : false; + + if (channelMissing) { + throw new PubnubException("Channel Missing"); + } + return true; + } + + private void leave(final String channel) { + + String[] urlargs = { getOrigin(), "v2/presence/sub_key", this.SUBSCRIBE_KEY, "channel" + , PubnubUtil.urlEncode(channel), "leave" }; + Hashtable params = new Hashtable(); + params.put("uuid", UUID); + + HttpRequest hreq = new HttpRequest(urlargs, params, new ResponseHandler() { + + public void handleResponse(HttpRequest hreq, String response) { + + } + + public void handleError(HttpRequest hreq, String response) { + + } + + }); + _request(hreq, nonSubscribeManager); + } + + /** + * Unsubscribe from channels. + * + * @param channels + * String[] array containing channel names as string. + */ + public void unsubscribe(String[] channels) { + for (int i = 0; i < channels.length; i++) { + subscriptions.removeChannel(channels[i]); + leave(channels[i]); + } + resubscribe(); + } + + /** + * Unsubscribe from all channel. + * + */ + public void unsubscribeAll() { + subscriptions.removeAllChannels(); + disconnectAndResubscribe(); + } + + /** + * Unsubscribe from presence channel. + * + * @param channel + * channel name as String. + */ + public void unsubscribePresence(String channel) { + unsubscribe(new String[] { channel + PRESENCE_SUFFIX }); + } + + /** + * Unsubscribe/Disconnect from channel. + * + * @param channel + * channel name as String. + */ + public void unsubscribe(String channel) { + unsubscribe(new String[] { channel }); + } + + /** + * Unsubscribe/Disconnect from channel. + * + * @param args + * Hashtable containing channel name. + */ + public void unsubscribe(Hashtable args) { + String[] channelList = (String[]) args.get("channels"); + if (channelList == null) { + channelList = new String[] { (String) args.get("channel") }; + } + unsubscribe(channelList); + } + + /** + * + * Listen for a message on a channel. + * + * @param args + * Hashtable containing channel name + * @param callback + * Callback + * @exception PubnubException + * Throws PubnubException if Callback is null + */ + public void subscribe(Hashtable args, Callback callback) + throws PubnubException { + args.put("callback", callback); + subscribe(args); + } + + /** + * + * Listen for a message on a channel. + * + * @param args + * Hashtable containing channel name, callback + * @exception PubnubException + * Throws PubnubException if Callback is null + */ + public void subscribe(Hashtable args) throws PubnubException { + + if (!inputsValid(args)) { + return; + } + _subscribe(args); + } + + /** + * + * Listen for a message on a channel. + * + * @param channelsArr + * Array of channel names (string) to listen on + * @param callback + * Callback + * @exception PubnubException + * Throws PubnubException if Callback is null + */ + public void subscribe(String[] channelsArr, Callback callback) + throws PubnubException { + subscribe(channelsArr, callback, "0"); + } + + /** + * + * Listen for a message on a channel. + * + * @param channelsArr + * Array of channel names (string) to listen on + * @param callback + * Callback + * @exception PubnubException + * Throws PubnubException if Callback is null + */ + public void subscribe(String[] channelsArr, Callback callback, + String timetoken) throws PubnubException { + + Hashtable args = new Hashtable(); + + args.put("channels", channelsArr); + args.put("callback", callback); + args.put("timetoken", timetoken); + subscribe(args); + } + + private void callErrorCallbacks(String[] channelList, String message) { + for (int i = 0; i < channelList.length; i++) { + Callback cb = ((Channel) subscriptions.getChannel(channelList[i])).callback; + cb.errorCallback(channelList[i], message); + } + } + + private void decryptJSONArray(JSONArray messages) throws JSONException { + + if (CIPHER_KEY.length() > 0) { + for (int i = 0; i < messages.length(); i++) { + PubnubCrypto pc = new PubnubCrypto(CIPHER_KEY); + try { + String message = pc.decrypt(messages.get(i).toString()); + messages.put(i, stringToJSON(message)); + } catch (Exception e) { + messages.put(i, messages.get(i).toString()); + } + } + } + } + + /** + * @param args + * Hashtable + */ + private void _subscribe(Hashtable args) { + + String[] channelList = (String[]) args.get("channels"); + if (channelList == null) { + channelList = new String[] { (String) args.get("channel") }; + } + Callback callback = (Callback) args.get("callback"); + String timetoken = (String) args.get("timetoken"); + + _saved_timetoken = _timetoken; + _timetoken = (timetoken == null) ? "0" : timetoken; + + /* + * Scan through the channels array. If a channel does not exist in + * hashtable create a new entry with default values. If already exists + * and connected, then return + */ + + for (int i = 0; i < channelList.length; i++) { + String channel = channelList[i]; + Channel channelObj = (Channel) subscriptions.getChannel(channel); + + if (channelObj == null) { + Channel ch = new Channel(); + ch.name = channel; + ch.connected = false; + ch.callback = callback; + subscriptions.addChannel(ch); + } else if (channelObj.connected) { + + return; + } + } + _subscribe_base(true); + } + + private void _subscribe_base(boolean fresh) { + _subscribe_base(fresh, false); + } + private void _subscribe_base(boolean fresh, boolean dar) { + String channelString = subscriptions.getChannelString(); + String[] channelsArray = subscriptions.getChannelNames(); + if (channelsArray.length <= 0) + return; + + if (channelString == null) { + callErrorCallbacks(channelsArray, PubnubError.PNERR_5026_PARSING_ERROR.toString()); + return; + } + String[] urlComponents = { getOrigin(), "subscribe", + PubnubCore.this.SUBSCRIBE_KEY, + PubnubUtil.urlEncode(channelString), "0", _timetoken }; + + Hashtable params = hashtableClone(this.params); + params.put("uuid", UUID); + log.verbose("Subscribing with timetoken : " + _timetoken); + + HttpRequest hreq = new HttpRequest(urlComponents, params, + new ResponseHandler() { + + public void handleResponse(HttpRequest hreq, String response) { + + /* + * Check if response has channel names. A JSON response + * with more than 2 items means the response contains + * the channel names as well. The channel names are in a + * comma delimted string. Call success callback on all + * he channels passing the corresponding response + * message. + */ + + JSONArray jsa; + try { + jsa = new JSONArray(response); + + _timetoken = (!_saved_timetoken.equals("0") && isResumeOnReconnect()) ? _saved_timetoken + : jsa.get(1).toString(); + log.verbose("Resume On Reconnect is " + + isResumeOnReconnect()); + log.verbose("Saved Timetoken : " + _saved_timetoken); + log.verbose("In Response Timetoken : " + + jsa.get(1).toString()); + log.verbose("Timetoken value set to " + _timetoken); + _saved_timetoken = "0"; + log.verbose("Saved Timetoken reset to 0"); + if (!hreq.isDar()) { + subscriptions.invokeConnectCallbackOnChannels(_timetoken); + } else { + subscriptions.invokeReconnectCallbackOnChannels(_timetoken); + } + JSONArray messages = new JSONArray(jsa.get(0) + .toString()); + + if (jsa.length() > 2) { + /* + * Response has multiple channels + */ + + String[] _channels = PubnubUtil.splitString( + jsa.getString(2), ","); + + for (int i = 0; i < _channels.length; i++) { + Channel _channel = (Channel) subscriptions + .getChannel(_channels[i]); + if (_channel != null) { + JSONObject jsobj = null; + if (CIPHER_KEY.length() > 0 + && !_channel.name + .endsWith(PRESENCE_SUFFIX)) { + PubnubCrypto pc = new PubnubCrypto( + CIPHER_KEY); + try { + String message = pc + .decrypt(messages + .get(i) + .toString()); + _channel.callback + .successCallback( + _channel.name, + stringToJSON(message)); + } catch (Exception e) { + _channel.callback + .errorCallback( + _channel.name, + PubnubError.PNERR_5024_DECRYPTION_ERROR + " : " + + messages + .get(i) + .toString()); + } + } else { + _channel.callback.successCallback( + _channel.name, + messages.get(i)); + } + } + } + + } else { + /* + * Response for single channel Callback on + * single channel + */ + Channel _channel = subscriptions + .getFirstChannel(); + + if (_channel != null) { + for (int i = 0; i < messages.length(); i++) { + if (CIPHER_KEY.length() > 0 + && !_channel.name + .endsWith(PRESENCE_SUFFIX)) { + PubnubCrypto pc = new PubnubCrypto( + CIPHER_KEY); + try { + String message = pc + .decrypt(messages + .get(i) + .toString()); + _channel.callback + .successCallback( + _channel.name, + stringToJSON(message)); + } catch (Exception e) { + _channel.callback + .errorCallback( + _channel.name, + PubnubError.PNERR_5025_DECRYPTION_ERROR + " : " + + messages + .get(i) + .toString()); + } + } else { + _channel.callback.successCallback( + _channel.name, + messages.get(i)); + } + + } + } + + } + if (hreq.isSubzero()) { + log.verbose("Response of subscribe 0 request. Need to do dAr process again"); + _subscribe_base(false, hreq.isDar()); + } else + _subscribe_base(false); + } catch (JSONException e) { + if (hreq.isSubzero()) { + log.verbose("Response of subscribe 0 request. Need to do dAr process again"); + _subscribe_base(false, hreq.isDar()); + } else + _subscribe_base(false); + } + + } + + public void handleBackFromDar(HttpRequest hreq) { + _subscribe_base(false); + } + + public void handleError(HttpRequest hreq, String response) { + disconnectAndResubscribe(); + } + + public void handleTimeout(HttpRequest hreq) { + log.verbose("Timeout Occurred, Calling disconnect callbacks on the channels"); + String timeoutTimetoken = (isResumeOnReconnect()) ? (_timetoken + .equals("0")) ? _saved_timetoken + : _timetoken : "0"; + log.verbose("Timeout Timetoken : " + + timeoutTimetoken); + subscriptions.invokeDisconnectCallbackOnChannels(timeoutTimetoken); + //disconnectAndResubscribe(); + + // subscriptions.removeAllChannels(); + } + + public String getTimetoken() { + return _timetoken; + } + }); + if (_timetoken.equals("0")) { + hreq.setSubzero(true); + log.verbose("This is a subscribe 0 request"); + } + hreq.setDar(dar); + _request(hreq, subscribeManager, fresh); + } + + /** + * @param req + * @param connManager + * @param abortExisting + */ + private void _request(final HttpRequest hreq, RequestManager connManager, + boolean abortExisting) { + if (abortExisting) { + connManager.resetHttpManager(); + } + connManager.queue(hreq); + } + + /** + * @param req + * @param simpleConnManager2 + */ + private void _request(final HttpRequest hreq, + RequestManager simpleConnManager) { + _request(hreq, simpleConnManager, false); + } + + private int getRandom() { + return this.generator.nextInt(); + } + + private void changeOrigin() { + this.ORIGIN_STR = null; + this.HOSTNAME_SUFFIX = getRandom(); + } + + private void resubscribe() { + changeOrigin(); + if (!_timetoken.equals("0")) + _saved_timetoken = _timetoken; + _timetoken = "0"; + log.verbose("Before Resubscribe Timetoken : " + _timetoken); + log.verbose("Before Resubscribe Saved Timetoken : " + _saved_timetoken); + _subscribe_base(true, true); + } + + private void resubscribe(String timetoken) { + changeOrigin(); + if (!timetoken.equals("0")) + _saved_timetoken = timetoken; + _timetoken = "0"; + log.verbose("Before Resubscribe Timetoken : " + _timetoken); + log.verbose("Before Resubscribe Saved Timetoken : " + _saved_timetoken); + _subscribe_base(true, true); + } + /** + * Disconnect from all channels, and resubscribe + * + */ + public void disconnectAndResubscribeWithTimetoken(String timetoken) { + disconnectAndResubscribeWithTimetoken(timetoken, ""); + } + + /** + * Disconnect from all channels, and resubscribe + * + */ + public void disconnectAndResubscribeWithTimetoken(String timetoken, String errorMessage) { + log.verbose("Received disconnectAndResubscribeWithTimetoken"); + subscriptions.invokeErrorCallbackOnChannels(errorMessage); + resubscribe(timetoken); + } + + /** + * Disconnect from all channels, and resubscribe + * + */ + public void disconnectAndResubscribe() { + disconnectAndResubscribe(""); + } + + /** + * Disconnect from all channels, and resubscribe + * + */ + public void disconnectAndResubscribe(String errorMessage) { + log.verbose("Received disconnectAndResubscribe"); + subscriptions.invokeErrorCallbackOnChannels(errorMessage); + resubscribe(); + } + + /** + * This method returns array of channel names, currently subscribed to + * + * @return Array of channel names + */ + public String[] getSubscribedChannelsArray() { + return subscriptions.getChannelNames(); + } + + /** + * Sets origin value, default is "pubsub" + * + * @param origin + * Origin value + */ + public void setOrigin(String origin) { + this.HOSTNAME = origin; + } + + /** + * This method return auth key. Return null if not set + * + * @return Auth Key. null if auth key not set + */ + public String getAuthKey() { + return this.AUTH_STR; + } + + /** + * This method sets auth key. + * + * @param authKey . 0 length string or null unsets auth key + */ + public void setAuthKey(String authKey) { + + this.AUTH_STR = authKey; + if ( authKey == null || authKey.length() == 0 ) { + params.remove("auth"); + } else { + params.put("auth", this.AUTH_STR); + } + resubscribe(); + } + + /** + * This method unsets auth key. + * + */ + public void unsetAuthKey() { + this.AUTH_STR = null; + params.remove("auth"); + resubscribe(); + } +} diff --git a/java/srcPubnubApi/com/pubnub/api/PubnubCryptoCore.java b/java/srcPubnubApi/com/pubnub/api/PubnubCryptoCore.java new file mode 100644 index 000000000..eafd2fa83 --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/PubnubCryptoCore.java @@ -0,0 +1,177 @@ +package com.pubnub.api; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; + +import org.bouncycastle.crypto.DataLengthException; +import org.bouncycastle.crypto.Digest; +import org.bouncycastle.crypto.InvalidCipherTextException; +import org.bouncycastle.crypto.digests.MD5Digest; +import org.bouncycastle.crypto.digests.SHA256Digest; +import org.bouncycastle.crypto.engines.AESEngine; +import org.bouncycastle.crypto.modes.CBCBlockCipher; +import org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher; +import org.bouncycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.ParametersWithIV; +import org.bouncycastle.util.encoders.Hex; + +/** + * PubNub 3.1 Cryptography + * + */ +abstract class PubnubCryptoCore { + + PaddedBufferedBlockCipher encryptCipher = null; + PaddedBufferedBlockCipher decryptCipher = null; + byte[] buf = new byte[16]; // input buffer + byte[] obuf = new byte[512]; // output buffer + byte[] key = null; + byte[] IV = null; + public static int blockSize = 16; + String CIPHER_KEY; + + public PubnubCryptoCore(String CIPHER_KEY) { + this.CIPHER_KEY = CIPHER_KEY; + } + + public void InitCiphers() throws UnsupportedEncodingException { + + key = new String(Hex.encode(sha256(this.CIPHER_KEY.getBytes("UTF-8"))), + "UTF-8").substring(0, 32).toLowerCase().getBytes("UTF-8"); + IV = "0123456789012345".getBytes("UTF-8"); + + encryptCipher = new PaddedBufferedBlockCipher(new CBCBlockCipher( + new AESEngine())); + + decryptCipher = new PaddedBufferedBlockCipher(new CBCBlockCipher( + new AESEngine())); + + // create the IV parameter + ParametersWithIV parameterIV = new ParametersWithIV(new KeyParameter( + key), IV); + + encryptCipher.init(true, parameterIV); + decryptCipher.init(false, parameterIV); + } + + public void ResetCiphers() { + if (encryptCipher != null) { + encryptCipher.reset(); + } + if (decryptCipher != null) { + decryptCipher.reset(); + } + } + + public String encrypt(String input) throws DataLengthException, + IllegalStateException, InvalidCipherTextException { + try { + InputStream st = new ByteArrayInputStream(input.getBytes("UTF-8")); + ByteArrayOutputStream ou = new ByteArrayOutputStream(); + CBCEncryptOrDecrypt(st, ou, true); + String s = new String(Base64Encoder.encode(ou.toByteArray())); + return s; + } catch (IOException ex) { + ex.printStackTrace(); + } + return "NULL"; + } + + /** + * Decrypt + * + * @param String + * cipherText + * @return String + * @throws Exception + */ + public String decrypt(String cipher_text) throws DataLengthException, + IllegalStateException, InvalidCipherTextException, IOException { + + byte[] cipher = Base64Encoder.decode(cipher_text); + InputStream st = new ByteArrayInputStream(cipher); + ByteArrayOutputStream ou = new ByteArrayOutputStream(); + CBCEncryptOrDecrypt(st, ou, false); + + return new String(ou.toByteArray()); + + } + + public void CBCEncryptOrDecrypt(InputStream in, OutputStream out, + boolean encrypt) throws DataLengthException, IllegalStateException, + InvalidCipherTextException, IOException { + if (encryptCipher == null || decryptCipher == null) { + InitCiphers(); + } + PaddedBufferedBlockCipher cipher = (encrypt) ? encryptCipher + : decryptCipher; + int noBytesRead = 0; // number of bytes read from input + int noBytesProcessed = 0; // number of bytes processed + + while ((noBytesRead = in.read(buf)) >= 0) { + noBytesProcessed = cipher + .processBytes(buf, 0, noBytesRead, obuf, 0); + out.write(obuf, 0, noBytesProcessed); + } + + noBytesProcessed = cipher.doFinal(obuf, 0); + out.write(obuf, 0, noBytesProcessed); + out.flush(); + in.close(); + out.close(); + } + + public static byte[] hexStringToByteArray(String s) { + int len = s.length(); + byte[] data = new byte[len / 2]; + for (int i = 0; i < len; i += 2) { + data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character + .digit(s.charAt(i + 1), 16)); + } + return data; + } + + /** + * Get MD5 + * + * @param string + * @return + */ + public static byte[] md5(String myString) { + MD5Digest digest = new MD5Digest(); + byte[] bytes = myString.getBytes(); + digest.update(bytes, 0, bytes.length); + byte[] md5 = new byte[digest.getDigestSize()]; + digest.doFinal(md5, 0); + StringBuffer hex = new StringBuffer(md5.length * 2); + for (int i = 0; i < md5.length; i++) { + byte b = md5[i]; + if ((b & 0xFF) < 0x10) { + hex.append("0"); + } + hex.append(Integer.toHexString(b & 0xFF)); + } + return hexStringToByteArray(hex.toString()); + } + + /** + * Get SHA256 + * + * @param string + * @return + */ + public static byte[] sha256(byte[] input) { + + Digest digest = new SHA256Digest(); + byte[] resBuf = new byte[digest.getDigestSize()]; + byte[] bytes = input; + digest.update(bytes, 0, bytes.length); + digest.doFinal(resBuf, 0); + return resBuf; + } + +} diff --git a/java/srcPubnubApi/com/pubnub/api/PubnubError.java b/java/srcPubnubApi/com/pubnub/api/PubnubError.java new file mode 100644 index 000000000..c1ca3f45d --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/PubnubError.java @@ -0,0 +1,43 @@ +package com.pubnub.api; + +public class PubnubError { + + public static final PubnubError PNERR_5000_TIMEOUT = new PubnubError( 5000 , "Timeout Occurred" ); + public static final PubnubError PNERR_5001_ENCRYPTION_ERROR = new PubnubError( 5001 , "Encryption Error" ); + public static final PubnubError PNERR_5002_ERR_DECRYPTION_ERROR = new PubnubError( 5002 , "Decryption Error" ); + public static final PubnubError PNERR_5003_INVALID_JSON = new PubnubError( 5003 , "Invalid Json" ); + public static final PubnubError PNERR_5004_JSON_ERROR = new PubnubError( 5004 , "JSON Processing Error" ); + public static final PubnubError PNERR_5005_JSON_ERROR = new PubnubError( 5005 , "JSON Processing Error" ); + public static final PubnubError PNERR_5006_MALFORMED_URL = new PubnubError( 5006 , "Malformed URL" ); + public static final PubnubError PNERR_5007_PUBNUB_ERROR = new PubnubError( 5007 , "Pubnub Error" ); + public static final PubnubError PNERR_5008_URL_OPEN = new PubnubError( 5008 , "Error opening url" ); + public static final PubnubError PNERR_5009_PROTOCOL_EXCEPTION = new PubnubError( 5009 , "Protocol Exception" ); + public static final PubnubError PNERR_5010_CONNECT_EXCEPTION = new PubnubError( 5010 , "Connect Exception" ); + public static final PubnubError PNERR_5011_HTTP_RC_ERROR = new PubnubError( 5011 , "Unable to get Response Code" ); + public static final PubnubError PNERR_5012_GETINPUTSTREAM = new PubnubError( 5012 , "Unable to get Input Stream" ); + public static final PubnubError PNERR_5013_GETINPUTSTREAM = new PubnubError( 5013 , "Unable to get Input Stream" ); + public static final PubnubError PNERR_5014_READINPUT = new PubnubError( 5014 , "Unable to read Input Stream" ); + public static final PubnubError PNERR_5015_INVALID_JSON = new PubnubError( 5015 , "Invalid Json" ); + public static final PubnubError PNERR_5016_BAD_REQUEST = new PubnubError( 5016 , "Bad request" ); + public static final PubnubError PNERR_5017_HTTP_ERROR = new PubnubError( 5017 , "HTTP Error" ); + public static final PubnubError PNERR_5018_HTTP_ERROR = new PubnubError( 5018 , "HTTP Error" ); + public static final PubnubError PNERR_5019_HTTP_ERROR = new PubnubError( 5019 , "HTTP Error" ); + public static final PubnubError PNERR_5020_BAD_GATEWAY = new PubnubError( 5020 , "Bad Gateway" ); + public static final PubnubError PNERR_5021_CLIENT_TIMEOUT = new PubnubError( 5021 , "Client Timeout" ); + public static final PubnubError PNERR_5022_GATEWAY_TIMEOUT = new PubnubError( 5022 , "Gateway Timeout" ); + public static final PubnubError PNERR_5023_INTERNAL_ERROR = new PubnubError( 5023 , "Internal Server Error" ); + public static final PubnubError PNERR_5024_DECRYPTION_ERROR = new PubnubError( 5024 , "Decryption Error" ); + public static final PubnubError PNERR_5025_DECRYPTION_ERROR = new PubnubError( 5025 , "Decryption Error" ); + public static final PubnubError PNERR_5026_PARSING_ERROR = new PubnubError( 5026 , "Parsing Error" ); + + private final int errorCode; + private final String errorString; + + private PubnubError(int errorCode, String errorString) { + this.errorCode = errorCode; + this.errorString = errorString; + } + public String toString() { + return "[" + errorCode + "] : " + errorString; + } +} diff --git a/java/srcPubnubApi/com/pubnub/api/PubnubException.java b/java/srcPubnubApi/com/pubnub/api/PubnubException.java new file mode 100644 index 000000000..06df2cc4e --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/PubnubException.java @@ -0,0 +1,61 @@ +package com.pubnub.api; + +/** + * PubnubException is thrown by various Pubnub APIs + * + * @author PubnubCore + */ +public class PubnubException extends Exception { + private String errormsg = ""; + private PubnubError pubnubError = PubnubError.PNERR_5007_PUBNUB_ERROR; + + + /** + * Constructor for PubnubException Class with error message as argument + * + * @param s + * Error message + */ + public PubnubException(String s) { + this.errormsg = s; + } + + /** + * Constructor for PubnubException Class with error message as argument + * + * @param pubnubError + * Error message + */ + public PubnubException(PubnubError pubnubError) { + this.pubnubError = pubnubError; + } + + /** + * Constructor for PubnubException Class with error message as argument + * + * @param s + * Error message + */ + public PubnubException(PubnubError pubnubError, String s) { + this.errormsg = s; + this.pubnubError = pubnubError; + } + + + /** + * Read the exception error message + * + * @return String + */ + public String toString() { + String msg = pubnubError.toString(); + if (errormsg.length() > 0 ) + msg = msg + " . " + errormsg; + return msg; + } + + public PubnubError getPubnubError() { + return pubnubError; + } + +} diff --git a/java/srcPubnubApi/com/pubnub/api/PubnubUtilCore.java b/java/srcPubnubApi/com/pubnub/api/PubnubUtilCore.java new file mode 100644 index 000000000..c8f767109 --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/PubnubUtilCore.java @@ -0,0 +1,141 @@ +package com.pubnub.api; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; + +/** + * + * @author PubnubCore + */ +public class PubnubUtilCore { + + /** + * Takes source and delimiter string as inputs and returns splitted string + * in form of tokens in String array + * + * @param source + * , input String + * @param delimiter + * , delimiter to split on + * @return String[] , tokens in and array + */ + public static String[] splitString(String source, String delimiter) { + + int delimiterCount = 0; + int index = 0; + String tmpStr = source; + + String[] splittedList; + + while ((index = tmpStr.indexOf(delimiter)) != -1) { + + tmpStr = tmpStr.substring(index + delimiter.length()); + delimiterCount++; + } + + splittedList = new String[delimiterCount + 1]; + + int counter = 0; + tmpStr = source; + + do { + int nextIndex = tmpStr.indexOf(delimiter, index + 1); + + if (nextIndex != -1) { + splittedList[counter++] = tmpStr.substring( + index + delimiter.length(), nextIndex); + tmpStr = tmpStr.substring(nextIndex); + + } else { + splittedList[counter++] = tmpStr.substring(index + + delimiter.length()); + tmpStr = tmpStr.substring(index + 1); + } + } while ((index = tmpStr.indexOf(delimiter)) != -1); + + return splittedList; + } + + /** + * Takes String[] of tokens, and String delimiter as input and returns + * joined String + * + * @param sourceArray + * , input tokens in String array + * @param delimiter + * , delimiter to join on + * @return String , string of tokens joined by delimiter + */ + public static String joinString(String[] sourceArray, String delimiter) { + StringBuffer sb = new StringBuffer(); + + for (int i = 0; i < sourceArray.length - 1; i++) { + sb.append(sourceArray[i]).append(delimiter); + } + sb.append(sourceArray[sourceArray.length - 1]); + + return sb.toString(); + } + + /** + * Returns string keys in a hashtable as array of string + * + * @param ht + * , Hashtable + * @return , string array with hash keys string + */ + public static synchronized String[] hashtableKeysToArray(Hashtable ht) { + Vector v = new Vector(); + String[] sa = null; + int count = 0; + + Enumeration e = ht.keys(); + while (e.hasMoreElements()) { + String s = (String) e.nextElement(); + v.addElement(s); + count++; + } + + sa = new String[count]; + v.copyInto(sa); + return sa; + + } + + /** + * Returns string keys in a hashtable as delimited string + * + * @param ht + * , Hashtable + * @param delimiter + * , String + * @return , string array with hash keys string + */ + public static synchronized String hashTableKeysToDelimitedString( + Hashtable ht, String delimiter) { + + StringBuffer sb = new StringBuffer(); + boolean first = true; + Enumeration e = ht.keys(); + + while (e.hasMoreElements()) { + + String s = (String) e.nextElement(); + + if (first) { + sb.append(s); + first = false; + } else { + sb.append(delimiter).append(s); + } + } + return sb.toString(); + + } + +} \ No newline at end of file diff --git a/java/srcPubnubApi/com/pubnub/api/RequestManager.java b/java/srcPubnubApi/com/pubnub/api/RequestManager.java new file mode 100644 index 000000000..75fbb4a4c --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/RequestManager.java @@ -0,0 +1,324 @@ +package com.pubnub.api; + +import java.util.Hashtable; +import java.util.Vector; + +abstract class Worker implements Runnable { + private Vector _requestQueue; + protected volatile boolean _die; + private Thread thread; + protected HttpClient httpclient; + + protected static Logger log = new Logger(Worker.class); + + public Thread getThread() { + return thread; + } + + void setThread(Thread thread) { + this.thread = thread; + } + + void startWorker() { + thread.start(); + } + + void interruptWorker() { + thread.interrupt(); + } + + void resetConnection() { + httpclient.reset(); + } + + Worker(Vector _requestQueue, int connectionTimeout, int requestTimeout, Hashtable headers) { + this._requestQueue = _requestQueue; + this.httpclient = HttpClient.getClient(connectionTimeout, + requestTimeout, headers); + } + + void setConnectionTimeout(int timeout) { + if (httpclient != null) { + httpclient.setConnectionTimeout(timeout); + } + } + + void setRequestTimeout(int timeout) { + if (httpclient != null) { + httpclient.setRequestTimeout(timeout); + } + } + + public abstract void shutdown(); + + void die() { + _die = true; + shutdown(); + } + + abstract void process(HttpRequest hreq); + + public void run() { + do { + HttpRequest hreq = null; + while (!_die) { + + synchronized (_requestQueue) { + + if (_requestQueue.size() != 0) { + hreq = (HttpRequest) _requestQueue.firstElement(); + _requestQueue.removeElementAt(0); + break; + } + try { + _requestQueue.wait(1000); + } catch (InterruptedException e) { + } + } + } + if (hreq != null) { + if (!_die) { + process(hreq); + } + } + } while (!_die); + } +} + +class NonSubscribeWorker extends Worker { + + NonSubscribeWorker(Vector _requestQueue, int connectionTimeout, + int requestTimeout, Hashtable headers) { + super(_requestQueue, connectionTimeout, requestTimeout, headers); + } + + void process(HttpRequest hreq) { + HttpResponse hresp = null; + try { + log.debug(hreq.getUrl()); + hresp = httpclient.fetch(hreq.getUrl(), hreq.getHeaders()); + } + catch (PubnubException pe) { + log.debug("Pubnub Exception in Fetch : " + pe.toString()); + if (!_die) + hreq.getResponseHandler().handleError(hreq, pe.toString()); + return; + } + catch (Exception e) { + log.debug("Exception in Fetch : " + e.toString()); + if (!_die) + hreq.getResponseHandler().handleError(hreq, PubnubError.PNERR_5017_HTTP_ERROR.toString()); + return; + } + + if (!_die) { + if (hresp == null) { + log.debug("Error in fetching url : " + hreq.getUrl()); + hreq.getResponseHandler().handleError(hreq, PubnubError.PNERR_5018_HTTP_ERROR.toString()); + return; + } + hreq.getResponseHandler().handleResponse(hreq, hresp.getResponse()); + } + } + + public void shutdown() { + if (httpclient != null) httpclient.shutdown(); + } + +} + +abstract class RequestManager { + + private static int _maxWorkers = 1; + protected Vector _waiting = new Vector(); + protected Worker _workers[]; + protected String name; + protected volatile int connectionTimeout; + protected volatile int requestTimeout; + protected Hashtable headers; + private static int count = 0; + + protected static Logger log = new Logger(RequestManager.class); + + public static int getWorkerCount() { + return _maxWorkers; + } + + public abstract Worker getWorker(); + + private void initManager(int maxCalls, String name) { + if (maxCalls < 1) { + maxCalls = 1; + } + this.name = name; + this.headers = new Hashtable(); + _workers = new Worker[maxCalls]; + + synchronized(_workers) { + for (int i = 0; i < maxCalls; ++i) { + Worker w = getWorker(); + w.setThread(new Thread(w, name + "-" + ++count)); + _workers[i] = w; + log.verbose("Starting new worker " + _workers[i].getThread().getName()); + w.startWorker(); + } + } + } + + public RequestManager(String name, int connectionTimeout, int requestTimeout) { + this.connectionTimeout = connectionTimeout; + this.requestTimeout = requestTimeout; + initManager(_maxWorkers, name); + } + + private void interruptWorkers() { + synchronized(_workers) { + for (int i = 0; i < _workers.length; i++) { + _workers[i].interruptWorker(); + } + } + } + + public void resetWorkers() { + synchronized(_workers) { + for (int i = 0; i < _workers.length; i++) { + log.verbose("Sending DIE to " + _workers[i].getThread().getName()); + _workers[i].die(); + _workers[i].interruptWorker(); + Worker w = getWorker(); + w.setThread(new Thread(w, name + "-" + ++count)); + _workers[i] = w; + log.verbose("Starting new worker " + _workers[i].getThread().getName()); + w.startWorker(); + } + } + } + + public void setHeader(String key, String value) { + this.headers.put(key, value); + } + + public abstract void clearRequestQueue(); + + public void resetHttpManager() { + clearRequestQueue(); + resetWorkers(); + } + + public void abortClearAndQueue(HttpRequest hreq) { + resetHttpManager(); + queue(hreq); + } + + public void queue(HttpRequest hreq) { + log.debug("Queued : " + hreq.getUrl()); + synchronized (_waiting) { + _waiting.addElement(hreq); + _waiting.notifyAll(); + } + } + + public static void setWorkerCount(int count) { + _maxWorkers = count; + } + + public void stop() { + synchronized(_workers) { + for (int i = 0; i < _maxWorkers; ++i) { + Worker w = _workers[i]; + w.die(); + } + } + synchronized (_waiting) { + _waiting.notifyAll(); + } + } +} + +abstract class AbstractSubscribeManager extends RequestManager { + + protected volatile int maxRetries = 5; + protected volatile int retryInterval = 5000; + + public AbstractSubscribeManager(String name, int connectionTimeout, + int requestTimeout) { + super(name, connectionTimeout, requestTimeout); + } + + public Worker getWorker() { + return new SubscribeWorker(_waiting, + connectionTimeout, requestTimeout, + maxRetries, retryInterval, headers); + } + + public void setMaxRetries(int maxRetries) { + this.maxRetries = maxRetries; + for (int i = 0; i < _workers.length; i++) { + ((SubscribeWorker) _workers[i]).setMaxRetries(maxRetries); + } + } + + public void setRetryInterval(int retryInterval) { + this.retryInterval = retryInterval; + for (int i = 0; i < _workers.length; i++) { + ((SubscribeWorker) _workers[i]).setRetryInterval(retryInterval); + } + } + + public void setConnectionTimeout(int timeout) { + this.connectionTimeout = timeout; + } + + public void setRequestTimeout(int timeout) { + this.requestTimeout = timeout; + } + +} + +abstract class AbstractNonSubscribeManager extends RequestManager { + public AbstractNonSubscribeManager(String name, int connectionTimeout, + int requestTimeout) { + super(name, connectionTimeout, requestTimeout); + } + + public Worker getWorker() { + return new NonSubscribeWorker(_waiting, connectionTimeout, + requestTimeout, headers); + } + + public void setConnectionTimeout(int timeout) { + this.connectionTimeout = timeout; + for (int i = 0; i < _workers.length; i++) { + _workers[i].setConnectionTimeout(timeout); + } + } + + public void setRequestTimeout(int timeout) { + this.requestTimeout = timeout; + for (int i = 0; i < _workers.length; i++) { + _workers[i].setRequestTimeout(timeout); + } + } + +} + +abstract class AbstractSubscribeWorker extends Worker { + protected volatile int maxRetries = 5; + protected volatile int retryInterval = 5000; + + AbstractSubscribeWorker(Vector _requestQueue, int connectionTimeout, + int requestTimeout, int maxRetries, int retryInterval, Hashtable headers) { + super(_requestQueue, connectionTimeout, requestTimeout, headers); + this.maxRetries = maxRetries; + this.retryInterval= retryInterval; + } + + public void setMaxRetries(int maxRetries) { + this.maxRetries = maxRetries; + } + + public void setRetryInterval(int retryInterval) { + this.retryInterval = retryInterval; + } + +} \ No newline at end of file diff --git a/java/srcPubnubApi/com/pubnub/api/ResponseHandler.java b/java/srcPubnubApi/com/pubnub/api/ResponseHandler.java new file mode 100644 index 000000000..4fb4559eb --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/ResponseHandler.java @@ -0,0 +1,16 @@ +package com.pubnub.api; + +/** + * @author PubnubCore + */ + +abstract class ResponseHandler { + public abstract void handleResponse(HttpRequest hreq, String response); + + public abstract void handleError(HttpRequest hreq, String response); + + public void handleTimeout(HttpRequest hreq) { + } + public void handleBackFromDar(HttpRequest hreq) { + } +} diff --git a/java/srcPubnubApi/com/pubnub/api/Subscriptions.java b/java/srcPubnubApi/com/pubnub/api/Subscriptions.java new file mode 100644 index 000000000..873fd9b09 --- /dev/null +++ b/java/srcPubnubApi/com/pubnub/api/Subscriptions.java @@ -0,0 +1,133 @@ +package com.pubnub.api; + +import java.util.Enumeration; +import java.util.Hashtable; + +import org.json.JSONArray; + +/** + * @author PubnubCore + * + */ +class Subscriptions { + private Hashtable channels; + + public Subscriptions() { + channels = new Hashtable(); + } + + public void addChannel(Channel channel) { + channels.put(channel.name, channel); + } + + public void removeChannel(String name) { + channels.remove(name); + } + + public void removeAllChannels() { + channels.clear(); + } + + public Channel getFirstChannel() { + Channel ch = null; + synchronized (channels) { + if (channels.size() > 0) { + ch = (Channel) channels.elements().nextElement(); + } + } + return ch; + + } + + public Channel getChannel(String name) { + return (Channel) channels.get(name); + } + + public String[] getChannelNames() { + + return PubnubUtil.hashtableKeysToArray(channels); + } + + public String getChannelString() { + return PubnubUtil.hashTableKeysToDelimitedString(channels, ","); + + } + + public void invokeConnectCallbackOnChannels(Object message) { + invokeConnectCallbackOnChannels(getChannelNames(), message); + } + + public void invokeDisconnectCallbackOnChannels(Object message) { + invokeDisconnectCallbackOnChannels(getChannelNames(), message); + } + + public void invokeErrorCallbackOnChannels(Object message) { + /* + * Iterate over all the channels and call error callback for channels + */ + synchronized (channels) { + Enumeration ch = channels.elements(); + while (ch.hasMoreElements()) { + Channel _channel = (Channel) ch.nextElement(); + _channel.error = true; + _channel.callback.errorCallback(_channel.name, message); + } + } + } + + public void invokeConnectCallbackOnChannels(String[] channels, Object message) { + synchronized (channels) { + for (int i = 0; i < channels.length; i++) { + Channel _channel = (Channel) this.channels.get(channels[i]); + if (_channel != null) { + if (_channel.connected == false) { + _channel.connected = true; + if (_channel.subscribed == false) { + _channel.callback.connectCallback(_channel.name, + new JSONArray().put(1).put("Subscribe connected").put(message)); + } else { + _channel.subscribed = true; + _channel.callback.reconnectCallback(_channel.name, + new JSONArray().put(1).put("Subscribe reconnected").put(message)); + } + } + } + } + } + } + + public void invokeReconnectCallbackOnChannels(Object message) { + invokeReconnectCallbackOnChannels(getChannelNames(), message); + } + + public void invokeReconnectCallbackOnChannels(String[] channels, Object message) { + synchronized (channels) { + for (int i = 0; i < channels.length; i++) { + Channel _channel = (Channel) this.channels.get(channels[i]); + if (_channel != null) { + _channel.connected = true; + if ( _channel.error ) { + _channel.callback.reconnectCallback(_channel.name, + new JSONArray().put(1).put("Subscribe reconnected").put(message)); + _channel.error = false; + } + } + } + } + } + + public void invokeDisconnectCallbackOnChannels(String[] channels, Object message) { + synchronized (channels) { + for (int i = 0; i < channels.length; i++) { + Channel _channel = (Channel) this.channels.get(channels[i]); + if (_channel != null) { + if (_channel.connected == true) { + _channel.connected = false; + _channel.callback.disconnectCallback(_channel.name, + new JSONArray().put(0).put("Subscribe unable to connect").put(message)); + } + } + } + } + } +} diff --git a/java/srcTest/com/pubnub/api/PubnubTest.java b/java/srcTest/com/pubnub/api/PubnubTest.java new file mode 100644 index 000000000..0793d69cb --- /dev/null +++ b/java/srcTest/com/pubnub/api/PubnubTest.java @@ -0,0 +1,565 @@ +package com.pubnub.api; + +import static org.junit.Assert.*; + +import java.util.Hashtable; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.junit.Test; + + + + + + +public class PubnubTest { + + class SubscribeCallback extends Callback { + + private CountDownLatch latch; + + private Object response; + + public SubscribeCallback(CountDownLatch latch) { + this.latch = latch; + } + + public SubscribeCallback() { + + } + + + public Object getResponse() { + return response; + } + + @Override + public void successCallback(String channel, Object message) { + response = message; + if (latch != null) latch.countDown(); + } + + @Override + public void errorCallback(String channel, Object message) { + response = message; + if (latch != null) latch.countDown(); + } + } + + + class PublishCallback extends Callback { + + private CountDownLatch latch; + private int result = 0; + + public int getResult() { + return result; + } + + public PublishCallback(CountDownLatch latch) { + this.latch = latch; + } + + public PublishCallback() { + + } + + public void successCallback(String channel, Object message) { + JSONArray jsarr; + try { + jsarr = (JSONArray)message; + result = (Integer) jsarr.get(0); + } catch (JSONException e) { + e.printStackTrace(); + } + if (latch != null) latch.countDown(); + } + + public void errorCallback(String channel, Object message) { + JSONArray jsarr; + try { + jsarr = new JSONArray(message); + System.out.println(message.toString()); + result = (Integer) jsarr.get(0); + } catch (JSONException e) { + e.printStackTrace(); + } + if (latch != null) latch.countDown(); + } + + } + + class HereNowCallback extends Callback { + + private int occupancy; + private String[] uuids; + private CountDownLatch latch; + + public int getOccupancy() { + return occupancy; + } + + public HereNowCallback(CountDownLatch latch) { + this.latch = latch; + } + + public HereNowCallback() { + + } + + @Override + public void successCallback(String channel, Object message) { + JSONObject resp = null; + try { + resp = new JSONObject(message.toString()); + } catch (JSONException e1) { + e1.printStackTrace(); + } + if (resp != null) { + try { + occupancy = (Integer) resp.get("occupancy"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + if (latch != null) latch.countDown(); + } + + @Override + public void errorCallback(String channel, Object message) { + if (latch != null) latch.countDown(); + } + + } + class PresenceCallback extends Callback { + + private String uuid; + private CountDownLatch latch; + + public String getUUID() { + return uuid; + } + + public PresenceCallback(CountDownLatch latch) { + this.latch = latch; + } + + public PresenceCallback() { + + } + + @Override + public void successCallback(String channel, Object message) { + JSONObject resp = null; + try { + resp = new JSONObject(message.toString()); + } catch (JSONException e1) { + e1.printStackTrace(); + } + if (resp != null) { + try { + uuid = (String) resp.get("uuid"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + if (latch != null) latch.countDown(); + } + + @Override + public void errorCallback(String channel, Object message) { + if (latch != null) latch.countDown(); + } + + } + + class HistoryCallback extends Callback { + + private int count; + private String[] uuids; + private CountDownLatch latch; + + public int getCount() { + return count; + } + + public HistoryCallback(CountDownLatch latch) { + this.latch = latch; + } + + public HistoryCallback() { + + } + + @Override + public void successCallback(String channel, Object message) { + JSONArray resp = null; + try { + resp = (new JSONArray(message.toString())).getJSONArray(0); + } catch (JSONException e1) { + e1.printStackTrace(); + } + if (resp != null) { + count = resp.length(); + } + if (latch != null) latch.countDown(); + } + + @Override + public void errorCallback(String channel, Object message) { + if (latch != null) latch.countDown(); + } + + } + + + + Pubnub pubnub = new Pubnub("demo", "demo"); + Pubnub pubnub_enc = new Pubnub("demo", "demo", "demo", "demo", false); + String testSuccessMessage = ""; + + + @Test + public void testPublishString() { + String channel = "java-unittest-" + Math.random(); + final String sendMessage = "Test Message " + Math.random(); + + final CountDownLatch latch = new CountDownLatch(2); + + final PublishCallback pbCb = new PublishCallback(latch); + SubscribeCallback sbCb = new SubscribeCallback(latch) { + @Override + public void connectCallback(String channel, Object message) { + pubnub.publish(channel, sendMessage, pbCb); + } + }; + + Hashtable args = new Hashtable(); + args.put("channel", channel); + args.put("callback", sbCb); + + try { + pubnub.subscribe(args); + } catch (PubnubException e1) { + + } + + try { + latch.await(5, TimeUnit.SECONDS); + } catch (InterruptedException e) { + + } + assertEquals(1, pbCb.getResult()); + assertEquals(sendMessage,sbCb.getResponse()); + } + + @Test + public void testPublishJSONArray() { + String channel = "java-unittest-" + Math.random(); + final JSONArray sendMessage = new JSONArray().put(1).put("Test"); + + final CountDownLatch latch = new CountDownLatch(2); + + final PublishCallback pbCb = new PublishCallback(latch); + SubscribeCallback sbCb = new SubscribeCallback(latch) { + @Override + public void connectCallback(String channel, Object message) { + pubnub.publish(channel, sendMessage, pbCb); + } + }; + + Hashtable args = new Hashtable(); + args.put("channel", channel); + args.put("callback", sbCb); + + try { + pubnub.subscribe(args); + } catch (PubnubException e1) { + + } + + try { + latch.await(5, TimeUnit.SECONDS); + } catch (InterruptedException e) { + + } + assertEquals(1, pbCb.getResult()); + assertEquals(sendMessage.toString(), sbCb.getResponse().toString()); + } + + @Test + public void testPublishJSONObject() { + String channel = "java-unittest-" + Math.random(); + + try { + final JSONObject sendMessage; + + sendMessage = new JSONObject().put("1", "Test"); + + final CountDownLatch latch = new CountDownLatch(2); + + final PublishCallback pbCb = new PublishCallback(latch); + SubscribeCallback sbCb = new SubscribeCallback(latch) { + @Override + public void connectCallback(String channel, Object message) { + pubnub.publish(channel, sendMessage, pbCb); + } + }; + + Hashtable args = new Hashtable(); + args.put("channel", channel); + args.put("callback", sbCb); + + pubnub.subscribe(args); + + latch.await(5, TimeUnit.SECONDS); + assertEquals(1, pbCb.getResult()); + assertEquals(sendMessage.toString(), sbCb.getResponse().toString()); + } catch (Exception e) { + + } + } + + @Test + public void testPublishStringWithEncryption() { + String channel = "java-unittest-" + Math.random(); + final String sendMessage = "Test Message " + Math.random(); + + final CountDownLatch latch = new CountDownLatch(2); + + final PublishCallback pbCb = new PublishCallback(latch); + SubscribeCallback sbCb = new SubscribeCallback(latch) { + @Override + public void connectCallback(String channel, Object message) { + pubnub_enc.publish(channel, sendMessage, pbCb); + } + }; + + Hashtable args = new Hashtable(); + args.put("channel", channel); + args.put("callback", sbCb); + + try { + pubnub_enc.subscribe(args); + } catch (PubnubException e1) { + + } + + try { + latch.await(10, TimeUnit.SECONDS); + } catch (InterruptedException e) { + + } + assertEquals(1, pbCb.getResult()); + assertEquals(sendMessage,sbCb.getResponse()); + } + + @Test + public void testPublishJSONArrayWithEncryption() { + String channel = "java-unittest-" + Math.random(); + final JSONArray sendMessage = new JSONArray().put(1).put("Test"); + + final CountDownLatch latch = new CountDownLatch(2); + + final PublishCallback pbCb = new PublishCallback(latch); + SubscribeCallback sbCb = new SubscribeCallback(latch) { + @Override + public void connectCallback(String channel, Object message) { + pubnub_enc.publish(channel, sendMessage, pbCb); + } + }; + + Hashtable args = new Hashtable(); + args.put("channel", channel); + args.put("callback", sbCb); + + try { + pubnub_enc.subscribe(args); + } catch (PubnubException e1) { + + } + + try { + latch.await(10, TimeUnit.SECONDS); + } catch (InterruptedException e) { + + } + assertEquals(1, pbCb.getResult()); + assertEquals(sendMessage.toString(), sbCb.getResponse().toString()); + } + + @Test + public void testPublishJSONObjectWithEncryption() { + String channel = "java-unittest-" + Math.random(); + + try { + final JSONObject sendMessage; + + sendMessage = new JSONObject().put("1", "Test"); + + final CountDownLatch latch = new CountDownLatch(2); + + final PublishCallback pbCb = new PublishCallback(latch); + SubscribeCallback sbCb = new SubscribeCallback(latch) { + @Override + public void connectCallback(String channel, Object message) { + pubnub_enc.publish(channel, sendMessage, pbCb); + } + }; + + Hashtable args = new Hashtable(); + args.put("channel", channel); + args.put("callback", sbCb); + + pubnub_enc.subscribe(args); + + latch.await(10, TimeUnit.SECONDS); + assertEquals(1, pbCb.getResult()); + assertEquals(sendMessage.toString(), sbCb.getResponse().toString()); + } catch (Exception e) { + + } + } + + + + @Test + public void testHereNowOneUser() { + String channel = "java-unittest-" + Math.random(); + + try { + final JSONObject sendMessage; + + sendMessage = new JSONObject().put("1", "Test"); + + final CountDownLatch latch = new CountDownLatch(2); + + final HereNowCallback hnCb = new HereNowCallback(latch); + + SubscribeCallback sbCb = new SubscribeCallback(latch) { + @Override + public void connectCallback(String channel, Object message) { + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + + } + pubnub.hereNow(channel, hnCb); + pubnub.unsubscribe(channel); + if (latch != null) latch.countDown(); + } + }; + + Hashtable args = new Hashtable(); + args.put("channel", channel); + args.put("callback", sbCb); + + pubnub.subscribe(args); + + latch.await(10, TimeUnit.SECONDS); + assertEquals(1, hnCb.getOccupancy()); + } catch (Exception e) { + + } + } + @Test + public void testHistoryCountOne() { + String channel = "java-unittest-" + Math.random(); + final String sendMessage = "Test Message " + Math.random(); + final CountDownLatch latch = new CountDownLatch(3); + final int limit = 1; + final HistoryCallback hCb = new HistoryCallback(latch); + + pubnub.publish(channel, sendMessage, new PublishCallback(latch){ + @Override + public void successCallback(String channel, Object message) { + pubnub.publish(channel, sendMessage, new PublishCallback(latch) { + @Override + public void successCallback(String channel, Object message) { + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + pubnub.detailedHistory(channel, limit, hCb); + super.successCallback(channel, message); + } + }); + super.successCallback(channel, message); + } + }); + try { + latch.await(15, TimeUnit.SECONDS); + } catch (InterruptedException e) { + e.printStackTrace(); + } + assertEquals(limit, hCb.getCount()); + } + + @Test + public void testHistory() { + String channel = "java-unittest-" + Math.random(); + final String sendMessage = "Test Message " + Math.random(); + final CountDownLatch latch = new CountDownLatch(3); + + final HistoryCallback hCb = new HistoryCallback(latch); + + pubnub.publish(channel, sendMessage, new PublishCallback(latch){ + @Override + public void successCallback(String channel, Object message) { + pubnub.publish(channel, sendMessage, new PublishCallback(latch) { + @Override + public void successCallback(String channel, Object message) { + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + pubnub.detailedHistory(channel, 100, hCb); + super.successCallback(channel, message); + } + }); + super.successCallback(channel, message); + } + }); + try { + latch.await(15, TimeUnit.SECONDS); + } catch (InterruptedException e) { + e.printStackTrace(); + } + assertEquals(2, hCb.getCount()); + } + + + @Test + public void testPresence() { + String channel = "java-unittest-" + Math.random(); + CountDownLatch latch = new CountDownLatch(2); + + PresenceCallback presenceCb = new PresenceCallback(latch); + + try { + pubnub.presence(channel, presenceCb); + + Pubnub pubnub2 = new Pubnub("demo", "demo"); + + Hashtable args = new Hashtable(); + args.put("channel", channel); + args.put("callback", new SubscribeCallback(latch)); + + pubnub2.subscribe(args); + + latch.await(10, TimeUnit.SECONDS); + assertEquals(pubnub2.UUID, presenceCb.getUUID()); + } + catch (Exception e) { + e.printStackTrace(); + assertTrue(false); + } + } + +}