diff --git a/jni-wrappers/privmx-endpoint/src/cpp/parsers/model_native_initializers.cpp b/jni-wrappers/privmx-endpoint/src/cpp/parsers/model_native_initializers.cpp index eaa9b0d7..092113ee 100644 --- a/jni-wrappers/privmx-endpoint/src/cpp/parsers/model_native_initializers.cpp +++ b/jni-wrappers/privmx-endpoint/src/cpp/parsers/model_native_initializers.cpp @@ -1769,13 +1769,11 @@ namespace privmx { "Ljava/util/List;" // tracks "Ljava/lang/String;" // metadata "Ljava/lang/Boolean;" // dummy - "Ljava/lang/Boolean;" // talking ")V" ); jobject metadata = nullptr; jobject dummy = nullptr; - jobject talking = nullptr; if (streamInfo_c.metadata.has_value()) { metadata = ctx->NewStringUTF(streamInfo_c.metadata.value().c_str()); @@ -1785,20 +1783,7 @@ namespace privmx { dummy = ctx.bool2jBoolean(streamInfo_c.dummy.value()); } - if (streamInfo_c.talking.has_value()) { - talking = ctx.bool2jBoolean(streamInfo_c.talking.value()); - } - - jobject tracks = ctx->NewObject(arrayCls, initArrayMID); - for (auto &track: streamInfo_c.tracks) { - ctx->CallBooleanMethod( - tracks, - addToArrayMID, - streamTrackInfo2Java(ctx, track) - ); - } - - // todo - check null? + jobject tracks = vectorTojArray(ctx, streamInfo_c.tracks, streamTrackInfo2Java); return ctx->NewObject( itemCls, @@ -1807,10 +1792,8 @@ namespace privmx { ctx->NewStringUTF(streamInfo_c.userId.c_str()), tracks, metadata, - dummy, - talking + dummy ); - } jobject publishedStreamData2Java(JniContextUtils &ctx, privmx::endpoint::stream::PublishedStreamData publishedStreamData_c) { diff --git a/jni-wrappers/privmx-endpoint/src/cpp/parsers/parser.cpp b/jni-wrappers/privmx-endpoint/src/cpp/parsers/parser.cpp index 782cd917..ed5ec795 100644 --- a/jni-wrappers/privmx-endpoint/src/cpp/parsers/parser.cpp +++ b/jni-wrappers/privmx-endpoint/src/cpp/parsers/parser.cpp @@ -838,11 +838,6 @@ privmx::endpoint::stream::StreamHandle parseStreamHandle( return jobject2long(ctx, ctx->GetObjectField(streamHandle, valueFID)); } -privmx::endpoint::stream::Settings parseSettings(JniContextUtils &ctx, jobject settings) { - auto result = privmx::endpoint::stream::Settings(); - return result; -} - privmx::endpoint::stream::StreamSubscription parseStreamSubscription(JniContextUtils &ctx, jobject streamSubscription) { privmx::endpoint::stream::StreamSubscription result; jclass cls = ctx->GetObjectClass(streamSubscription); diff --git a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/AudioTrackInfo.java b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/AudioTrackInfo.java deleted file mode 100644 index 52ea94ba..00000000 --- a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/AudioTrackInfo.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.simplito.java.privmx_endpoint.model; - - -import org.webrtc.AudioTrack; -import org.webrtc.PmxFrameCryptor; -import org.webrtc.RtpSender; - -public class AudioTrackInfo { - public AudioTrack track; - public RtpSender sender; - public PmxFrameCryptor frameCryptor; - - public AudioTrackInfo( - AudioTrack track, - RtpSender sender, - PmxFrameCryptor frameCryptor - ) { - this.track = track; - this.sender = sender; - this.frameCryptor = frameCryptor; - } -} \ No newline at end of file diff --git a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/ConnectionType.java b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/ConnectionType.java deleted file mode 100644 index 0b8d605a..00000000 --- a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/ConnectionType.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.simplito.java.privmx_endpoint.model; - -public enum ConnectionType { - Subscriber, - Publisher -} diff --git a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/DeviceType.java b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/DeviceType.java deleted file mode 100644 index d69fa62d..00000000 --- a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/DeviceType.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.simplito.java.privmx_endpoint.model; - -public enum DeviceType { - Audio, - Video, - Desktop -} \ No newline at end of file diff --git a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/Frame.java b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/Frame.java deleted file mode 100644 index e1b0733b..00000000 --- a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/Frame.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.simplito.java.privmx_endpoint.model; - -public abstract class Frame { - public Frame() {} - public int ConvertToRGBA(byte dst_argb, int dst_stride_argb, int dest_width, int dest_height){ - return 0; - }; -} \ No newline at end of file diff --git a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/MediaDevice.java b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/MediaDevice.java deleted file mode 100644 index 958b7f93..00000000 --- a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/MediaDevice.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.simplito.java.privmx_endpoint.model; - -public class MediaDevice { - public String name; - public String id; - public DeviceType type; - - public MediaDevice(String name, String id, DeviceType type) { - this.name = name; - this.id = id; - this.type = type; - } -} \ No newline at end of file diff --git a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/Stream.java b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/Stream.java deleted file mode 100644 index 5278665b..00000000 --- a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/Stream.java +++ /dev/null @@ -1,24 +0,0 @@ -// -// PrivMX Endpoint Java. -// Copyright © 2024 Simplito sp. z o.o. -// -// This file is part of the PrivMX Platform (https://privmx.dev). -// This software is Licensed under the MIT License. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package com.simplito.java.privmx_endpoint.model; - -public class Stream { - public Long streamId; - public String userId; - public Stream( - Long streamId, - String userId - ) { - this.streamId = streamId; - this.userId = userId; - } -} diff --git a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/StreamSettings.java b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/StreamSettings.java deleted file mode 100644 index 68bc52a6..00000000 --- a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/StreamSettings.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.simplito.java.privmx_endpoint.model; - -import com.simplito.java.privmx_endpoint.model.stream.Settings; - -public class StreamSettings { - public Settings settings; - public boolean dropCorruptedFrames = true; - - public StreamSettings(Settings settings, boolean dropCorruptedFrames) { - this.settings = settings; - this.dropCorruptedFrames = dropCorruptedFrames; - } - - public StreamSettings(Settings settings) { - this(settings, true); - } -} \ No newline at end of file diff --git a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/StreamStatus.java b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/StreamStatus.java deleted file mode 100644 index 54ff19de..00000000 --- a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/StreamStatus.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.simplito.java.privmx_endpoint.model; - -public enum StreamStatus { - Offline, - Online -} diff --git a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/VideoTrackInfo.java b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/VideoTrackInfo.java deleted file mode 100644 index 44d397ad..00000000 --- a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/model/VideoTrackInfo.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.simplito.java.privmx_endpoint.model; - -import org.webrtc.PmxFrameCryptor; -import org.webrtc.RtpSender; -import org.webrtc.VideoTrack; - -public class VideoTrackInfo { - public VideoTrack track; - public RtpSender sender; - public PmxFrameCryptor frameCryptor; - - public VideoTrackInfo( - VideoTrack track, - RtpSender sender, - PmxFrameCryptor frameCryptor - ) { - this.track = track; - this.sender = sender; - this.frameCryptor = frameCryptor; - } -} diff --git a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/JanusConnection.java b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/JanusConnection.java index 697ebe7e..b3e03d6f 100644 --- a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/JanusConnection.java +++ b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/JanusConnection.java @@ -1,7 +1,5 @@ package com.simplito.java.privmx_endpoint.modules.stream; -import com.simplito.java.privmx_endpoint.model.ConnectionType; - import org.json.JSONObject; import org.webrtc.PeerConnection; import org.webrtc.PeerConnectionFactory; @@ -19,20 +17,17 @@ public class JanusConnection { protected final PeerConnection peerConnection; protected final PeerConnectionFactory peerConnectionFactory; protected PmxKeyStore keyStore; - public final ConnectionType connectionType; private long sessionId = -1L; private final PcObserver pcObserver; public JanusConnection( PeerConnectionFactory pcFactory, PmxKeyStore keyStore, - ConnectionType connectionType, TrackObserver trackObserver, BiConsumer onTrickle, Consumer onConnectionChange ) { this.peerConnectionFactory = pcFactory; - this.connectionType = connectionType; this.keyStore = keyStore; this.pcObserver = new PcObserver( peerConnectionFactory, diff --git a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/JanusPublisher.java b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/JanusPublisher.java index 2b8a353b..bb0f74c2 100644 --- a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/JanusPublisher.java +++ b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/JanusPublisher.java @@ -1,12 +1,8 @@ package com.simplito.java.privmx_endpoint.modules.stream; -import androidx.annotation.Nullable; - -import com.simplito.java.privmx_endpoint.model.AudioTrackInfo; -import com.simplito.java.privmx_endpoint.model.ConnectionType; import com.simplito.java.privmx_endpoint.model.stream.SdpWithTypeModel; -import com.simplito.java.privmx_endpoint.model.VideoTrackInfo; +import org.webrtc.AudioTrack; import org.webrtc.MediaConstraints; import org.webrtc.PeerConnection; import org.webrtc.PeerConnectionFactory; @@ -15,7 +11,7 @@ import org.webrtc.PmxKeyStore; import org.webrtc.RtpSender; import org.webrtc.SessionDescription; -import org.webrtc.VideoCapturer; +import org.webrtc.VideoTrack; import java.util.HashMap; import java.util.Map; @@ -39,7 +35,7 @@ public JanusPublisher( BiConsumer acceptRenegotiationOffer, Consumer onConnectionChange ) { - super(pcFactory, keyStore, ConnectionType.Publisher, observer, onTrickle, onConnectionChange); + super(pcFactory, keyStore, observer, onTrickle, onConnectionChange); this.setNewOfferOnReconfigure = acceptRenegotiationOffer; } @@ -162,4 +158,37 @@ public void onRenegotiationNeeded() { }); } } + + static class AudioTrackInfo { + public AudioTrack track; + public RtpSender sender; + public PmxFrameCryptor frameCryptor; + + public AudioTrackInfo( + AudioTrack track, + RtpSender sender, + PmxFrameCryptor frameCryptor + ) { + this.track = track; + this.sender = sender; + this.frameCryptor = frameCryptor; + } + } + + static class VideoTrackInfo { + public VideoTrack track; + public RtpSender sender; + public PmxFrameCryptor frameCryptor; + + public VideoTrackInfo( + VideoTrack track, + RtpSender sender, + PmxFrameCryptor frameCryptor + ) { + this.track = track; + this.sender = sender; + this.frameCryptor = frameCryptor; + } + } + } diff --git a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/JanusSubscriber.java b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/JanusSubscriber.java index 1a02683b..1535ed87 100644 --- a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/JanusSubscriber.java +++ b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/JanusSubscriber.java @@ -1,6 +1,5 @@ package com.simplito.java.privmx_endpoint.modules.stream; -import com.simplito.java.privmx_endpoint.model.ConnectionType; import org.webrtc.MediaConstraints; import org.webrtc.PeerConnection; @@ -19,7 +18,7 @@ public JanusSubscriber( TrackObserver observer, BiConsumer onTrickle ) { - super(pcFactory, keyStore, ConnectionType.Subscriber, observer, onTrickle,null); + super(pcFactory, keyStore, observer, onTrickle,null); } public String createAnswer(String offerSdp, String type) { diff --git a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/StreamApi.java b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/StreamApi.java index 5ffb6f18..3c94c174 100644 --- a/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/StreamApi.java +++ b/privmx-endpoint-streams/android/src/main/java/com/simplito/java/privmx_endpoint/modules/stream/StreamApi.java @@ -5,7 +5,6 @@ import androidx.annotation.NonNull; -import com.simplito.java.privmx_endpoint.model.ConnectionType; import com.simplito.java.privmx_endpoint.model.ContainerPolicy; import com.simplito.java.privmx_endpoint.model.PagingList; import com.simplito.java.privmx_endpoint.model.UserWithPubKey; diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/PublishedStreamData.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/PublishedStreamData.java deleted file mode 100644 index 4df54f01..00000000 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/PublishedStreamData.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.simplito.java.privmx_endpoint.model.stream; - -public class PublishedStreamData { - public String streamRoomId; - public StreamInfo stream; - public String userId; - - public PublishedStreamData(String streamRoomId, StreamInfo stream, String userId) { - this.streamRoomId = streamRoomId; - this.stream = stream; - this.userId = userId; - } -} diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/Settings.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/Settings.java deleted file mode 100644 index 225fdd24..00000000 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/Settings.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.simplito.java.privmx_endpoint.model.stream; - -public class Settings { - public Settings() { - } -} \ No newline at end of file diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamHandle.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamHandle.java index 8a4e7b51..b2e5c096 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamHandle.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamHandle.java @@ -1,12 +1,26 @@ package com.simplito.java.privmx_endpoint.model.stream; +/** + * Unique handle to a stream, used to perform operations on the stream. + */ public class StreamHandle { + /** + * The value of the {@link StreamHandle}. + */ private final Long value; + /** + * Constructs a new {@link StreamHandle} instance. + * + * @param value The value of the {@link StreamHandle}. + */ public StreamHandle(Long value) { this.value = value; } + /** + * Gets the value of the {@link StreamHandle}. + */ public Long getValue() { return value; } diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamInfo.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamInfo.java index 61afba04..88d5a534 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamInfo.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamInfo.java @@ -13,33 +13,69 @@ import java.util.List; +/** + * Contains detailed information about a stream and its associated tracks. + */ public class StreamInfo { + /** + * Unique identifier of the stream + */ public Long id; + + /** + * Identifier of the user who published the stream + */ public String userId; + + /** + * Information about the tracks within the stream + */ public List tracks; + + /** + * Additional metadata attached to the stream as a JSON string + */ public String metadata; // optional - public Boolean dummy; // optional - public Boolean talking; // optional + public Boolean dummy; // optional + /** + * Constructs a new {@link StreamInfo} instance. + * + * @param id Unique identifier of the stream + * @param userId Identifier of the user who published the stream + * @param tracks Information about the tracks within the stream + */ public StreamInfo(Long id, String userId, List tracks) { - this(id, userId, tracks, null, null, null); + this(id, userId, tracks, null, null); } + /** + * Constructs a new {@link StreamInfo} instance. + * + * @param id Unique identifier of the stream + * @param userId Identifier of the user who published the stream + * @param tracks Information about the tracks within the stream + * @param metadata Additional metadata attached to the stream as a JSON string + */ public StreamInfo(Long id, String userId, List tracks, String metadata) { - this(id, userId, tracks, metadata, null, null); + this(id, userId, tracks, metadata, null); } + /** + * Constructs a new {@link StreamInfo} instance. + * + * @param id Unique identifier of the stream + * @param userId Identifier of the user who published the stream + * @param tracks Information about the tracks within the stream + * @param metadata Additional metadata attached to the stream as a JSON string + * @param dummy + */ public StreamInfo(Long id, String userId, List tracks, String metadata, Boolean dummy) { - this(id, userId, tracks, metadata, dummy, null); - } - - public StreamInfo(Long id, String userId, List tracks, String metadata, Boolean dummy, Boolean talking) { this.id = id; this.userId = userId; this.tracks = tracks; this.metadata = metadata; this.dummy = dummy; - this.talking = talking; } } diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamPublishResult.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamPublishResult.java index cf3022a9..3a2863b9 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamPublishResult.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamPublishResult.java @@ -1,12 +1,36 @@ package com.simplito.java.privmx_endpoint.model.stream; +import com.simplito.java.privmx_endpoint.model.stream.events.PublishedStreamData; + +/** + * Represents the result of a stream publish/update operation. + */ public class StreamPublishResult { -public Boolean published; -public PublishedStreamData data; + /** + * Indicates if the stream was successfully published + */ + public Boolean published; + + /** + * Additional information about the published stream + */ + public PublishedStreamData data; + /** + * Constructs a new {@link StreamPublishResult} instance. + * + * @param published Indicates if the stream was successfully published + */ public StreamPublishResult(Boolean published) { this(published, null); } + + /** + * Constructs a new {@link StreamPublishResult} instance. + * + * @param published Indicates if the stream was successfully published + * @param data Additional information about the published stream + */ public StreamPublishResult(Boolean published, PublishedStreamData data) { this.published = published; this.data = data; diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamRoom.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamRoom.java index 9c0b8da3..376276b3 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamRoom.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamRoom.java @@ -15,23 +15,103 @@ import java.util.List; +/** + * Represents a stream room within a PrivMX context + */ public class StreamRoom { + /** + * Identifier of the context this stream room belongs to + */ public String contextId; + + /** + * Identifier of the stream room + */ public String streamRoomId; + + /** + * Timestamp of when the stream room was created + */ public Long createDate; + + /** + * Identifier of the user who created the stream room + */ public String creator; + + /** + * Timestamp of when the stream room was last modified + */ public Long lastModificationDate; + + /** + * Identifier of the user who last modified the stream room + */ public String lastModifier; + /** + * List of user's IDs with access to the stream room + */ public List users; + /** + * List of usernames with management privileges over the stream room + */ public List managers; + + /** + * Version number (changes on updates). + */ public Long version; + + /** + * StreamRoom's public metadata + */ public byte[] publicMeta; + + /** + * StreamRoom's private metadata + */ + public byte[] privateMeta; + + /** + * StreamRoom's policies + */ public ContainerPolicy policy; + + /** + * Status code of retrieval and decryption of the {@code StreamRoom} + */ public Long statusCode; + + /** + * Version of the StreamRoom data structure and how it is encoded/encrypted + */ public Long schemaVersion; + + /** + * Indicates if the stream room is closed + */ public Boolean closed; + /** + * Constructs a new {@link StreamRoom} instance. + * + * @param contextId Identifier of the context this stream room belongs to + * @param streamRoomId Identifier of the stream room + * @param createDate Timestamp of when the stream room was created + * @param creator Identifier of the user who created the stream room + * @param lastModificationDate Timestamp of when the stream room was last modified + * @param lastModifier Identifier of the user who last modified the stream room + * @param users List of user's IDs with access to the stream room + * @param managers List of usernames with management privileges over the stream room + * @param version Version number (changes on updates) + * @param publicMeta StreamRoom's public metadata + * @param privateMeta StreamRoom's private metadata + * @param policy StreamRoom's policies + * @param statusCode Status code of retrieval and decryption of the {@code StreamRoom} + * @param schemaVersion Version of the StreamRoom data structure and how it is encoded/encrypted + * @param closed Indicates if the stream room is closed + */ public StreamRoom( String contextId, String streamRoomId, diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamSubscription.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamSubscription.java index 54a471b1..d9168bab 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamSubscription.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamSubscription.java @@ -1,14 +1,37 @@ package com.simplito.java.privmx_endpoint.model.stream; +/** + * Describes a remote stream or a specific track within that stream, + * used when subscribing to, modifying, or unsubscribing from remote streams. + */ public class StreamSubscription { + /** + * Unique identifier of the stream + */ public Long streamId; + + /** + * Identifier of a specific track within the stream. + * If not provided, the entire stream is targeted. + */ public String streamTrackId; + /** + * Constructs a new {@link StreamSubscription} instance. + * + * @param streamId Unique identifier of the stream + * @param streamTrackId Identifier of a specific track within the stream + */ public StreamSubscription(long streamId, String streamTrackId) { this.streamId = streamId; this.streamTrackId = streamTrackId; } + /** + * Constructs a new {@link StreamSubscription} instance. + * + * @param streamId Unique identifier of the stream + */ public StreamSubscription(long streamId) { this.streamId = streamId; } diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamTrackInfo.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamTrackInfo.java index 98ebe871..d53af6f2 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamTrackInfo.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamTrackInfo.java @@ -1,34 +1,82 @@ package com.simplito.java.privmx_endpoint.model.stream; +/** + * Represents metadata about a single media track within a stream. + */ public class StreamTrackInfo { + /** + * Type of the track (e.g. "audio", "video", "data") + */ public String type; + public Long mindex; + public String mid; + /** + * Indicates if the track is disabled. + * Tracks are never truly removed from the stream - they are marked as disabled instead. + */ public Boolean disabled; // optional + + /** + * Codec used by the track (e.g. "opus", "VP8") + */ public String codec; // optional + + /** + * Description of the track + */ public String description; // optional + public Boolean moderated; // optional + + /** + * Indicates if simulcast is enabled for the track + */ public Boolean simulcast; // optional - public Boolean talking; // optional + /** + * Constructs a new {@link StreamTrackInfo} instance. + * + * @param type Type of the track (e.g. "audio", "video", "data") + * @param mindex + * @param mid + */ public StreamTrackInfo( String type, Long mindex, String mid ) { - this(type, mindex, mid, null, null, null, null, null, null); + this(type, mindex, mid, null, null, null, null, null); } + /** + * Constructs a new {@link StreamTrackInfo} instance. + * + * @param type Type of the track (e.g. "audio", "video", "data") + * @param mindex + * @param mid + * @param disabled Indicates if the track is disabled + */ public StreamTrackInfo( String type, Long mindex, String mid, Boolean disabled ) { - this(type, mindex, mid, disabled, null, null, null, null, null); + this(type, mindex, mid, disabled, null, null, null, null); } + /** + * Constructs a new {@link StreamTrackInfo} instance. + * + * @param type Type of the track (e.g. "audio", "video", "data") + * @param mindex + * @param mid + * @param disabled Indicates if the track is disabled + * @param codec Codec used by the track (e.g. "opus", "VP8") + */ public StreamTrackInfo( String type, Long mindex, @@ -36,9 +84,19 @@ public StreamTrackInfo( Boolean disabled, String codec ) { - this(type, mindex, mid, disabled, codec, null, null, null, null); + this(type, mindex, mid, disabled, codec, null, null, null); } + /** + * Constructs a new {@link StreamTrackInfo} instance. + * + * @param type Type of the track (e.g. "audio", "video", "data") + * @param mindex + * @param mid + * @param disabled Indicates if the track is disabled + * @param codec Codec used by the track (e.g. "opus", "VP8") + * @param description Description of the track + */ public StreamTrackInfo( String type, Long mindex, @@ -47,9 +105,20 @@ public StreamTrackInfo( String codec, String description ) { - this(type, mindex, mid, disabled, codec, description, null, null, null); + this(type, mindex, mid, disabled, codec, description, null, null); } + /** + * Constructs a new {@link StreamTrackInfo} instance. + * + * @param type Type of the track (e.g. "audio", "video", "data") + * @param mindex + * @param mid + * @param disabled Indicates if the track is disabled + * @param codec Codec used by the track (e.g. "opus", "VP8") + * @param description Description of the track + * @param moderated + */ public StreamTrackInfo( String type, Long mindex, @@ -59,9 +128,21 @@ public StreamTrackInfo( String description, Boolean moderated ) { - this(type, mindex, mid, disabled, codec, description, moderated, null, null); + this(type, mindex, mid, disabled, codec, description, moderated, null); } + /** + * Constructs a new {@link StreamTrackInfo} instance. + * + * @param type Type of the track (e.g. "audio", "video", "data") + * @param mindex + * @param mid + * @param disabled Indicates if the track is disabled + * @param codec Codec used by the track (e.g. "opus", "VP8") + * @param description Description of the track + * @param moderated + * @param simulcast Indicates if simulcast is enabled for the track + */ public StreamTrackInfo( String type, Long mindex, @@ -71,20 +152,6 @@ public StreamTrackInfo( String description, Boolean moderated, Boolean simulcast - ) { - this(type, mindex, mid, disabled, codec, description, moderated, simulcast, null); - } - - public StreamTrackInfo( - String type, - Long mindex, - String mid, - Boolean disabled, - String codec, - String description, - Boolean moderated, - Boolean simulcast, - Boolean talking ) { this.type = type; this.mindex = mindex; @@ -94,6 +161,5 @@ public StreamTrackInfo( this.description = description; this.moderated = moderated; this.simulcast = simulcast; - this.talking = talking; } } diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamTrackModification.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamTrackModification.java index 2b368dce..9ce5f235 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamTrackModification.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamTrackModification.java @@ -2,10 +2,26 @@ import java.util.List; +/** + * Represents a set of track modifications applied to a specific stream. + */ public class StreamTrackModification { + /** + * Identifier of the stream for which tracks were modified + */ public Long streamId; + + /** + * List of track modifications, each containing the state of a track before and after the change + */ public List tracks; + /** + * Constructs a new {@link StreamTrackModification} instance. + * + * @param streamId Identifier of the stream for which tracks were modified + * @param tracks List of track modifications, each containing the state of a track before and after the change + */ public StreamTrackModification(Long streamId, List tracks) { this.streamId = streamId; this.tracks = tracks; diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamTrackModificationPair.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamTrackModificationPair.java index 5ff41eb7..0d06522d 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamTrackModificationPair.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/StreamTrackModificationPair.java @@ -1,19 +1,27 @@ package com.simplito.java.privmx_endpoint.model.stream; +/** + * Represents a single track modification, holding the state of a track before and after the change. + */ public class StreamTrackModificationPair { + /** + * State of the track before the modification + */ public StreamTrackInfo before; + + /** + * State of the track after the modification + */ public StreamTrackInfo after; + /** + * Constructs a new {@link StreamTrackModificationPair} instance. + * + * @param before The state of the track before the modification + * @param after The state of the track after the modification + */ public StreamTrackModificationPair(StreamTrackInfo before, StreamTrackInfo after) { this.before = before; this.after = after; } - - public StreamTrackModificationPair(StreamTrackInfo before) { - this(before, null); - } - - public StreamTrackModificationPair() { - this(null, null); - } } diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/NewStreams.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/NewStreams.java index f05caf94..f9c5b4bf 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/NewStreams.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/NewStreams.java @@ -5,9 +5,26 @@ import java.util.List; +/** + * Data describing the event that occurs when new streams become available for subscription in a stream room. + */ public class NewStreams { + /** + * Identifier of the stream room + */ public String room; + + /** + * List of newly available streams that can be subscribed to + */ public List streams; + + /** + * Constructs a new {@link NewStreams} instance. + * + * @param room Identifier of the stream room + * @param streams List of newly available streams that can be subscribed to + */ public NewStreams(String room, List streams) { this.room = room; this.streams = streams; diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/PublishedStreamData.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/PublishedStreamData.java new file mode 100644 index 00000000..f1e97523 --- /dev/null +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/PublishedStreamData.java @@ -0,0 +1,36 @@ +package com.simplito.java.privmx_endpoint.model.stream.events; + +import com.simplito.java.privmx_endpoint.model.stream.StreamInfo; + +/** + * Represents data of a published stream. + */ +public class PublishedStreamData { + /** + * Identifier of the room in which the stream is published + */ + public String streamRoomId; + + /** + * Information about the published stream + */ + public StreamInfo stream; + + /** + * Identifier of the user who published the stream + */ + public String userId; + + /** + * Constructs a new {@link PublishedStreamData} instance. + * + * @param streamRoomId Identifier of the room in which the stream is published + * @param stream Information about the published stream + * @param userId Identifier of the user who published the stream + */ + public PublishedStreamData(String streamRoomId, StreamInfo stream, String userId) { + this.streamRoomId = streamRoomId; + this.stream = stream; + this.userId = userId; + } +} diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamEventData.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamEventData.java index 71114a60..1ee304e7 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamEventData.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamEventData.java @@ -2,11 +2,29 @@ import java.util.List; +/** + * Data describing the event that occurs when a participant joins a StreamRoom. + */ public class StreamEventData { + /** + * Identifier of the stream room that was joined + */ public String streamRoomId; + public List streamIds; + + /** + * Identifier of the user who joined the StreamRoom + */ public String userId; + /** + * Constructs a new {@link StreamEventData} instance. + * + * @param streamRoomId Identifier of the stream room that was joined + * @param streamIds + * @param userId Identifier of the user who joined the StreamRoom + */ public StreamEventData(String streamRoomId, List streamIds, String userId) { this.streamRoomId = streamRoomId; this.streamIds = streamIds; diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamLeftEventData.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamLeftEventData.java index 72cda9a7..e7c61454 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamLeftEventData.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamLeftEventData.java @@ -1,12 +1,30 @@ package com.simplito.java.privmx_endpoint.model.stream.events; -import java.util.List; - +/** + * Data describing the event that occurs when a participant leaves a StreamRoom. + */ public class StreamLeftEventData { + /** + * Identifier of the StreamRoom that was left + */ public String streamRoomId; + + /** + * Published stream identifier of the user who left + */ public Long streamId; + + /** + * Identifier of the user who left the StreamRoom + */ public String userId; + /** + * Constructs a new {@link StreamLeftEventData} instance. + * + * @param streamRoomId Identifier of the StreamRoom that was left + * @param streamId Identifier of the stream that was left + */ public StreamLeftEventData(String streamRoomId, Long streamId, String userId) { this.streamRoomId = streamRoomId; this.streamId = streamId; diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamPublishedEventData.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamPublishedEventData.java index 0e834766..20e17156 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamPublishedEventData.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamPublishedEventData.java @@ -3,22 +3,32 @@ import com.simplito.java.privmx_endpoint.model.stream.StreamInfo; -// todo: which to choose -// same as StreamPublishedEventData +/** + * Data describing the event that occurs when a publisher starts publishing their stream in a StreamRoom. + */ public class StreamPublishedEventData { - /** - * StreamRoom ID + * Identifier of the stream room in which the stream was published */ public String streamRoomId; /** - * Stream ID's + * Detailed information about the published stream */ public StreamInfo stream; - public String userId; + /** + * Identifier of the user who published the stream + */ + public String userId; + /** + * Constructs a new {@link StreamPublishedEventData} instance. + * + * @param streamRoomId Identifier of the stream room in which the stream was published + * @param stream Detailed information about the published stream + * @param userId Identifier of the user who published the stream + */ public StreamPublishedEventData(String streamRoomId, StreamInfo stream, String userId) { this.streamRoomId = streamRoomId; this.stream = stream; diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamRoomDeletedEventData.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamRoomDeletedEventData.java index eb81ce94..e7f10386 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamRoomDeletedEventData.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamRoomDeletedEventData.java @@ -1,8 +1,19 @@ package com.simplito.java.privmx_endpoint.model.stream.events; +/** + * Data describing the event that occurs when a StreamRoom is deleted. + */ public class StreamRoomDeletedEventData { + /** + * Identifier of the StreamRoom that was deleted + */ public String streamRoomId; + /** + * Constructs a new {@link StreamRoomDeletedEventData} instance. + * + * @param streamRoomId Identifier of the StreamRoom that was deleted + */ public StreamRoomDeletedEventData(String streamRoomId) { this.streamRoomId = streamRoomId; } diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamUnpublishedEventData.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamUnpublishedEventData.java index f0b8935e..5b4ceb40 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamUnpublishedEventData.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamUnpublishedEventData.java @@ -1,11 +1,27 @@ package com.simplito.java.privmx_endpoint.model.stream.events; +/** + * Data describing the event that occurs when a publisher stops publishing their stream in a StreamRoom. + */ public class StreamUnpublishedEventData { + /** + * Identifier of the StreamRoom in which the stream was unpublished + */ public String streamRoomId; + + /** + * Identifier of the stream that was unpublished + */ public Long streamId; + /** + * Constructs a new {@link StreamUnpublishedEventData} instance. + * + * @param streamRoomId Identifier of the StreamRoom in which the stream was unpublished + * @param streamId Identifier of the stream that was unpublished + */ public StreamUnpublishedEventData(String streamRoomId, Long streamId) { this.streamRoomId = streamRoomId; this.streamId = streamId; } -} +} \ No newline at end of file diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamUpdatedEventData.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamUpdatedEventData.java index 274825d9..47c4f66f 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamUpdatedEventData.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamUpdatedEventData.java @@ -6,12 +6,39 @@ import java.util.List; +/** + * Data describing changes that occurred within a stream room during an active session. + * Received when an existing publisher adds, removes, or modifies their tracks. + */ public class StreamUpdatedEventData { + /** + * Identifier of the stream room in which the update occurred + */ public String streamRoomId; + + /** + * List of streams that were added to the stream room + */ public List streamsAdded; + + /** + * List of streams that were removed from the stream room + */ public List streamsRemoved; + + /** + * List of streams that were modified in the stream room + */ public List streamsModified; + /** + * Constructs a new {@link StreamUpdatedEventData} instance. + * + * @param streamRoomId Identifier of the stream room in which the update occurred + * @param streamsAdded List of streams that were added to the stream room + * @param streamsRemoved List of streams that were removed from the stream room + * @param streamsModified List of streams that were modified in the stream room + */ public StreamUpdatedEventData(String streamRoomId, List streamsAdded, List streamsRemoved, List streamsModified) { this.streamRoomId = streamRoomId; this.streamsAdded = streamsAdded; diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamsUpdatedData.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamsUpdatedData.java index 66231546..1d341b0c 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamsUpdatedData.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/StreamsUpdatedData.java @@ -3,10 +3,27 @@ import java.util.List; +/** + * Data received when a new participant joins the StreamRoom. + * Contains a snapshot of all currently active streams in the room. + */ public class StreamsUpdatedData { + /** + * Identifier of the StreamRoom + */ public String room; + + /** + * List of streams in the room + */ public List streams; + /** + * Constructs a new {@link StreamsUpdatedData} instance. + * + * @param room Identifier of the StreamRoom + * @param streams List of streams in the room + */ public StreamsUpdatedData(String room, List streams) { this.room = room; this.streams = streams; diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/UpdatedStreamData.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/UpdatedStreamData.java index 86325aec..434b103e 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/UpdatedStreamData.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/UpdatedStreamData.java @@ -1,16 +1,43 @@ package com.simplito.java.privmx_endpoint.model.stream.events; +/** + * Current state of a single publisher stream, received as part of {@code StreamsUpdatedData}. + */ public class UpdatedStreamData { + /** + * Track type (e.g. "audio", "video", "data") + */ public String type; - public String codec = null; // optional - public Long streamId = null; // optional - public String streamMid = null; // optional - public String streamDisplay = null; // optional public Long mindex; public String mid; Boolean send; Boolean ready; + /** + * Codec used by the stream (e.g. "opus", "VP8") + */ + public String codec = null; // optional + + /** + * Identifier of the publisher stream + */ + public Long streamId = null; // optional + public String streamMid = null; // optional + public String streamDisplay = null; // optional + + /** + * Constructs a new {@link UpdatedStreamData} instance. + * + * @param type Track type (e.g. "audio", "video", "data") + * @param mindex + * @param mid + * @param send + * @param ready + * @param codec Codec used by the stream (e.g. "opus", "VP8") + * @param streamId Identifier of the publisher stream + * @param streamMid + * @param streamDisplay + */ public UpdatedStreamData(String type, Long mindex, String mid, Boolean send, Boolean ready, String codec, Long streamId, String streamMid, String streamDisplay) { this.type = type; this.codec = codec; @@ -22,20 +49,4 @@ public UpdatedStreamData(String type, Long mindex, String mid, Boolean send, Boo this.send = send; this.ready = ready; } - - public UpdatedStreamData(String type, Long mindex, String mid, Boolean send, Boolean ready, String codec, Long streamId, String streamMid) { - this(type, mindex, mid, send, ready, codec, streamId, streamMid, null); - } - - public UpdatedStreamData(String type, Long mindex, String mid, Boolean send, Boolean ready, String codec, Long streamId) { - this(type, mindex, mid, send, ready, codec, streamId, null, null); - } - - public UpdatedStreamData(String type, Long mindex, String mid, Boolean send, Boolean ready, String codec) { - this(type, mindex, mid, send, ready, codec, null, null, null); - } - - public UpdatedStreamData(String type, Long mindex, String mid, Boolean send, Boolean ready) { - this(type, mindex, mid, send, ready, null, null, null, null); - } } \ No newline at end of file diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/eventSelectorTypes/StreamEventSelectorType.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/eventSelectorTypes/StreamEventSelectorType.java index 3ab7e769..3c3a5007 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/eventSelectorTypes/StreamEventSelectorType.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/eventSelectorTypes/StreamEventSelectorType.java @@ -2,8 +2,25 @@ import com.simplito.java.privmx_endpoint.model.events.eventSelectorTypes.EventSelectorType; +/** + * Specifies the type of identifier used to select a stream event. + * Stream events can be targeted based on different levels of granularity within the stream structure. + * This enum defines the possible types of selectors for these events. + * + */ public enum StreamEventSelectorType implements EventSelectorType { + /** + * Selects events based on the ID of the context. + */ CONTEXT_ID, + + /** + * Selects events based on the ID of the stream room. + */ STREAMROOM_ID, + + /** + * Selects events based on the ID of a specific stream. + */ STREAM_ID } diff --git a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/eventTypes/StreamEventType.java b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/eventTypes/StreamEventType.java index 44d290fd..e8283d40 100644 --- a/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/eventTypes/StreamEventType.java +++ b/privmx-endpoint/src/main/java/com/simplito/java/privmx_endpoint/model/stream/events/eventTypes/StreamEventType.java @@ -2,15 +2,42 @@ import com.simplito.java.privmx_endpoint.model.events.eventTypes.EventType; +/** + * Defines the types of events that can occur within the stream for which a client can subscribe. + * This enum lists the various actions or changes that can happen to + * stream rooms and their streams, allowing observers to be notified of specific occurrences. + */ public enum StreamEventType implements EventType { + /** + * Type of event triggered when a new StreamRoom is created. + */ STREAMROOM_CREATE, + /** + * Type of event triggered when an existing StreamRoom is updated. + */ STREAMROOM_UPDATE, + /** + * Type of event triggered when a StreamRoom is deleted. + */ STREAMROOM_DELETE, + /** + * Do not use. + */ EMPTY, + /** + * Type of event triggered when a participant joins a StreamRoom. + */ STREAM_JOIN, + /** + * Type of event triggered when a participant leaves a StreamRoom. + */ STREAM_LEAVE, + /** + * Type of event triggered when a participant starts publishing a stream. + */ STREAM_PUBLISH, + /** + * Type of event triggered when a participant stops publishing a stream. + */ STREAM_UNPUBLISH -} - - +} \ No newline at end of file