Skip to content

Commit

Permalink
adding windowing support to java
Browse files Browse the repository at this point in the history
  • Loading branch information
Devendra committed Oct 23, 2013
1 parent bb37031 commit 4cbdecf
Show file tree
Hide file tree
Showing 36 changed files with 177 additions and 58 deletions.
Binary file modified android/Pubnub-Android-3.5.5.jar
Binary file not shown.
Binary file modified android/Pubnub-Android-Debug-3.5.5.jar
Binary file not shown.
Binary file modified android/examples/PubnubExample/libs/Pubnub-Android-3.5.5.jar
Binary file not shown.
Binary file modified android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.5.5.jar
Binary file not shown.
Binary file modified blackberry/Pubnub-BlackBerry-3.5.5.jar
Binary file not shown.
Binary file modified blackberry/Pubnub-BlackBerry-Debug-3.5.5.jar
Binary file not shown.
Binary file modified codenameone/Pubnub-CodeNameOne-3.5.5.cn1lib
Binary file not shown.
11 changes: 11 additions & 0 deletions codenameone/src/com/pubnub/api/SubscribeWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ class SubscribeWorker extends AbstractSubscribeWorker {
maxRetries, retryInterval, headers);
}

SubscribeWorker(Vector _requestQueue, int connectionTimeout,
int requestTimeout, int maxRetries, int retryInterval, int windowInterval, Hashtable headers) {
super(_requestQueue, connectionTimeout, requestTimeout,
maxRetries, retryInterval, windowInterval, headers);
}
void process(HttpRequest hreq) {
HttpResponse hresp = null;
int currentRetryAttempt = (hreq.isDar())?1:maxRetries;
Expand All @@ -24,6 +29,12 @@ void process(HttpRequest hreq) {
return;
}
}
if (!hreq.isSubzero() && windowInterval != 0) {
try {
Thread.sleep(windowInterval);
} catch (InterruptedException e) {
}
}
hreq.setWorker(this);
while (!_die && currentRetryAttempt <= maxRetries) {
try {
Expand Down
Binary file modified j2me/Pubnub-MicroEdition-3.5.5.jar
Binary file not shown.
12 changes: 12 additions & 0 deletions j2me/src1/com/pubnub/api/SubscribeWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,23 @@ class SubscribeWorker extends AbstractSubscribeWorker {
maxRetries, retryInterval, headers);
}

SubscribeWorker(Vector _requestQueue, int connectionTimeout,
int requestTimeout, int maxRetries, int retryInterval, int windowInterval, Hashtable headers) {
super(_requestQueue, connectionTimeout, requestTimeout,
maxRetries, retryInterval, windowInterval, headers);
}

void process(HttpRequest hreq) {
HttpResponse hresp = null;
int currentRetryAttempt = (hreq.isDar())?1:maxRetries;
log.verbose("disconnectAndResubscribe is " + hreq.isDar());
boolean sleep = false;
if (!hreq.isSubzero() && windowInterval != 0) {
try {
Thread.sleep(windowInterval);
} catch (InterruptedException e) {
}
}
while (!_die && currentRetryAttempt <= maxRetries) {
if (sleep) {
try {
Expand Down
Binary file modified java/Pubnub-StandardEdition-3.5.5.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions java/doc/allclasses-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:49 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:41 IST 2013 -->
<TITLE>
All Classes
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions java/doc/allclasses-noframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:49 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:41 IST 2013 -->
<TITLE>
All Classes
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions java/doc/com/pubnub/api/Callback.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:48 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:40 IST 2013 -->
<TITLE>
Callback
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions java/doc/com/pubnub/api/HttpUtil.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:48 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:40 IST 2013 -->
<TITLE>
HttpUtil
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

Expand Down
47 changes: 45 additions & 2 deletions java/doc/com/pubnub/api/Pubnub.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:48 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:40 IST 2013 -->
<TITLE>
Pubnub
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

Expand Down Expand Up @@ -407,6 +407,14 @@ <H2>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/pubnub/api/Pubnub.html#getWindowInterval()">getWindowInterval</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns current window interval for subscribe</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/pubnub/api/Pubnub.html#hereNow(java.lang.String, com.pubnub.api.Callback)">hereNow</A></B>(java.lang.String&nbsp;channel,
<A HREF="../../../com/pubnub/api/Callback.html" title="class in com.pubnub.api">Callback</A>&nbsp;callback)</CODE>
Expand Down Expand Up @@ -773,6 +781,14 @@ <H2>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/pubnub/api/Pubnub.html#setWindowInterval(int)">setWindowInterval</A></B>(int&nbsp;windowInterval)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method sets window interval for subscribe.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/pubnub/api/Pubnub.html#shutdown()">shutdown</A></B>()</CODE>

<BR>
Expand Down Expand Up @@ -1683,6 +1699,19 @@ <H2>
</DL>
<HR>

<A NAME="setWindowInterval(int)"><!-- --></A><H3>
setWindowInterval</H3>
<PRE>
public void <B>setWindowInterval</B>(int&nbsp;windowInterval)</PRE>
<DL>
<DD>This method sets window interval for subscribe.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>windowInterval</CODE> - Window Interval in milliseconds</DL>
</DD>
</DL>
<HR>

<A NAME="getRetryInterval()"><!-- --></A><H3>
getRetryInterval</H3>
<PRE>
Expand All @@ -1697,6 +1726,20 @@ <H2>
</DL>
<HR>

<A NAME="getWindowInterval()"><!-- --></A><H3>
getWindowInterval</H3>
<PRE>
public int <B>getWindowInterval</B>()</PRE>
<DL>
<DD>Returns current window interval for subscribe
<P>
<DD><DL>

<DT><B>Returns:</B><DD>Current Window Interval in milliseconds</DL>
</DD>
</DL>
<HR>

<A NAME="setMaxRetries(int)"><!-- --></A><H3>
setMaxRetries</H3>
<PRE>
Expand Down
4 changes: 2 additions & 2 deletions java/doc/com/pubnub/api/PubnubError.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:49 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:41 IST 2013 -->
<TITLE>
PubnubError
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions java/doc/com/pubnub/api/PubnubException.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:49 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:41 IST 2013 -->
<TITLE>
PubnubException
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions java/doc/com/pubnub/api/PubnubUtil.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:49 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:41 IST 2013 -->
<TITLE>
PubnubUtil
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions java/doc/com/pubnub/api/package-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:49 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:41 IST 2013 -->
<TITLE>
com.pubnub.api
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions java/doc/com/pubnub/api/package-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:49 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:41 IST 2013 -->
<TITLE>
com.pubnub.api
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions java/doc/com/pubnub/api/package-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:49 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:41 IST 2013 -->
<TITLE>
com.pubnub.api Class Hierarchy
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions java/doc/constant-values.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:49 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:41 IST 2013 -->
<TITLE>
Constant Field Values
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions java/doc/deprecated-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:49 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:41 IST 2013 -->
<TITLE>
Deprecated List
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions java/doc/help-doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:49 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:41 IST 2013 -->
<TITLE>
API Help
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions java/doc/index-all.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:49 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:41 IST 2013 -->
<TITLE>
Index
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="./stylesheet.css" TITLE="Style">

Expand Down
2 changes: 1 addition & 1 deletion java/doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Mon Aug 26 12:12:49 IST 2013-->
<!-- Generated by javadoc on Wed Oct 23 11:02:41 IST 2013-->
<TITLE>
Generated Documentation (Untitled)
</TITLE>
Expand Down
4 changes: 2 additions & 2 deletions java/doc/overview-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:49 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:41 IST 2013 -->
<TITLE>
Class Hierarchy
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions java/doc/serialized-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Aug 26 12:12:49 IST 2013 -->
<!-- Generated by javadoc (build 1.6.0_37) on Wed Oct 23 11:02:41 IST 2013 -->
<TITLE>
Serialized Form
</TITLE>

<META NAME="date" CONTENT="2013-08-26">
<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

Expand Down
Loading

0 comments on commit 4cbdecf

Please sign in to comment.