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 EngageEngineConfiguration
configuration
protected String
conversationId
protected List<String>
participantsToDrop
protected 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 ConversationParticipantBuilder
dropParticipant(String userId)
Drops the given participant from the conversation.ConversationParticipantBuilder
dropParticipants(String... userIds)
Drops the given participants from the conversation.ConversationParticipantBuilder
dropParticipants(Collection<String> userIds)
Drops the given participants from the conversation.String
getConversationId()
List<String>
getParticipantsToDrop()
List<JoinParticipantsData>
getParticipantsToJoin()
ParticipantJoiningBuilder
joinParticipant(String userId)
Joins a single participant.ParticipantJoiningBuilder
joinParticipants(String... userIds)
Joins one or more participants.ParticipantJoiningBuilder
joinParticipants(Collection<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 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: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
public ParticipantJoiningBuilder joinParticipants(String... userIds)
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
public ParticipantJoiningBuilder joinParticipants(Collection<String> userIds)
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
public ConversationParticipantBuilder dropParticipant(String userId)
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
public ConversationParticipantBuilder dropParticipants(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
-
dropParticipants
public ConversationParticipantBuilder dropParticipants(Collection<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 String getConversationId()
-
getParticipantsToJoin
public List<JoinParticipantsData> getParticipantsToJoin()
-
-