-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added customMessageType to Publish, Signal, Subscribe, History, File.
- Loading branch information
1 parent
628bb44
commit d93ca77
Showing
64 changed files
with
788 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ import com.pubnub.api.java.v2.PNConfiguration | |
import com.pubnub.api.java.v2.callbacks.EventEmitter | ||
import com.pubnub.api.java.v2.callbacks.StatusEmitter | ||
import com.pubnub.api.java.v2.endpoints.pubsub.PublishBuilder | ||
import com.pubnub.api.java.v2.endpoints.pubsub.SignalBuilder | ||
import com.pubnub.api.java.v2.entities.Channel | ||
import com.pubnub.api.java.v2.entities.ChannelGroup | ||
import com.pubnub.api.java.v2.entities.ChannelMetadata | ||
|
@@ -183,6 +184,10 @@ interface PubNub : EventEmitter, StatusEmitter { | |
* if more than 100 messages meet the timetoken values. | ||
* | ||
*/ | ||
@Deprecated( | ||
level = DeprecationLevel.WARNING, | ||
message = "Use fetchMessages() instead", | ||
) | ||
fun history(): History | ||
|
||
/** | ||
|
@@ -319,6 +324,11 @@ interface PubNub : EventEmitter, StatusEmitter { | |
* The message argument can contain any JSON serializable data, including: Objects, Arrays, Integers and Strings. | ||
* Data should not contain special Java/Kotlin classes or functions as these will not serialize. | ||
* String content can include any single-byte or multi-byte UTF-8 character. | ||
* | ||
* @param message The payload | ||
* @param channel The channel to publish message to. | ||
* | ||
* @return [PublishBuilder] | ||
*/ | ||
fun publish(message: Any, channel: String): PublishBuilder | ||
|
||
|
@@ -360,8 +370,13 @@ interface PubNub : EventEmitter, StatusEmitter { | |
* By default, signals are limited to a message payload size of 30 bytes. | ||
* This limit applies only to the payload, and not to the URI or headers. | ||
* If you require a larger payload size, please [contact support](mailto:[email protected]). | ||
* | ||
* @param message The payload | ||
* @param channel The channel to signal message to. | ||
* | ||
* @return [SignalBuilder] | ||
*/ | ||
fun signal(message: Any, channel: String): com.pubnub.api.endpoints.pubsub.Signal | ||
fun signal(message: Any, channel: String): SignalBuilder | ||
|
||
/** | ||
* Send a signal to all subscribers of a channel. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 15 additions & 2 deletions
17
.../pubnub-gson-api/src/main/java/com/pubnub/api/java/v2/endpoints/pubsub/SignalBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
package com.pubnub.api.java.v2.endpoints.pubsub; | ||
|
||
import com.pubnub.api.java.endpoints.pubsub.Signal; | ||
import com.pubnub.api.java.endpoints.Endpoint; | ||
import com.pubnub.api.models.consumer.PNPublishResult; | ||
|
||
public interface SignalBuilder extends Signal { | ||
/** | ||
* Interface representing a builder for configuring a signal operation. | ||
* This interface extends {@link Endpoint} to provide a fluent API for setting parameters | ||
* for the signal request. | ||
*/ | ||
public interface SignalBuilder extends Endpoint<PNPublishResult> { | ||
/** | ||
* Specifies a custom message type for the signal. | ||
* | ||
* @param customMessageType The custom message type as a string. | ||
* @return The current instance of {@code SignalBuilder} for method chaining. | ||
*/ | ||
SignalBuilder customMessageType(String customMessageType); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package com.pubnub.api.java.v2.entities | ||
|
||
import com.pubnub.api.endpoints.pubsub.Signal | ||
import com.pubnub.api.java.v2.endpoints.pubsub.PublishBuilder | ||
import com.pubnub.api.java.v2.endpoints.pubsub.SignalBuilder | ||
import com.pubnub.api.java.v2.subscriptions.Subscription | ||
import com.pubnub.api.v2.subscriptions.SubscriptionOptions | ||
|
||
|
@@ -90,6 +90,7 @@ interface Channel : Subscribable { | |
* - If `shouldStore = false`, the `ttl` parameter is ignored. | ||
* - If ttl isn't specified, then expiration of the message defaults | ||
* back to the expiry value for the key. | ||
* @param customMessageType The custom type associated with the message. | ||
*/ | ||
fun publish(message: Any): PublishBuilder | ||
|
||
|
@@ -101,8 +102,9 @@ interface Channel : Subscribable { | |
* If you require a larger payload size, please [contact support](mailto:[email protected]). | ||
* | ||
* @param message The payload which will be serialized and sent. | ||
* @param customMessageType The custom type associated with the message. | ||
*/ | ||
fun signal(message: Any): Signal | ||
fun signal(message: Any): SignalBuilder | ||
|
||
/** | ||
* Send a message to PubNub Functions Event Handlers. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.