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
Pubnub(java.lang.String publish_key, java.lang.String subscribe_key, java.lang.String secret_key, java.lang.String cipher_key, boolean ssl_on, java.lang.String initialization_vector)
          Constructor for Pubnub Class
 
Method Summary
 void detailedHistory(java.lang.String channel, boolean reverse, Callback callback)
          Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Replaced by history(String channel, boolean reverse, Callback callback)
 void detailedHistory(java.lang.String channel, int count, boolean reverse, Callback callback)
          Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Replaced by history(String channel, int count, boolean reverse, Callback callback)
 void detailedHistory(java.lang.String channel, int count, Callback callback)
          Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Replaced by history(String channel, int count, Callback callback)
 void detailedHistory(java.lang.String channel, long start, boolean reverse, Callback callback)
          Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Replaced by history(String channel, long start, boolean reverse, Callback callback)
 void detailedHistory(java.lang.String channel, long start, long end, boolean reverse, Callback callback)
          Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Replaced by history(String channel, long start, long end, boolean reverse, Callback callback)
 void detailedHistory(java.lang.String channel, long start, long end, Callback callback)
          Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Replaced by history(String channel, long start, long end, Callback callback)
 void detailedHistory(java.lang.String channel, long start, long end, int count, boolean reverse, Callback callback)
          Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Replaced by history(String channel, long start, long end, int count, boolean reverse, Callback callback)
 void disconnectAndResubscribe()
          Disconnect from all channels, and resubscribe
 void disconnectAndResubscribe(PubnubError error)
          Disconnect from all channels, and resubscribe
 void disconnectAndResubscribeWithTimetoken(java.lang.String timetoken)
          Disconnect from all channels, and resubscribe
 void disconnectAndResubscribeWithTimetoken(java.lang.String timetoken, PubnubError error)
          Disconnect from all channels, and resubscribe
 java.lang.String getAuthKey()
          This method returns auth key.
 boolean getCacheBusting()
          Get Cache Busting value
 java.lang.String getCurrentlySubscribedChannelNames()
          This method returns all channel names currently subscribed to in form of a comma separated String
 java.lang.String getDomain()
          Returns domain
 int getMaxRetries()
          Returns current max retries for Subscribe
 int getNonSubscribeTimeout()
          This method returns timeout value for non subscribe operations like publish, history, hereNow
 java.lang.String getOrigin()
          Returns origin
 boolean getResumeOnReconnect()
          Returns Resume on Reconnect current setting
 int getRetryInterval()
          Returns current retry interval for subscribe
 java.lang.String[] getSubscribedChannelsArray()
          This method returns array of channel names, currently subscribed to
 int getSubscribeTimeout()
          This method returns timeout value for subscribe/presence.
 void hereNow(java.lang.String channel, Callback callback)
          Read presence information from a channel
 void history(java.util.Hashtable args)
          Read history from a channel.
 void history(java.lang.String channel, boolean reverse, Callback callback)
          Read History for a channel.
 void history(java.lang.String channel, int count, boolean reverse, Callback callback)
          Read History for a channel.
 void history(java.lang.String channel, int count, Callback callback)
          Read History for a channel.
 void history(java.lang.String channel, long start, boolean reverse, Callback callback)
          Read history for a channel.
 void history(java.lang.String channel, long start, long end, boolean reverse, Callback callback)
          Read History for a channel.
 void history(java.lang.String channel, long start, long end, Callback callback)
          Read History for a channel.
 void history(java.lang.String channel, long start, long end, int count, boolean reverse, Callback callback)
          Read History for a channel.
 boolean isResumeOnReconnect()
          This method returns the state of Resume on Reconnect setting
 void pamAudit(Callback callback)
          ULS Audit
 void pamAudit(java.lang.String channel, Callback callback)
          ULS audit by channel
 void pamAudit(java.lang.String channel, java.lang.String auth_key, Callback callback)
          ULS audit by channel and auth key
 void pamGrant(java.lang.String channel, java.lang.String auth_key, boolean read, boolean write, Callback callback)
          Grant r/w access based on channel and auth key
 void pamGrant(java.lang.String channel, java.lang.String auth_key, boolean read, boolean write, int ttl, Callback callback)
          Grant r/w access based on channel and auth key
 void pamRevoke(java.lang.String channel, java.lang.String auth_key, Callback callback)
          ULS revoke by channel and auth key
 void presence(java.lang.String channel, Callback callback)
          Listen for presence of subscribers on a channel
 void publish(java.util.Hashtable args)
          Deprecated. As of version 3.5.2 . Will be removed in 3.6.0 . Methods accepting Hashtable as arguments have been deprecated.
 void publish(java.util.Hashtable args, Callback callback)
          Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Methods accepting Hashtable as arguments have been deprecated.
 void publish(java.lang.String channel, java.lang.Double message, Callback callback)
          Send a message to a channel.
 void publish(java.lang.String channel, java.lang.Integer message, Callback callback)
          Send a message to a channel.
 void publish(java.lang.String channel, org.json.JSONArray message, Callback callback)
          Send a message to a channel.
 void publish(java.lang.String channel, org.json.JSONObject message, Callback callback)
          Send a message to a channel.
 void publish(java.lang.String channel, java.lang.String message, Callback callback)
          Send a message to a channel.
 void setAuthKey(java.lang.String authKey)
          This method sets auth key.
 void setCacheBusting(boolean cacheBusting)
          Enable/Disable Cache Busting
 void setDomain(java.lang.String domain)
          Sets domain value, default is "pubnub.com"
 void setMaxRetries(int maxRetries)
          This methods sets maximum number of retries for subscribe.
 void setNonSubscribeTimeout(int timeout)
          This method set timeout value for non subscribe operations like publish, history, hereNow.
 void setOrigin(java.lang.String origin)
          Sets origin value, default is "pubsub"
 void setResumeOnReconnect(boolean resumeOnReconnect)
          If Resume on Reconnect is set to true, then Pubnub catches up on reconnection after disconnection.
 void setRetryInterval(int retryInterval)
          This method sets retry interval for subscribe.
 void setSubscribeTimeout(int timeout)
          This method sets timeout value for subscribe/presence.
 void setUUID(java.lang.String uuid)
          Sets value for UUID
 void setUUID(java.util.UUID uuid)
          Sets value for UUID
 void shutdown()
          This method when called stops Pubnub threads
 void subscribe(java.util.Hashtable args)
          Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Methods accepting Hashtable as arguments have been deprecated.
 void subscribe(java.util.Hashtable args, Callback callback)
          Deprecated. as of version 3.5.2 and will be removed with 3.6.0 .
 void subscribe(java.lang.String[] channelsArr, Callback callback)
          Listen for a message on a channel.
 void subscribe(java.lang.String[] channelsArr, Callback callback, long timetoken)
          Listen for a message on a channel.
 void subscribe(java.lang.String[] channelsArr, Callback callback, java.lang.String timetoken)
          Listen for a message on a channel.
 void subscribe(java.lang.String channel, Callback callback)
          Listen for a message on a channel.
 void subscribe(java.lang.String channel, Callback callback, long timetoken)
          Listen for a message on a channel.
 void subscribe(java.lang.String channel, Callback callback, java.lang.String timetoken)
          Listen for a message on a channel.
 void time(Callback callback)
          Read current time from PubNub Cloud.
 void unsetAuthKey()
          This method unsets auth key.
 void unsubscribe(java.util.Hashtable args)
          Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Methods accepting Hashtable as arguments have been deprecated.
 void unsubscribe(java.lang.String channel)
          Unsubscribe/Disconnect from channel.
 void unsubscribe(java.lang.String[] channels)
          Unsubscribe from channels.
 void unsubscribeAll()
          Unsubscribe from all channel.
 void unsubscribePresence(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 -

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,
              java.lang.String initialization_vector)
Constructor for Pubnub Class

Parameters:
publish_key - Publish Key
subscribe_key - Subscribe Key
secret_key - Secret Key
cipher_key - Cipher Key
ssl_on - SSL enabled ?
initialization_vector - Initialization vector
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

getSubscribeTimeout

public int getSubscribeTimeout()
This method returns timeout value for subscribe/presence.

Returns:
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

getNonSubscribeTimeout

public int getNonSubscribeTimeout()
This method returns timeout value for non subscribe operations like publish, history, hereNow

Returns:
Timeout value in milliseconds for for Non subscribe operations like publish, history, hereNow

publish

@Deprecated
public void publish(java.util.Hashtable args,
                               Callback callback)
Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Methods accepting Hashtable as arguments have been deprecated.

Send a message to a channel.

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

publish

@Deprecated
public void publish(java.util.Hashtable args)
Deprecated. As of version 3.5.2 . Will be removed in 3.6.0 . Methods accepting Hashtable as arguments have been deprecated.

Send a message to a channel.

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

detailedHistory

@Deprecated
public void detailedHistory(java.lang.String channel,
                                       long start,
                                       long end,
                                       int count,
                                       boolean reverse,
                                       Callback callback)
Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Replaced by history(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

history

public void history(java.lang.String channel,
                    long start,
                    long end,
                    int count,
                    boolean reverse,
                    Callback callback)
Read History 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

@Deprecated
public void detailedHistory(java.lang.String channel,
                                       long start,
                                       boolean reverse,
                                       Callback callback)
Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Replaced by history(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

history

public void history(java.lang.String channel,
                    long start,
                    boolean reverse,
                    Callback callback)
Read history 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

@Deprecated
public void detailedHistory(java.lang.String channel,
                                       long start,
                                       long end,
                                       Callback callback)
Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Replaced by history(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

history

public void history(java.lang.String channel,
                    long start,
                    long end,
                    Callback callback)
Read History for a channel.

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

detailedHistory

@Deprecated
public void detailedHistory(java.lang.String channel,
                                       long start,
                                       long end,
                                       boolean reverse,
                                       Callback callback)
Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Replaced by history(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

history

public void history(java.lang.String channel,
                    long start,
                    long end,
                    boolean reverse,
                    Callback callback)
Read History 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

@Deprecated
public void detailedHistory(java.lang.String channel,
                                       int count,
                                       boolean reverse,
                                       Callback callback)
Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Replaced by history(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

history

public void history(java.lang.String channel,
                    int count,
                    boolean reverse,
                    Callback callback)
Read History 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

@Deprecated
public void detailedHistory(java.lang.String channel,
                                       boolean reverse,
                                       Callback callback)
Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Replaced by history(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

history

public void history(java.lang.String channel,
                    boolean reverse,
                    Callback callback)
Read History 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

@Deprecated
public void detailedHistory(java.lang.String channel,
                                       int count,
                                       Callback callback)
Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Replaced by history(String channel, int count, Callback callback)

Read DetailedHistory for a channel.

Parameters:
channel - Channel name for which detailed history is required
count - Maximum number of messages
callback - Callback object

history

public void history(java.lang.String channel,
                    int count,
                    Callback callback)
Read History for a channel.

Parameters:
channel - Channel name for which detailed history is required
count - Maximum number of messages
callback - Callback object

unsubscribe

@Deprecated
public void unsubscribe(java.util.Hashtable args)
Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Methods accepting Hashtable as arguments have been deprecated.

Unsubscribe/Disconnect from channel.

Parameters:
args - Hashtable containing channel name.

subscribe

@Deprecated
public void subscribe(java.util.Hashtable args,
                                 Callback callback)
               throws PubnubException
Deprecated. as of version 3.5.2 and will be removed with 3.6.0 .

Listen for a message on a channel.

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

subscribe

@Deprecated
public void subscribe(java.util.Hashtable args)
               throws PubnubException
Deprecated. as of version 3.5.2 and will be removed with 3.6.0 . Methods accepting Hashtable as arguments have been deprecated.

Listen for a message on a channel.

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

pamGrant

public void pamGrant(java.lang.String channel,
                     java.lang.String auth_key,
                     boolean read,
                     boolean write,
                     Callback callback)
Grant r/w access based on channel and auth key

Parameters:
channel -
auth_key -
read -
write -
callback -

pamGrant

public void pamGrant(java.lang.String channel,
                     java.lang.String auth_key,
                     boolean read,
                     boolean write,
                     int ttl,
                     Callback callback)
Grant r/w access based on channel and auth key

Parameters:
channel -
auth_key -
read -
write -
callback -

pamAudit

public void pamAudit(Callback callback)
ULS Audit

Parameters:
callback -

pamAudit

public void pamAudit(java.lang.String channel,
                     Callback callback)
ULS audit by channel

Parameters:
channel -
callback -

pamAudit

public void pamAudit(java.lang.String channel,
                     java.lang.String auth_key,
                     Callback callback)
ULS audit by channel and auth key

Parameters:
channel -
auth_key -
callback -

pamRevoke

public void pamRevoke(java.lang.String channel,
                      java.lang.String auth_key,
                      Callback callback)
ULS revoke by channel and auth key

Parameters:
channel -
auth_key -
callback -

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

getRetryInterval

public int getRetryInterval()
Returns current retry interval for subscribe

Returns:
Current 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

getMaxRetries

public int getMaxRetries()
Returns current max retries for Subscribe

Returns:
Current max retries

setCacheBusting

public void setCacheBusting(boolean cacheBusting)
Enable/Disable Cache Busting

Parameters:
cacheBusting -

getCacheBusting

public boolean getCacheBusting()
Get Cache Busting value

Returns:
current cache busting setting

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

getResumeOnReconnect

public boolean getResumeOnReconnect()
Returns Resume on Reconnect current setting

Returns:
Resume on Reconnect setting

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

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.util.Hashtable args)
Read history from a channel.

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

time

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

Parameters:
callback - Callback object

unsubscribe

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

Parameters:
channels - String array containing channel names

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.

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
timetoken - Timetoken to use for subscribing
Throws:
PubnubException - Throws PubnubException if Callback is null

subscribe

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

Parameters:
channelsArr - Array of channel names (string) to listen on
callback - Callback
timetoken - Timetoken to use for subscribing
Throws:
PubnubException - Throws PubnubException if Callback is null

subscribe

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

Parameters:
channel - Name of the channel
callback - Callback
Throws:
PubnubException - Throws PubnubException if Callback is null

subscribe

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

Parameters:
channel - Name of the channel
callback - Callback
Throws:
PubnubException - Throws PubnubException if Callback is null

subscribe

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

Parameters:
channel - Name of the channel
callback - Callback
timetoken - Timetoken to use for subscribing
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,
                                                  PubnubError error)
Disconnect from all channels, and resubscribe


disconnectAndResubscribe

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


disconnectAndResubscribe

public void disconnectAndResubscribe(PubnubError error)
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

getOrigin

public java.lang.String getOrigin()
Returns origin

Returns:
origin

setDomain

public void setDomain(java.lang.String domain)
Sets domain value, default is "pubnub.com"

Parameters:
domain - Domain value

getDomain

public java.lang.String getDomain()
Returns domain

Returns:
domain

getAuthKey

public java.lang.String getAuthKey()
This method returns 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.