Package ai.nexconn.chat.channel
Class OpenChannel
-
- All Implemented Interfaces:
public final class OpenChannel extends BaseChannel
Open channel.
A large-scale public channel similar to a chatroom, supporting a large number of concurrent participants. Users can create, enter, and leave open channels freely.
Inherits from BaseChannel and supports message querying and unread count management.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classOpenChannel.Companion
-
Field Summary
Fields Modifier and Type Field Description private IntegerparticipantCountprivate final StringchannelIdprivate final ChannelTypechannelTypeprivate final IntegerunreadCountprivate final BooleanisPinnedprivate final LongoperationTimeprivate final Stringdraftprivate final MessagelatestMessageprivate final IntegermentionedCountprivate final IntegermentionedMeCountprivate final ChannelNoDisturbLevelnoDisturbLevelprivate final TranslateStrategytranslateStrategyprivate final BooleanincludeRobotprivate final EditedMessageDrafteditedMessageDraftpublic final static OpenChannel.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description OpenChannel(String channelId)
-
Method Summary
Modifier and Type Method Description final IntegergetParticipantCount()Current participant count. final UnitsetParticipantCount(Integer participantCount)Current participant count. final UnitenterChannel(EnterOpenChannelParams params, ErrorHandler handler)Enters (joins) this open channel. final UnitexitChannel(String extra, ErrorHandler handler)Exits (leaves) this open channel. final UnitgetMetadata(String key, OperationHandler<Map<String, String>> handler)Gets metadata for this open channel by key. final UnitsetMetadata(OpenChannelSetMetadataParams params, ErrorHandler handler)Sets metadata for this open channel. final UnitdeleteMetadata(OpenChannelDeleteMetadataParams params, ErrorHandler handler)Batch deletes metadata for this open channel. -
Methods inherited from class ai.nexconn.chat.channel.BaseChannel
clearDraft, clearUnreadCount, delete, deleteLocalMessages, deleteMessageForAll, deleteMessagesForMe, deleteMessagesForMeByTimestamp, deleteTags, equals, getChannelId, getChannelType, getDraft, getEditedMessageDraft, getFirstUnreadMessage, getIncludeRobot, getLatestMessage, getMentionedCount, getMentionedMeCount, getMessageReadReceiptInfo, getMessageReadReceiptInfoByIdentifiers, getMessagesAroundTime, getMessagesReadReceiptByUsers, getNoDisturbLevel, getOperationTime, getTags, getTranslateStrategy, getUnreadCount, getUnreadMentionedMessages, hashCode, insertMessages, isPinned, modifyMessage, pin, reload, saveDraft, sendMediaMessage, sendMessage, sendReadReceiptResponse, setNoDisturbLevel, toString, unpin -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getParticipantCount
final Integer getParticipantCount()
Current participant count.
-
setParticipantCount
final Unit setParticipantCount(Integer participantCount)
Current participant count.
-
enterChannel
final Unit enterChannel(EnterOpenChannelParams params, ErrorHandler handler)
Enters (joins) this open channel.
After entering, the user can send and receive messages. Fails if the channel does not exist.
- Parameters:
params- Enter channel parameters including message count and extra infohandler- Error callback;nullerror indicates success
-
exitChannel
final Unit exitChannel(String extra, ErrorHandler handler)
Exits (leaves) this open channel.
After exiting, the user will no longer receive messages from this channel.
- Parameters:
extra- Additional information to send when exiting the channelhandler- Error callback;nullerror indicates success
-
getMetadata
final Unit getMetadata(String key, OperationHandler<Map<String, String>> handler)
Gets metadata for this open channel by key.
Note: The chatroom status storage feature must be enabled first.
- Parameters:
key- The metadata keyhandler- Callback returning the key-value pair on success
-
setMetadata
final Unit setMetadata(OpenChannelSetMetadataParams params, ErrorHandler handler)
Sets metadata for this open channel.
- Parameters:
params- Metadata parameters including entries, delete-when-left flag, and overwrite flaghandler- Error callback;nullerror indicates success
-
deleteMetadata
final Unit deleteMetadata(OpenChannelDeleteMetadataParams params, ErrorHandler handler)
Batch deletes metadata for this open channel.
- Parameters:
params- Delete parameters including the keys to removehandler- Error callback;nullerror indicates success
-
-
-
-