Class ConversationParticipantBuilderImpl
java.lang.Object
com.flowable.engage.engine.impl.conversation.ConversationParticipantBuilderImpl
- All Implemented Interfaces:
ConversationParticipantBuilder
public class ConversationParticipantBuilderImpl extends java.lang.Object implements ConversationParticipantBuilder
Default implementation for the participant builder API.
- Author:
- Micha Kiener
-
Field Summary
Fields Modifier and Type Field Description protected EngageEngineConfiguration
configuration
protected java.lang.String
conversationId
protected java.util.List<java.lang.String>
participantsToDrop
protected java.util.List<JoinParticipantsData>
participantsToJoin
-
Constructor Summary
Constructors Constructor Description ConversationParticipantBuilderImpl(EngageEngineConfiguration configuration, java.lang.String conversationId)
-
Method Summary
Modifier and Type Method Description ConversationParticipantBuilder
dropParticipant(java.lang.String userId)
Drops the given participant from the conversation.ConversationParticipantBuilder
dropParticipants(java.lang.String... userIds)
Drops the given participants from the conversation.ConversationParticipantBuilder
dropParticipants(java.util.Collection<java.lang.String> userIds)
Drops the given participants from the conversation.java.lang.String
getConversationId()
java.util.List<java.lang.String>
getParticipantsToDrop()
java.util.List<JoinParticipantsData>
getParticipantsToJoin()
ParticipantJoiningBuilder
joinParticipant(java.lang.String userId)
Joins a single participant.ParticipantJoiningBuilder
joinParticipants(java.lang.String... userIds)
Joins one or more participants.ParticipantJoiningBuilder
joinParticipants(java.util.Collection<java.lang.String> userIds)
Joins a collection of participants.void
save()
Executes all collected join and drop commands and saves them.protected void
validateData()
Internal validation to check whether no participant is added and removed the same time.
-
Field Details
-
configuration
-
conversationId
protected final java.lang.String conversationId -
participantsToJoin
-
participantsToDrop
protected java.util.List<java.lang.String> participantsToDrop
-
-
Constructor Details
-
ConversationParticipantBuilderImpl
public ConversationParticipantBuilderImpl(EngageEngineConfiguration configuration, java.lang.String conversationId)
-
-
Method Details
-
joinParticipant
Description copied from interface:ConversationParticipantBuilder
Joins a single participant.- Specified by:
joinParticipant
in interfaceConversationParticipantBuilder
- Parameters:
userId
- the id of the user to be added as a new participant- Returns:
- the joining builder to set the joining time (e.g. default, now, from beginning, etc)
-
joinParticipants
Description copied from interface:ConversationParticipantBuilder
Joins one or more participants.- Specified by:
joinParticipants
in interfaceConversationParticipantBuilder
- Parameters:
userIds
- the ids of the users to be added as a new participants- Returns:
- the joining builder to set the joining time (e.g. default, now, from beginning, etc) which is then used for all the provided users
-
joinParticipants
Description copied from interface:ConversationParticipantBuilder
Joins a collection of participants.- Specified by:
joinParticipants
in interfaceConversationParticipantBuilder
- Parameters:
userIds
- the ids of the users to be added as a new participants- Returns:
- the joining builder to set the joining time (e.g. default, now, from beginning, etc) which is then used for all the provided users
-
dropParticipant
Description copied from interface:ConversationParticipantBuilder
Drops the given participant from the conversation.- Specified by:
dropParticipant
in interfaceConversationParticipantBuilder
- Parameters:
userId
- the user to be dropped from the conversation- Returns:
- this builder for further participant management
-
dropParticipants
Description copied from interface:ConversationParticipantBuilder
Drops the given participants from the conversation.- Specified by:
dropParticipants
in interfaceConversationParticipantBuilder
- Parameters:
userIds
- the users to be dropped from the conversation- Returns:
- this builder for further participant management
-
dropParticipants
public ConversationParticipantBuilder dropParticipants(java.util.Collection<java.lang.String> userIds)Description copied from interface:ConversationParticipantBuilder
Drops the given participants from the conversation.- Specified by:
dropParticipants
in interfaceConversationParticipantBuilder
- Parameters:
userIds
- the users to be dropped from the conversation- Returns:
- this builder for further participant management
-
validateData
protected void validateData()Internal validation to check whether no participant is added and removed the same time. -
save
public void save()Description copied from interface:ConversationParticipantBuilder
Executes all collected join and drop commands and saves them.- Specified by:
save
in interfaceConversationParticipantBuilder
-
getConversationId
public java.lang.String getConversationId() -
getParticipantsToJoin
-
getParticipantsToDrop
public java.util.List<java.lang.String> getParticipantsToDrop()
-