ChannelMetadata Entity

As of version 9.0.0, the Java software development kit (SDK) supports entities. Entities are SDK objects that bundle operations for a specific resource type and simplify working with PubNub application programming interfaces (APIs).

Use entities to perform common tasks without manually wiring requests. Some PubNub APIs are exposed via entities. Other operations remain available on the pubnub object.

Create ChannelMetadata

Use this factory method to return a local ChannelMetadata entity for a single channel metadata object. A ChannelMetadata entity centralizes operations related to App Context channel metadata.

pubnub.channelMetadata(String id)
* required
ParameterDescription
id *
Type: String
Identifier of the channel metadata for which to create the entity.

Sample code

Reference code
This example is a self-contained code snippet ready to be run. It includes necessary imports and executes methods with console logging. Use it as a reference when working with other examples in this document.

Available operations

The ChannelMetadata entity provides operations for PubNub App Context channel metadata.

Operation (click for more information)Description
subscription(subscriptionOptions)
Returns a local channel metadata subscription object with optional parameters. You can then subscribe to receive real-time updates for that channel metadata.
Last updated on