|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pubnub.api.Pubnub
public class Pubnub
Pubnub object facilitates querying channels for messages and listening on channels for presence/message events
| Constructor Summary | |
|---|---|
Pubnub(java.lang.String publish_key,
java.lang.String subscribe_key)
Constructor for Pubnub Class |
|
Pubnub(java.lang.String publish_key,
java.lang.String subscribe_key,
java.lang.String secret_key)
Constructor for Pubnub Class |
|
Pubnub(java.lang.String publish_key,
java.lang.String subscribe_key,
java.lang.String secret_key,
boolean ssl_on)
Constructor for Pubnub Class |
|
Pubnub(java.lang.String publish_key,
java.lang.String subscribe_key,
java.lang.String secret_key,
java.lang.String cipher_key,
boolean ssl_on)
Constructor for Pubnub Class |
|
| Method Summary | |
|---|---|
org.json.JSONArray |
detailedHistory(java.lang.String channel,
boolean reverse)
Read DetailedHistory for a channel. |
org.json.JSONArray |
detailedHistory(java.lang.String channel,
boolean reverse,
int requestTimeout)
Read DetailedHistory for a channel. |
org.json.JSONArray |
detailedHistory(java.lang.String channel,
int count,
boolean reverse)
Read DetailedHistory for a channel. |
org.json.JSONArray |
detailedHistory(java.lang.String channel,
int count,
boolean reverse,
int requestTimeout)
Read DetailedHistory for a channel. |
org.json.JSONArray |
detailedHistory(java.lang.String channel,
long start,
boolean reverse)
Read DetailedHistory for a channel. |
org.json.JSONArray |
detailedHistory(java.lang.String channel,
long start,
boolean reverse,
int requestTimeout)
Read DetailedHistory for a channel. |
org.json.JSONArray |
detailedHistory(java.lang.String channel,
long start,
long end)
Read DetailedHistory for a channel. |
org.json.JSONArray |
detailedHistory(java.lang.String channel,
long start,
long end,
boolean reverse)
Read DetailedHistory for a channel. |
org.json.JSONArray |
detailedHistory(java.lang.String channel,
long start,
long end,
boolean reverse,
int requestTimeout)
Read DetailedHistory for a channel. |
org.json.JSONArray |
detailedHistory(java.lang.String channel,
long start,
long end,
int requestTime)
|
org.json.JSONArray |
detailedHistory(java.lang.String channel,
long start,
long end,
int count,
java.lang.Boolean reverse)
Read DetailedHistory for a channel. |
org.json.JSONArray |
detailedHistory(java.lang.String channel,
long start,
long end,
int count,
java.lang.Boolean reverse,
int requestTimeout)
Read DetailedHistory for a channel. |
int |
getConnectionTimeout()
Returns the timeout value for TCP connections made by api |
int |
getFastWebRequestTimeout()
Returns timeout value in milliseconds for api's publish, history, here_now, detailedHistory, uuid, time |
int |
getNetworkCheckRetriesCount()
Returns No of times attempt will be made to check network availability |
int |
getWebRequestCallbackInterval()
Returns Time interval in milliseconds for which the API's like Presence and Subscribe will block |
int |
getWebRequestRetryInterval()
Returns time interval in milliseconds between each attempt for network connectivity check |
org.json.JSONArray |
here_now(java.lang.String channel)
Read presence information from a channel |
org.json.JSONArray |
here_now(java.lang.String channel,
int requestTimeout)
Read presence information from a channel |
org.json.JSONArray |
history(java.lang.String channel,
int limit)
Read history from a channel. |
org.json.JSONArray |
history(java.lang.String channel,
int limit,
int requestTimeout)
Read history from a channel. |
void |
presence(java.lang.String channel,
Callback callback)
Listen for presence of subscribers on a channel |
org.json.JSONArray |
publish(java.lang.String channel,
org.json.JSONObject message)
Send a message to a channel. |
org.json.JSONArray |
publish(java.lang.String channel,
org.json.JSONObject message,
int requestTimeout)
Send a message to a channel. |
java.lang.String |
sessionUUID()
|
void |
setConnectionTimeout(int timeout)
Sets the timeout value for TCP connections made by API to Pubnub Servers |
void |
setFastWebRequestTimeout(int timeout)
Sets timeout values for publish, history, detailedHistory, time, here_now |
void |
setNetworkCheckRetriesCount(int count)
Sets number of retries to be made for network availability check |
void |
setWebRequestCallbackInterval(int interval)
Sets wait time for Presence/Subscribe API |
void |
setWebRequestRetryInterval(int interval)
Sets time interval between consecutive network availability checks |
void |
subscribe(java.lang.String channel,
Callback callback)
Listen for a message on a channel. |
double |
time()
Read current time from PubNub Cloud. |
void |
unsubscribe(java.util.HashMap<java.lang.String,java.lang.Object> args)
Unsubscribe/Disconnect from channel. |
static java.lang.String |
uuid()
Get 32 digit UUID generation at client side. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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)
publish_key - Publish Keysubscribe_key - Subscribe Keysecret_key - Secret Keycipher_key - Cipher Keyssl_on - SSL enabled ?
public Pubnub(java.lang.String publish_key,
java.lang.String subscribe_key,
java.lang.String secret_key,
boolean ssl_on)
publish_key - Publish Keysubscribe_key - Subscribe Keysecret_key - Secret Keyssl_on - SSL enabled ?
public Pubnub(java.lang.String publish_key,
java.lang.String subscribe_key)
publish_key - Publish Keysubscribe_key - Subscribe Key
public Pubnub(java.lang.String publish_key,
java.lang.String subscribe_key,
java.lang.String secret_key)
publish_key - Publish Keysubscribe_key - Subscribe Keysecret_key - Secret Key| Method Detail |
|---|
public void setWebRequestCallbackInterval(int interval)
interval - Time interval in milliseconds for which the API's like Presence and Subscribe will blockpublic void setNetworkCheckRetriesCount(int count)
count - No of times attempt will be made to check network availabilitypublic void setWebRequestRetryInterval(int interval)
interval - Time interval in milliseconds between each attempt for network connectivity checkpublic void setFastWebRequestTimeout(int timeout)
timeout - timeout value in milliseconds for api's publish, history, here_now, detailedHistory, timepublic void setConnectionTimeout(int timeout)
timeout - timeout value in milliseconds for tcp connection attempt.public int getWebRequestCallbackInterval()
public int getNetworkCheckRetriesCount()
public int getWebRequestRetryInterval()
public int getFastWebRequestTimeout()
public int getConnectionTimeout()
public java.lang.String sessionUUID()
public org.json.JSONArray publish(java.lang.String channel,
org.json.JSONObject message)
channel - Channel namemessage - JSONObject to be published
public org.json.JSONArray publish(java.lang.String channel,
org.json.JSONObject message,
int requestTimeout)
channel - Channel namemessage - JSONObject of message to be publishedrequestTimeout - timeout value in milliseconds for this request
public void subscribe(java.lang.String channel,
Callback callback)
throws PubnubException
channel - Channel name for subscribingcallback - Callback
PubnubException - Throws PubnubException if Callback is null
public void presence(java.lang.String channel,
Callback callback)
throws PubnubException
channel - Name of the channel on which to listen for join/leave i.e. presence eventscallback - Callback
PubnubException - Throws PubnubException if Callback is nullpublic org.json.JSONArray here_now(java.lang.String channel)
channel -
public org.json.JSONArray here_now(java.lang.String channel,
int requestTimeout)
channel - Channel namerequestTimeout - timeout in milliseconds for this request
public org.json.JSONArray history(java.lang.String channel,
int limit,
int requestTimeout)
channel - Channel Namelimit - Upper limit on number of messages in responserequestTimeout - timeout in milliseconds for this request
public org.json.JSONArray history(java.lang.String channel,
int limit)
channel - Channel Namelimit - Upper limit on number of messages in response.
public org.json.JSONArray detailedHistory(java.lang.String channel,
long start,
long end,
int count,
java.lang.Boolean reverse,
int requestTimeout)
channel - Channel name for which detailed history is requiredstart - Start timeend - End timecount - Upper limit on number of messages to be returnedreverse - True if messages need to be in reverse orderrequestTimeout - Timeout value in milliseconds for this request
public org.json.JSONArray detailedHistory(java.lang.String channel,
long start,
long end,
int count,
java.lang.Boolean reverse)
channel - Channel name for which detailed history is requiredstart - Start timeend - End timecount - Upper limit on number of messages to be returnedreverse - True if messages need to be in reverse order
public org.json.JSONArray detailedHistory(java.lang.String channel,
long start,
boolean reverse)
channel - Channel name for which detailed history is requiredstart - Start timereverse - True if messages need to be in reverse order
public org.json.JSONArray detailedHistory(java.lang.String channel,
long start,
boolean reverse,
int requestTimeout)
channel - Channel name for which detailed history is requiredstart - Start timereverse - True if messages need to be in reverse orderrequestTimeout - Timeout value in milliseconds for this request
public org.json.JSONArray detailedHistory(java.lang.String channel,
long start,
long end)
channel - Channel name for which detailed history is requiredstart - Start timeend - End time
public org.json.JSONArray detailedHistory(java.lang.String channel,
long start,
long end,
int requestTime)
public org.json.JSONArray detailedHistory(java.lang.String channel,
long start,
long end,
boolean reverse)
channel - Channel name for which detailed history is requiredstart - Start timeend - End timereverse - True if messages need to be in reverse order
public org.json.JSONArray detailedHistory(java.lang.String channel,
long start,
long end,
boolean reverse,
int requestTimeout)
channel - Channel name for which detailed history is requiredstart - Start timeend - End timereverse - True if messages need to be in reverse orderrequestTimeout - Timeout value in milliseconds for this request
public org.json.JSONArray detailedHistory(java.lang.String channel,
int count,
boolean reverse)
channel - Channel name for which detailed history is requiredcount - Upper limit on number of messages to be returnedreverse - True if messages need to be in reverse order
public org.json.JSONArray detailedHistory(java.lang.String channel,
int count,
boolean reverse,
int requestTimeout)
channel - Channel name for which detailed history is requiredcount - Upper limit on number of messages to be returnedreverse - True if messages need to be in reverse orderrequestTimeout - Timeout value in milliseconds for this request
public org.json.JSONArray detailedHistory(java.lang.String channel,
boolean reverse)
channel - Channel name for which detailed history is requiredreverse - True if messages need to be in reverse order
public org.json.JSONArray detailedHistory(java.lang.String channel,
boolean reverse,
int requestTimeout)
channel - Channel name for which detailed history is requiredreverse - True if messages need to be in reverse orderrequestTimeout - Timeout value in milliseconds for this request
public double time()
public static java.lang.String uuid()
public void unsubscribe(java.util.HashMap<java.lang.String,java.lang.Object> args)
args - HashMap of
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||