Class ConversationParticipantBuilderImpl
- java.lang.Object
-
- com.flowable.engage.engine.impl.conversation.ConversationParticipantBuilderImpl
-
- All Implemented Interfaces:
ConversationParticipantBuilder
public class ConversationParticipantBuilderImpl extends Object implements ConversationParticipantBuilder
Default implementation for the participant builder API.- Author:
- Micha Kiener
-
-
Field Summary
Fields Modifier and Type Field Description protected EngageEngineConfigurationconfigurationprotected StringconversationIdprotected List<String>participantsToDropprotected List<JoinParticipantsData>participantsToJoin
-
Constructor Summary
Constructors Constructor Description ConversationParticipantBuilderImpl(EngageEngineConfiguration configuration, String conversationId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConversationParticipantBuilderdropParticipant(String userId)Drops the given participant from the conversation.ConversationParticipantBuilderdropParticipants(String... userIds)Drops the given participants from the conversation.ConversationParticipantBuilderdropParticipants(Collection<String> userIds)Drops the given participants from the conversation.StringgetConversationId()List<String>getParticipantsToDrop()List<JoinParticipantsData>getParticipantsToJoin()ParticipantJoiningBuilderjoinParticipant(String userId)Joins a single participant.ParticipantJoiningBuilderjoinParticipants(String... userIds)Joins one or more participants.ParticipantJoiningBuilderjoinParticipants(Collection<String> userIds)Joins a collection of participants.voidsave()Executes all collected join and drop commands and saves them.protected voidvalidateData()Internal validation to check whether no participant is added and removed the same time.
-
-
-
Field Detail
-
configuration
protected final EngageEngineConfiguration configuration
-
conversationId
protected final String conversationId
-
participantsToJoin
protected List<JoinParticipantsData> participantsToJoin
-
-
Constructor Detail
-
ConversationParticipantBuilderImpl
public ConversationParticipantBuilderImpl(EngageEngineConfiguration configuration, String conversationId)
-
-
Method Detail
-
joinParticipant
public ParticipantJoiningBuilder joinParticipant(String userId)
Description copied from interface:ConversationParticipantBuilderJoins a single participant.- Specified by:
joinParticipantin 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
public ParticipantJoiningBuilder joinParticipants(String... userIds)
Description copied from interface:ConversationParticipantBuilderJoins one or more participants.- Specified by:
joinParticipantsin 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
public ParticipantJoiningBuilder joinParticipants(Collection<String> userIds)
Description copied from interface:ConversationParticipantBuilderJoins a collection of participants.- Specified by:
joinParticipantsin 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
public ConversationParticipantBuilder dropParticipant(String userId)
Description copied from interface:ConversationParticipantBuilderDrops the given participant from the conversation.- Specified by:
dropParticipantin interfaceConversationParticipantBuilder- Parameters:
userId- the user to be dropped from the conversation- Returns:
- this builder for further participant management
-
dropParticipants
public ConversationParticipantBuilder dropParticipants(String... userIds)
Description copied from interface:ConversationParticipantBuilderDrops the given participants from the conversation.- Specified by:
dropParticipantsin interfaceConversationParticipantBuilder- Parameters:
userIds- the users to be dropped from the conversation- Returns:
- this builder for further participant management
-
dropParticipants
public ConversationParticipantBuilder dropParticipants(Collection<String> userIds)
Description copied from interface:ConversationParticipantBuilderDrops the given participants from the conversation.- Specified by:
dropParticipantsin 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:ConversationParticipantBuilderExecutes all collected join and drop commands and saves them.- Specified by:
savein interfaceConversationParticipantBuilder
-
getConversationId
public String getConversationId()
-
getParticipantsToJoin
public List<JoinParticipantsData> getParticipantsToJoin()
-
-