Package com.pubnub.api
Class PubNub
- java.lang.Object
 - 
- com.pubnub.api.PubNub
 
 
- 
public class PubNub extends java.lang.Object 
- 
- 
Constructor Summary
Constructors Constructor Description PubNub(@NotNull PNConfiguration initialConfig) 
- 
Method Summary
 
 - 
 
- 
- 
Constructor Detail
- 
PubNub
public PubNub(@NotNull @NotNull PNConfiguration initialConfig) 
 - 
 
- 
Method Detail
- 
getCryptoModule
public com.pubnub.api.crypto.CryptoModule getCryptoModule()
 
- 
generateUUID
@NotNull public static @NotNull java.lang.String generateUUID()
Deprecated. 
- 
getBaseUrl
@NotNull public @NotNull java.lang.String getBaseUrl()
 
- 
addListener
public void addListener(@NotNull @NotNull SubscribeCallback listener) 
- 
removeListener
public void removeListener(@NotNull @NotNull SubscribeCallback listener) 
- 
subscribe
@NotNull public @NotNull SubscribeBuilder subscribe()
 
- 
unsubscribe
@NotNull public @NotNull UnsubscribeBuilder unsubscribe()
 
- 
presence
@NotNull public @NotNull PresenceBuilder presence()
 
- 
addPushNotificationsOnChannels
@NotNull public @NotNull AddChannelsToPush addPushNotificationsOnChannels()
 
- 
removePushNotificationsFromChannels
@NotNull public @NotNull RemoveChannelsFromPush removePushNotificationsFromChannels()
 
- 
removeAllPushNotificationsFromDeviceWithPushToken
@NotNull public @NotNull RemoveAllPushChannelsForDevice removeAllPushNotificationsFromDeviceWithPushToken()
 
- 
auditPushChannelProvisions
@NotNull public @NotNull ListPushProvisions auditPushChannelProvisions()
 
- 
whereNow
@NotNull public @NotNull WhereNow whereNow()
 
- 
hereNow
@NotNull public @NotNull HereNow hereNow()
 
- 
time
@NotNull public @NotNull Time time()
 
- 
history
@NotNull public @NotNull History history()
 
- 
fetchMessages
@NotNull public @NotNull FetchMessages fetchMessages()
 
- 
deleteMessages
@NotNull public @NotNull DeleteMessages deleteMessages()
 
- 
messageCounts
@NotNull public @NotNull MessageCounts messageCounts()
 
- 
grant
@NotNull public @NotNull Grant grant()
 
- 
grantToken
@NotNull public @NotNull GrantTokenBuilder grantToken()
Deprecated.UsegrantToken(Integer)instead. 
- 
grantToken
@NotNull public @NotNull GrantTokenBuilder grantToken(java.lang.Integer ttl)
 
- 
revokeToken
@NotNull public @NotNull RevokeToken revokeToken()
 
- 
getPresenceState
@NotNull public @NotNull GetState getPresenceState()
 
- 
setPresenceState
@NotNull public @NotNull SetState setPresenceState()
 
- 
publish
@NotNull public @NotNull Publish publish()
 
- 
signal
@NotNull public @NotNull Signal signal()
 
- 
listAllChannelGroups
@NotNull public @NotNull ListAllChannelGroup listAllChannelGroups()
 
- 
listChannelsForChannelGroup
@NotNull public @NotNull AllChannelsChannelGroup listChannelsForChannelGroup()
 
- 
addChannelsToChannelGroup
@NotNull public @NotNull AddChannelChannelGroup addChannelsToChannelGroup()
 
- 
removeChannelsFromChannelGroup
@NotNull public @NotNull RemoveChannelChannelGroup removeChannelsFromChannelGroup()
 
- 
deleteChannelGroup
@NotNull public @NotNull DeleteChannelGroup deleteChannelGroup()
 
- 
setUUIDMetadata
public SetUUIDMetadata setUUIDMetadata()
 
- 
getAllUUIDMetadata
@NotNull public @NotNull GetAllUUIDMetadata getAllUUIDMetadata()
 
- 
getUUIDMetadata
@NotNull public @NotNull GetUUIDMetadata getUUIDMetadata()
 
- 
removeUUIDMetadata
@NotNull public @NotNull RemoveUUIDMetadata removeUUIDMetadata()
 
- 
setChannelMetadata
public SetChannelMetadata.Builder setChannelMetadata()
 
- 
getAllChannelsMetadata
@NotNull public @NotNull GetAllChannelsMetadata getAllChannelsMetadata()
 
- 
getChannelMetadata
@NotNull public GetChannelMetadata.Builder getChannelMetadata()
 
- 
removeChannelMetadata
public RemoveChannelMetadata.Builder removeChannelMetadata()
 
- 
getMemberships
@NotNull public @NotNull GetMemberships getMemberships()
 
- 
setMemberships
@NotNull public SetMemberships.Builder setMemberships()
 
- 
removeMemberships
@NotNull public RemoveMemberships.Builder removeMemberships()
 
- 
manageMemberships
@NotNull public ManageMemberships.Builder manageMemberships()
 
- 
getChannelMembers
@NotNull public GetChannelMembers.Builder getChannelMembers()
 
- 
setChannelMembers
@NotNull public SetChannelMembers.Builder setChannelMembers()
 
- 
removeChannelMembers
@NotNull public RemoveChannelMembers.Builder removeChannelMembers()
 
- 
manageChannelMembers
@NotNull public ManageChannelMembers.Builder manageChannelMembers()
 
- 
addMessageAction
@NotNull public @NotNull AddMessageAction addMessageAction()
 
- 
getMessageActions
@NotNull public @NotNull GetMessageActions getMessageActions()
 
- 
removeMessageAction
@NotNull public @NotNull RemoveMessageAction removeMessageAction()
 
- 
sendFile
@NotNull public SendFile.Builder sendFile()
 
- 
listFiles
public ListFiles.Builder listFiles()
 
- 
getFileUrl
public GetFileUrl.Builder getFileUrl()
 
- 
downloadFile
public DownloadFile.Builder downloadFile()
 
- 
deleteFile
public DeleteFile.Builder deleteFile()
 
- 
publishFileMessage
public PublishFileMessage.Builder publishFileMessage()
 
- 
decrypt
@Nullable public @Nullable java.lang.String decrypt(java.lang.String inputString) throws PubNubExceptionPerform Cryptographic decryption of an input string using cipher key provided by PNConfiguration- Parameters:
 inputString- String to be encrypted- Returns:
 - String containing the encryption of inputString using cipherKey
 - Throws:
 PubNubException
 
- 
decrypt
@Nullable public @Nullable java.lang.String decrypt(java.lang.String inputString, java.lang.String cipherKey) throws PubNubExceptionPerform Cryptographic decryption of an input string using the cipher key- Parameters:
 inputString- String to be encryptedcipherKey- cipher key to be used for encryption- Returns:
 - String containing the encryption of inputString using cipherKey
 - Throws:
 PubNubException- throws exception in case of failed encryption
 
- 
decryptInputStream
public java.io.InputStream decryptInputStream(java.io.InputStream inputStream) throws PubNubException- Throws:
 PubNubException
 
- 
decryptInputStream
public java.io.InputStream decryptInputStream(java.io.InputStream inputStream, java.lang.String cipherKey) throws PubNubException- Throws:
 PubNubException
 
- 
encrypt
@Nullable public @Nullable java.lang.String encrypt(java.lang.String inputString) throws PubNubExceptionPerform Cryptographic encryption of an input string and the cipher key provided by PNConfiguration- Parameters:
 inputString- String to be encrypted- Returns:
 - String containing the encryption of inputString using cipherKey
 - Throws:
 PubNubException
 
- 
encrypt
@Nullable public @Nullable java.lang.String encrypt(java.lang.String inputString, java.lang.String cipherKey) throws PubNubExceptionPerform Cryptographic encryption of an input string and the cipher key.- Parameters:
 inputString- String to be encryptedcipherKey- cipher key to be used for encryption- Returns:
 - String containing the encryption of inputString using cipherKey
 - Throws:
 PubNubException- throws exception in case of failed encryption
 
- 
encryptInputStream
public java.io.InputStream encryptInputStream(java.io.InputStream inputStream) throws PubNubException- Throws:
 PubNubException
 
- 
encryptInputStream
public java.io.InputStream encryptInputStream(java.io.InputStream inputStream, java.lang.String cipherKey) throws PubNubException- Throws:
 PubNubException
 
- 
getTimestamp
public int getTimestamp()
 
- 
getInstanceId
@NotNull public @NotNull java.lang.String getInstanceId()
- Returns:
 - instance uuid.
 
 
- 
getRequestId
@NotNull public @NotNull java.lang.String getRequestId()
- Returns:
 - request uuid.
 
 
- 
getVersion
@NotNull public @NotNull java.lang.String getVersion()
- Returns:
 - version of the SDK.
 
 
- 
stop
@Deprecated public void stop()
Deprecated.Stop the SDK and terminate all listeners. 
- 
destroy
public void destroy()
Destroy the SDK to cancel all ongoing requests and stop heartbeat timer. 
- 
forceDestroy
public void forceDestroy()
Force destroy the SDK to evict the connection pools and close executors. 
- 
reconnect
public void reconnect()
Perform a Reconnect to the network 
- 
disconnect
public void disconnect()
Perform a disconnect from the listeners 
- 
fire
@NotNull public @NotNull Publish fire()
 
- 
getSubscribedChannels
@NotNull public @NotNull java.util.List<java.lang.String> getSubscribedChannels()
 
- 
getSubscribedChannelGroups
@NotNull public @NotNull java.util.List<java.lang.String> getSubscribedChannelGroups()
 
- 
unsubscribeAll
public void unsubscribeAll()
 
- 
parseToken
public PNToken parseToken(java.lang.String token) throws PubNubException
- Throws:
 PubNubException
 
- 
setToken
public void setToken(java.lang.String token)
 
- 
getConfiguration
@NotNull public @NotNull PNConfiguration getConfiguration()
 
- 
getMapper
@NotNull public @NotNull MapperManager getMapper()
 
 - 
 
 -