@API(status=STABLE) public class StreamService extends java.lang.Object implements OboStreamService, OboService<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:
Constructor and Description |
---|
StreamService(StreamsApi streamsApi,
RoomMembershipApi membershipApi,
ShareApi shareApi,
AuthSession authSession,
RetryWithRecoveryBuilder<?> retryBuilder) |
StreamService(StreamsApi streamsApi,
RoomMembershipApi membershipApi,
ShareApi shareApi,
RetryWithRecoveryBuilder<?> retryBuilder) |
Modifier and Type | Method and Description |
---|---|
void |
addMemberToRoom(java.lang.Long userId,
java.lang.String roomId)
|
Stream |
create(java.util.List<java.lang.Long> uids)
Create a new single or multi party instant message conversation between the caller and specified users.
|
Stream |
create(java.lang.Long... uids)
|
V3RoomDetail |
create(V3RoomAttributes roomAttributes)
Create a new chatroom.
|
Stream |
createInstantMessageAdmin(java.util.List<java.lang.Long> uids)
Create a new single or multi party instant message conversation.
|
void |
demoteUserToRoomParticipant(java.lang.Long userId,
java.lang.String roomId)
|
V1IMDetail |
getInstantMessageInfo(java.lang.String imId)
Returns information about a particular IM.
|
V3RoomDetail |
getRoomInfo(java.lang.String roomId)
Get information about a particular room.
|
V2StreamAttributes |
getStream(java.lang.String streamId)
|
java.util.stream.Stream<V2MemberInfo> |
listAllStreamMembers(java.lang.String streamId)
List the current members of an existing room and return in a
Stream with default chunk size and total size equals 100. |
java.util.stream.Stream<V2MemberInfo> |
listAllStreamMembers(java.lang.String streamId,
StreamPaginationAttribute pagination)
List the current members of an existing room and return in a
Stream . |
java.util.stream.Stream<StreamAttributes> |
listAllStreams(StreamFilter filter)
|
java.util.stream.Stream<StreamAttributes> |
listAllStreams(StreamFilter filter,
StreamPaginationAttribute pagination)
|
java.util.stream.Stream<V2AdminStreamInfo> |
listAllStreamsAdmin(V2AdminStreamFilter filter)
Retrieve all the streams across the enterprise and return in a
Stream with default chunk size and total size equals 100. |
java.util.stream.Stream<V2AdminStreamInfo> |
listAllStreamsAdmin(V2AdminStreamFilter filter,
StreamPaginationAttribute pagination)
Retrieve all the streams across the enterprise and return in a
Stream . |
java.util.List<MemberInfo> |
listRoomMembers(java.lang.String roomId)
Lists the current members of an existing room.
|
V2MembershipList |
listStreamMembers(java.lang.String streamId)
List the current members of an existing stream.
|
V2MembershipList |
listStreamMembers(java.lang.String streamId,
PaginationAttribute pagination)
List the current members of an existing stream.
|
java.util.List<StreamAttributes> |
listStreams(StreamFilter filter)
|
java.util.List<StreamAttributes> |
listStreams(StreamFilter filter,
PaginationAttribute pagination)
|
V2AdminStreamList |
listStreamsAdmin(V2AdminStreamFilter filter)
Retrieve all the streams across the enterprise.
|
V2AdminStreamList |
listStreamsAdmin(V2AdminStreamFilter filter,
PaginationAttribute pagination)
Retrieve all the streams across the enterprise.
|
OboStreamService |
obo(AuthSession oboSession)
Returns a new service instance with OBO-enabled endpoints from a given OBO session.
|
void |
promoteUserToRoomOwner(java.lang.Long userId,
java.lang.String roomId)
|
void |
removeMemberFromRoom(java.lang.Long userId,
java.lang.String roomId)
|
java.util.stream.Stream<V3RoomDetail> |
searchAllRooms(V2RoomSearchCriteria query)
Search rooms and return in a
Stream according to the specified criteria. |
java.util.stream.Stream<V3RoomDetail> |
searchAllRooms(V2RoomSearchCriteria query,
StreamPaginationAttribute pagination)
Search rooms and return in a
Stream according to the specified criteria. |
V3RoomSearchResults |
searchRooms(V2RoomSearchCriteria query)
Search rooms according to the specified criteria.
|
V3RoomSearchResults |
searchRooms(V2RoomSearchCriteria query,
PaginationAttribute pagination)
Search rooms according to the specified criteria.
|
RoomDetail |
setRoomActive(java.lang.String roomId,
java.lang.Boolean active)
Deactivate or reactivate a chatroom.
|
RoomDetail |
setRoomActiveAdmin(java.lang.String streamId,
java.lang.Boolean active)
Deactivate or reactivate a chatroom via AC Portal.
|
V2Message |
share(java.lang.String streamId,
ShareContent content)
|
V1IMDetail |
updateInstantMessage(java.lang.String imId,
V1IMAttributes imAttributes)
Updates attributes on an existing IM
|
V3RoomDetail |
updateRoom(java.lang.String roomId,
V3RoomAttributes roomAttributes)
Update the attributes of an existing chatroom.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkAuthSession
public StreamService(StreamsApi streamsApi, RoomMembershipApi membershipApi, ShareApi shareApi, AuthSession authSession, RetryWithRecoveryBuilder<?> retryBuilder)
public StreamService(StreamsApi streamsApi, RoomMembershipApi membershipApi, ShareApi shareApi, RetryWithRecoveryBuilder<?> retryBuilder)
public OboStreamService obo(AuthSession oboSession)
obo
in interface OboService<OboStreamService>
oboSession
- the OBO sessionpublic V2StreamAttributes getStream(@Nonnull java.lang.String streamId)
getStream
in interface OboStreamService
streamId
- The stream id.public java.util.List<StreamAttributes> listStreams(@Nullable StreamFilter filter)
listStreams
in interface OboStreamService
filter
- The stream searching criteria.public java.util.List<StreamAttributes> listStreams(@Nullable StreamFilter filter, @Nonnull PaginationAttribute pagination)
listStreams
in interface OboStreamService
filter
- The stream searching criteria.pagination
- The skip and limit for pagination.@API(status=EXPERIMENTAL) public java.util.stream.Stream<StreamAttributes> listAllStreams(@Nullable StreamFilter filter)
listAllStreams
in interface OboStreamService
filter
- The stream searching criteria.Stream
of matching streams according to the searching criteria.@API(status=EXPERIMENTAL) public java.util.stream.Stream<StreamAttributes> listAllStreams(@Nullable StreamFilter filter, @Nonnull StreamPaginationAttribute pagination)
listAllStreams
in interface OboStreamService
filter
- The stream searching criteria.pagination
- The chunkSize and totalSize for pagination.Stream
of matching streams according to the searching criteria.public void addMemberToRoom(@Nonnull java.lang.Long userId, @Nonnull java.lang.String roomId)
addMemberToRoom
in interface OboStreamService
userId
- The id of the user to be added to the given roomroomId
- The room idpublic void removeMemberFromRoom(@Nonnull java.lang.Long userId, @Nonnull java.lang.String roomId)
removeMemberFromRoom
in interface OboStreamService
userId
- The id of the user to be removed from the given roomroomId
- The room idpublic V2Message share(@Nonnull java.lang.String streamId, @Nonnull ShareContent content)
share
in interface OboStreamService
streamId
- The stream id.content
- The third-party ShareContent
to be shared.public void promoteUserToRoomOwner(@Nonnull java.lang.Long userId, @Nonnull java.lang.String roomId)
promoteUserToRoomOwner
in interface OboStreamService
userId
- The id of the user to be promoted to room owner.roomId
- The room id.public void demoteUserToRoomParticipant(@Nonnull java.lang.Long userId, @Nonnull java.lang.String roomId)
demoteUserToRoomParticipant
in interface OboStreamService
userId
- The id of the user to be demoted to room participant.roomId
- The room id.public Stream create(@Nonnull java.lang.Long... uids)
create
in interface OboStreamService
uids
- User ids of the participantpublic Stream create(@Nonnull java.util.List<java.lang.Long> uids)
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.
create
in interface OboStreamService
uids
- List of user ids of the participants.public V3RoomDetail create(@Nonnull V3RoomAttributes roomAttributes)
create
in interface OboStreamService
roomAttributes
- Attributes of the created roompublic V3RoomDetail updateRoom(@Nonnull java.lang.String roomId, @Nonnull V3RoomAttributes roomAttributes)
updateRoom
in interface OboStreamService
roomId
- The id of the room to be updatedroomAttributes
- The attributes to be updated to the roompublic V3RoomDetail getRoomInfo(@Nonnull java.lang.String roomId)
getRoomInfo
in interface OboStreamService
roomId
- The room id.public V3RoomSearchResults searchRooms(@Nonnull V2RoomSearchCriteria query)
searchRooms
in interface OboStreamService
query
- The room searching criteriapublic V3RoomSearchResults searchRooms(@Nonnull V2RoomSearchCriteria query, @Nonnull PaginationAttribute pagination)
searchRooms
in interface OboStreamService
query
- The room searching criteria.pagination
- The skip and limit for pagination.@API(status=EXPERIMENTAL) public java.util.stream.Stream<V3RoomDetail> searchAllRooms(@Nonnull V2RoomSearchCriteria query)
Stream
according to the specified criteria.searchAllRooms
in interface OboStreamService
query
- The room searching criteria.Stream
of rooms returned according to the given criteria.@API(status=EXPERIMENTAL) public java.util.stream.Stream<V3RoomDetail> searchAllRooms(@Nonnull V2RoomSearchCriteria query, @Nonnull StreamPaginationAttribute pagination)
Stream
according to the specified criteria.searchAllRooms
in interface OboStreamService
query
- The room searching criteria.pagination
- The chunkSize and totalSize for stream pagination.Stream
of rooms returned according to the given criteria.public RoomDetail setRoomActive(@Nonnull java.lang.String roomId, @Nonnull java.lang.Boolean active)
roomId
- The room idactive
- Deactivate or activatepublic Stream createInstantMessageAdmin(@Nonnull java.util.List<java.lang.Long> uids)
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.
uids
- List of user IDs of participants. At least two user IDs must be providedpublic V1IMDetail updateInstantMessage(@Nonnull java.lang.String imId, @Nonnull V1IMAttributes imAttributes)
imId
- The id or the IM to be updatedimAttributes
- The attributes to be updated in the IMpublic V1IMDetail getInstantMessageInfo(@Nonnull java.lang.String imId)
imId
- The id of the IM.public RoomDetail setRoomActiveAdmin(@Nonnull java.lang.String streamId, @Nonnull java.lang.Boolean active)
streamId
- The stream idactive
- Deactivate or activatepublic V2AdminStreamList listStreamsAdmin(@Nullable V2AdminStreamFilter filter)
filter
- The stream searching filterpublic V2AdminStreamList listStreamsAdmin(@Nullable V2AdminStreamFilter filter, @Nonnull PaginationAttribute pagination)
filter
- The stream searching filterpagination
- The skip and limit for pagination.@API(status=EXPERIMENTAL) public java.util.stream.Stream<V2AdminStreamInfo> listAllStreamsAdmin(@Nullable V2AdminStreamFilter filter)
Stream
with default chunk size and total size equals 100.filter
- The stream searching filter@API(status=EXPERIMENTAL) public java.util.stream.Stream<V2AdminStreamInfo> listAllStreamsAdmin(@Nullable V2AdminStreamFilter filter, @Nonnull StreamPaginationAttribute pagination)
Stream
.filter
- The stream searching filterpagination
- The chunkSize and totalSize for stream pagination.Stream
of streams returned according the given filter.public V2MembershipList listStreamMembers(@Nonnull java.lang.String streamId)
streamId
- The stream idpublic V2MembershipList listStreamMembers(@Nonnull java.lang.String streamId, @Nonnull PaginationAttribute pagination)
streamId
- The stream idpagination
- The skip and limit for pagination.@API(status=EXPERIMENTAL) public java.util.stream.Stream<V2MemberInfo> listAllStreamMembers(@Nonnull java.lang.String streamId)
Stream
with default chunk size and total size equals 100.
The stream can be of type IM, MIM, or ROOM.streamId
- The stream idStream
of members in the stream with the given stream id.@API(status=EXPERIMENTAL) public java.util.stream.Stream<V2MemberInfo> listAllStreamMembers(@Nonnull java.lang.String streamId, @Nonnull StreamPaginationAttribute pagination)
Stream
.
The stream can be of type IM, MIM, or ROOM.streamId
- The stream idpagination
- The chunkSize and totalSize for stream pagination with default value equal 100.Stream
of members in the stream with the given stream id.public java.util.List<MemberInfo> listRoomMembers(@Nonnull java.lang.String roomId)
roomId
- The room stream id