Class MessageBuilderImpl

    • Field Detail

      • conversationId

        protected String conversationId
      • creatorId

        protected String creatorId
      • senderId

        protected String senderId
      • updaterId

        protected String updaterId
      • recipientId

        protected String recipientId
      • recipientGroupId

        protected String recipientGroupId
      • externalId

        protected String externalId
      • actionInstanceId

        protected String actionInstanceId
      • actionDefinitionId

        protected String actionDefinitionId
      • actionDefinitionKey

        protected String actionDefinitionKey
      • mainContent

        protected String mainContent
      • templateMessageKey

        protected String templateMessageKey
      • templateMessageCode

        protected String templateMessageCode
      • templateLanguage

        protected String templateLanguage
      • mainContentType

        protected String mainContentType
      • subType

        protected String subType
      • stickyMessage

        protected boolean stickyMessage
      • scopeId

        protected String scopeId
      • scopeType

        protected String scopeType
      • replyToMessageId

        protected String replyToMessageId
    • Constructor Detail

      • MessageBuilderImpl

        public MessageBuilderImpl​(CommandExecutor commandExecutor)
    • Method Detail

      • actionDefinitionId

        public MessageBuilder actionDefinitionId​(String actionDefinitionId)
        Description copied from interface: MessageBuilder
        Optionally reference an action definition given by its id. The message will then reference that action definition by creating an action instance based on it within the send method. You might want to set an explicit scope for the action instance too using MessageBuilder.scope(String, String), if not set, the conversation is automatically used as the scope for the action instance.
        Specified by:
        actionDefinitionId in interface MessageBuilder
        Parameters:
        actionDefinitionId - the id of the action definition to create an action instance for, which is then referenced by this message
        Returns:
        the message builder for method chaining
      • actionDefinitionKey

        public MessageBuilder actionDefinitionKey​(String actionDefinitionKey)
        Description copied from interface: MessageBuilder
        Optionally reference an action definition given by its key. The message will then reference that action definition by creating an action instance based on it within the send method. You might want to set an explicit scope for the action instance too using MessageBuilder.scope(String, String), if not set, the conversation is automatically used as the scope for the action instance.
        Specified by:
        actionDefinitionKey in interface MessageBuilder
        Parameters:
        actionDefinitionKey - the key of the action definition to create an action instance for, which is then referenced by this message
        Returns:
        the message builder for method chaining
      • mainContentTemplate

        public MessageBuilder mainContentTemplate​(String messageCode,
                                                  String language,
                                                  Map<String,​Object> payload)
        Description copied from interface: MessageBuilder
        Adds content being rendered from the specified template (uses "standardMessage" as the template key and the provided message code and optional language as the variation). If the template has placeholders, then the payload needs to be provided as well in order to let the template engine render it.
        Specified by:
        mainContentTemplate in interface MessageBuilder
        Parameters:
        messageCode - the message code to be used for the variation of the template
        language - the language or null to use the default one
        payload - the optional payload containing the values for the placeholder of the template, if needed
        Returns:
        the message builder for method chaining
      • mainContentTemplate

        public MessageBuilder mainContentTemplate​(String templateKey,
                                                  String messageCode,
                                                  String language,
                                                  Map<String,​Object> payload)
        Description copied from interface: MessageBuilder
        Adds content being rendered from the specified template (uses "standardMessage" as the template key and the provided message code and optional language as the variation). If the template has placeholders, then the payload needs to be provided as well in order to let the template engine render it.
        Specified by:
        mainContentTemplate in interface MessageBuilder
        Parameters:
        templateKey - the key of the template to be used (will be "standardMessage", if none provided explicitly)
        messageCode - the message code to be used for the variation of the template
        language - the language or null to use the default one
        payload - the optional payload containing the values for the placeholder of the template, if needed
        Returns:
        the message builder for method chaining
      • privateMessage

        public MessageBuilder privateMessage​(String recipientId)
        Description copied from interface: MessageBuilder
        The message should be a private message for the user with the recipientId.
        Specified by:
        privateMessage in interface MessageBuilder
        Parameters:
        recipientId - the id of the recipient user
      • privateGroupMessage

        public MessageBuilder privateGroupMessage​(String recipientGroupId)
        Description copied from interface: MessageBuilder
        The message should be a private message for the group with the recipientGroupId
        Specified by:
        privateGroupMessage in interface MessageBuilder
        Parameters:
        recipientGroupId - the id of the recipient group
      • scope

        public MessageBuilder scope​(String scopeId,
                                    String scopeType)
        Description copied from interface: MessageBuilder
        Set an explicit scope for a referenced action definition to be passed on to the action instance, if created when posting this message. If not explicitly set, the conversation is used as the scope this message is sent to.
        Specified by:
        scope in interface MessageBuilder
        Parameters:
        scopeId - the id of the scope a referenced action definition should be bound to
        scopeType - the type of the scope for the referenced action definition
        Returns:
        the message builder for method chaining
      • getCategory

        public Category getCategory()
      • setCategory

        public void setCategory​(Category category)
      • getConversationId

        public String getConversationId()
      • getCreatorId

        public String getCreatorId()
      • getSenderId

        public String getSenderId()
      • getUpdaterId

        public String getUpdaterId()
      • getRecipientId

        public String getRecipientId()
      • getRecipientGroupId

        public String getRecipientGroupId()
      • getExternalId

        public String getExternalId()
      • getActionInstanceId

        public String getActionInstanceId()
      • getActionDefinitionId

        public String getActionDefinitionId()
      • getActionDefinitionKey

        public String getActionDefinitionKey()
      • getMainContent

        public String getMainContent()
      • hasContentTemplate

        public boolean hasContentTemplate()
      • getTemplateMessageKey

        public String getTemplateMessageKey()
      • getTemplateMessageCode

        public String getTemplateMessageCode()
      • getTemplateLanguage

        public String getTemplateLanguage()
      • getMainContentType

        public String getMainContentType()
      • getContentStream

        public InputStream getContentStream()
      • getType

        public String getType()
      • getSubType

        public String getSubType()
      • isStickyMessage

        public boolean isStickyMessage()
      • getScopeId

        public String getScopeId()
      • getScopeType

        public String getScopeType()
      • getReplyToMessageId

        public String getReplyToMessageId()
      • send

        public Message send​(String conversationId)
        Description copied from interface: MessageBuilder
        Creates and sends the message to the specified conversation.
        Specified by:
        send in interface MessageBuilder
        Parameters:
        conversationId - the id of the conversation to send the message to
        Returns:
        the created and sent message object