Class StreamService
- All Implemented Interfaces:
OboService<OboStreamService>
,OboStreamService
This service is used for retrieving information about a particular stream or chatroom, searching streams, listing members, attachments of a particular stream, perform some action related to a stream like:
- Create a IM or MIM
- Create a chatroom
- Activate or Deactivate a chatroom
-
Constructor Summary
ConstructorDescriptionStreamService
(StreamsApi streamsApi, RoomMembershipApi membershipApi, ShareApi shareApi, AuthSession authSession, RetryWithRecoveryBuilder<?> retryBuilder) StreamService
(StreamsApi streamsApi, RoomMembershipApi membershipApi, ShareApi shareApi, RetryWithRecoveryBuilder<?> retryBuilder) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMemberToRoom
(Long userId, String roomId) create
(V3RoomAttributes roomAttributes) Create a new chatroom.Create a new single or multi party instant message conversation between the caller and specified users.createInstantMessageAdmin
(List<Long> uids) Create a new single or multi party instant message conversation.void
demoteUserToRoomParticipant
(Long userId, String roomId) getInstantMessageInfo
(String imId) Returns information about a particular IM.getRoomInfo
(String roomId) Get information about a particular room.listAllStreamMembers
(String streamId) List the current members of an existing room and return in aStream
with default chunk size and total size equals 100.listAllStreamMembers
(String streamId, StreamPaginationAttribute pagination) List the current members of an existing room and return in aStream
.listAllStreams
(StreamFilter filter) listAllStreams
(StreamFilter filter, StreamPaginationAttribute pagination) Retrieve all the streams across the enterprise and return in aStream
with default chunk size and total size equals 100.listAllStreamsAdmin
(V2AdminStreamFilter filter, StreamPaginationAttribute pagination) Retrieve all the streams across the enterprise and return in aStream
.listRoomMembers
(String roomId) Lists the current members of an existing room.listStreamMembers
(String streamId) List the current members of an existing stream.listStreamMembers
(String streamId, PaginationAttribute pagination) List the current members of an existing stream.listStreams
(StreamFilter filter) listStreams
(StreamFilter filter, PaginationAttribute pagination) listStreamsAdmin
(V2AdminStreamFilter filter) Retrieve all the streams across the enterprise.listStreamsAdmin
(V2AdminStreamFilter filter, PaginationAttribute pagination) Retrieve all the streams across the enterprise.obo
(AuthSession oboSession) Returns a new service instance with OBO-enabled endpoints from a given OBO session.void
promoteUserToRoomOwner
(Long userId, String roomId) void
removeMemberFromRoom
(Long userId, String roomId) Search rooms and return in aStream
according to the specified criteria.searchAllRooms
(V2RoomSearchCriteria query, StreamPaginationAttribute pagination) Search rooms and return in aStream
according to the specified criteria.searchRooms
(V2RoomSearchCriteria query) Search rooms according to the specified criteria.searchRooms
(V2RoomSearchCriteria query, PaginationAttribute pagination) Search rooms according to the specified criteria.setRoomActive
(String roomId, Boolean active) Deactivate or reactivate a chatroom.setRoomActiveAdmin
(String streamId, Boolean active) Deactivate or reactivate a chatroom via AC Portal.share
(String streamId, ShareContent content) updateInstantMessage
(String imId, V1IMAttributes imAttributes) Updates attributes on an existing IMupdateRoom
(String roomId, V3RoomAttributes roomAttributes) Update the attributes of an existing chatroom.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.symphony.bdk.core.service.OboService
checkAuthSession
-
Constructor Details
-
Method Details
-
obo
Returns a new service instance with OBO-enabled endpoints from a given OBO session.- Specified by:
obo
in interfaceOboService<OboStreamService>
- Parameters:
oboSession
- the OBO session- Returns:
- the instance of the service class with OBO-enabled endpoints
-
getStream
- Specified by:
getStream
in interfaceOboStreamService
- Parameters:
streamId
- The stream id.- Returns:
- The information about the stream with the given id.
- See Also:
-
listStreams
- Specified by:
listStreams
in interfaceOboStreamService
- Parameters:
filter
- The stream searching criteria.- Returns:
- The list of streams retrieved according to the searching criteria.
- See Also:
-
listStreams
public List<StreamAttributes> listStreams(@Nullable StreamFilter filter, @Nonnull PaginationAttribute pagination) - Specified by:
listStreams
in interfaceOboStreamService
- Parameters:
filter
- The stream searching criteria.pagination
- The skip and limit for pagination.- Returns:
- The list of streams retrieved according to the searching criteria.
- See Also:
-
listAllStreams
@API(status=EXPERIMENTAL) public Stream<StreamAttributes> listAllStreams(@Nullable StreamFilter filter) - Specified by:
listAllStreams
in interfaceOboStreamService
- Parameters:
filter
- The stream searching criteria.- Returns:
- a
Stream
of matching streams according to the searching criteria. - See Also:
-
listAllStreams
@API(status=EXPERIMENTAL) public Stream<StreamAttributes> listAllStreams(@Nullable StreamFilter filter, @Nonnull StreamPaginationAttribute pagination) - Specified by:
listAllStreams
in interfaceOboStreamService
- Parameters:
filter
- The stream searching criteria.pagination
- The chunkSize and totalSize for pagination.- Returns:
- a
Stream
of matching streams according to the searching criteria. - See Also:
-
addMemberToRoom
- Specified by:
addMemberToRoom
in interfaceOboStreamService
- Parameters:
userId
- The id of the user to be added to the given roomroomId
- The room id- See Also:
-
removeMemberFromRoom
- Specified by:
removeMemberFromRoom
in interfaceOboStreamService
- Parameters:
userId
- The id of the user to be removed from the given roomroomId
- The room id- See Also:
-
promoteUserToRoomOwner
- Specified by:
promoteUserToRoomOwner
in interfaceOboStreamService
- Parameters:
userId
- The id of the user to be promoted to room owner.roomId
- The room id.- See Also:
-
demoteUserToRoomParticipant
- Specified by:
demoteUserToRoomParticipant
in interfaceOboStreamService
- Parameters:
userId
- The id of the user to be demoted to room participant.roomId
- The room id.- See Also:
-
create
- Specified by:
create
in interfaceOboStreamService
- Parameters:
uids
- User ids of the participant- Returns:
- The created IM
- See Also:
-
create
Create a new single or multi party instant message conversation between the caller and specified users.The caller is implicitly included in the members of the created chat.
Duplicate users will be included in the membership of the chat but the duplication will be silently ignored.
If there is an existing IM conversation with the same set of participants then the id of that existing stream will be returned.
If the given list of user ids contains only one id, an IM will be created, otherwise, a MIM will be created.
- Specified by:
create
in interfaceOboStreamService
- Parameters:
uids
- List of user ids of the participants.- Returns:
- The created IM or MIM
- See Also:
-
create
Create a new chatroom. If no attributes are specified, the room is created as a private chatroom.- Specified by:
create
in interfaceOboStreamService
- Parameters:
roomAttributes
- Attributes of the created room- Returns:
- The created chatroom
- See Also:
-
updateRoom
Update the attributes of an existing chatroom.- Specified by:
updateRoom
in interfaceOboStreamService
- Parameters:
roomId
- The id of the room to be updatedroomAttributes
- The attributes to be updated to the room- Returns:
- The information of the room after being updated.
- See Also:
-
getRoomInfo
Get information about a particular room.- Specified by:
getRoomInfo
in interfaceOboStreamService
- Parameters:
roomId
- The room id.- Returns:
- The information about the room with the given room id.
- See Also:
-
searchRooms
Search rooms according to the specified criteria.- Specified by:
searchRooms
in interfaceOboStreamService
- Parameters:
query
- The room searching criteria- Returns:
- The rooms returned according to the given criteria.
- See Also:
-
searchRooms
public V3RoomSearchResults searchRooms(@Nonnull V2RoomSearchCriteria query, @Nonnull PaginationAttribute pagination) Search rooms according to the specified criteria.- Specified by:
searchRooms
in interfaceOboStreamService
- Parameters:
query
- The room searching criteria.pagination
- The skip and limit for pagination.- Returns:
- The rooms returned according to the given criteria.
- See Also:
-
searchAllRooms
@API(status=EXPERIMENTAL) public Stream<V3RoomDetail> searchAllRooms(@Nonnull V2RoomSearchCriteria query) Search rooms and return in aStream
according to the specified criteria.- Specified by:
searchAllRooms
in interfaceOboStreamService
- Parameters:
query
- The room searching criteria.- Returns:
- A
Stream
of rooms returned according to the given criteria. - See Also:
-
searchAllRooms
@API(status=EXPERIMENTAL) public Stream<V3RoomDetail> searchAllRooms(@Nonnull V2RoomSearchCriteria query, @Nonnull StreamPaginationAttribute pagination) Search rooms and return in aStream
according to the specified criteria.- Specified by:
searchAllRooms
in interfaceOboStreamService
- Parameters:
query
- The room searching criteria.pagination
- The chunkSize and totalSize for stream pagination.- Returns:
- A
Stream
of rooms returned according to the given criteria. - See Also:
-
setRoomActive
Deactivate or reactivate a chatroom. At the creation, the chatroom is activated by default.- Parameters:
roomId
- The room idactive
- Deactivate or activate- Returns:
- The information of the room after being deactivated or reactivated.
- See Also:
-
createInstantMessageAdmin
Create a new single or multi party instant message conversation. At least two user IDs must be provided or an error response will be sent.The caller is not included in the members of the created chat.
Duplicate users will be included in the membership of the chat but the duplication will be silently ignored.
If there is an existing IM conversation with the same set of participants then the id of that existing stream will be returned.
- Parameters:
uids
- List of user IDs of participants. At least two user IDs must be provided- Returns:
- The created IM or MIM
- See Also:
-
updateInstantMessage
Updates attributes on an existing IM- Parameters:
imId
- The id or the IM to be updatedimAttributes
- The attributes to be updated in the IM- Returns:
- IM information after the update
- See Also:
-
getInstantMessageInfo
Returns information about a particular IM.- Parameters:
imId
- The id of the IM.- Returns:
- The information about the IM with the given id
- See Also:
-
setRoomActiveAdmin
Deactivate or reactivate a chatroom via AC Portal.- Parameters:
streamId
- The stream idactive
- Deactivate or activate- Returns:
- The information of the room after being deactivated or reactivated.
-
listStreamsAdmin
Retrieve all the streams across the enterprise.- Parameters:
filter
- The stream searching filter- Returns:
- List of streams returned according the given filter.
- See Also:
-
listStreamsAdmin
public V2AdminStreamList listStreamsAdmin(@Nullable V2AdminStreamFilter filter, @Nonnull PaginationAttribute pagination) Retrieve all the streams across the enterprise.- Parameters:
filter
- The stream searching filterpagination
- The skip and limit for pagination.- Returns:
- List of streams returned according the given filter.
- See Also:
-
listAllStreamsAdmin
@API(status=EXPERIMENTAL) public Stream<V2AdminStreamInfo> listAllStreamsAdmin(@Nullable V2AdminStreamFilter filter) Retrieve all the streams across the enterprise and return in aStream
with default chunk size and total size equals 100.- Parameters:
filter
- The stream searching filter- Returns:
- List of streams returned according the given filter.
- See Also:
-
listAllStreamsAdmin
@API(status=EXPERIMENTAL) public Stream<V2AdminStreamInfo> listAllStreamsAdmin(@Nullable V2AdminStreamFilter filter, @Nonnull StreamPaginationAttribute pagination) Retrieve all the streams across the enterprise and return in aStream
.- Parameters:
filter
- The stream searching filterpagination
- The chunkSize and totalSize for stream pagination.- Returns:
- A
Stream
of streams returned according the given filter. - See Also:
-
listStreamMembers
List the current members of an existing stream. The stream can be of type IM, MIM, or ROOM.- Parameters:
streamId
- The stream id- Returns:
- List of member in the stream with the given stream id.
- See Also:
-
listStreamMembers
public V2MembershipList listStreamMembers(@Nonnull String streamId, @Nonnull PaginationAttribute pagination) List the current members of an existing stream. The stream can be of type IM, MIM, or ROOM.- Parameters:
streamId
- The stream idpagination
- The skip and limit for pagination.- Returns:
- List of member in the stream with the given stream id.
- See Also:
-
listAllStreamMembers
@API(status=EXPERIMENTAL) public Stream<V2MemberInfo> listAllStreamMembers(@Nonnull String streamId) List the current members of an existing room and return in aStream
with default chunk size and total size equals 100. The stream can be of type IM, MIM, or ROOM.- Parameters:
streamId
- The stream id- Returns:
- A
Stream
of members in the stream with the given stream id. - See Also:
-
listAllStreamMembers
@API(status=EXPERIMENTAL) public Stream<V2MemberInfo> listAllStreamMembers(@Nonnull String streamId, @Nonnull StreamPaginationAttribute pagination) List the current members of an existing room and return in aStream
. The stream can be of type IM, MIM, or ROOM.- Parameters:
streamId
- The stream idpagination
- The chunkSize and totalSize for stream pagination with default value equal 100.- Returns:
- A
Stream
of members in the stream with the given stream id. - See Also:
-
listRoomMembers
Lists the current members of an existing room.- Parameters:
roomId
- The room stream id- Returns:
- List of members in the room with the given room id.
- See Also:
-