Interface MessagesState

    • Field Detail

      • MAX_LAST_MESSAGE_TEXT_SIZE

        static final int MAX_LAST_MESSAGE_TEXT_SIZE
        See Also:
        Constant Field Values
    • Method Detail

      • openBlock

        @Deprecated
        @Nullable
        default BlockLogMessage openBlock​(@NotNull
                                          String blockName,
                                          @NotNull
                                          String blockType,
                                          @Nullable
                                          Date timestamp,
                                          @Nullable
                                          String renderingHint,
                                          @Nullable
                                          String flowId)
        Deprecated.
        use openBlockAsync(String, String, MessageAttrs) or #openBlockAsync(String, String, MessageAttrs, Consumer)
        Opens new block.
        Parameters:
        blockName - name of the block
        blockType - type of the block
        timestamp - timestamp
        renderingHint - hint for rendering this block
        flowId - block flow identifier
        Returns:
        block message
      • openBlock

        @Deprecated
        @Nullable
        BlockLogMessage openBlock​(@NotNull
                                  String blockName,
                                  @NotNull
                                  String blockType,
                                  @Nullable
                                  Date timestamp,
                                  @Nullable
                                  String renderingHint,
                                  @Nullable
                                  String flowId,
                                  @Nullable
                                  Collection<String> tags)
        Deprecated.
        use openBlockAsync(String, String, MessageAttrs) or #openBlockAsync(String, String, MessageAttrs, Consumer)
        Opens new block.
        Parameters:
        blockName - name of the block
        blockType - type of the block
        timestamp - timestamp
        renderingHint - hint for rendering this block
        flowId - block flow identifier
        tags - block tags which may be used to pass additional data
        Returns:
        block message
      • openBlockAsync

        void openBlockAsync​(@NotNull
                            String blockName,
                            @NotNull
                            String blockType,
                            @NotNull
                            MessageAttrs attrs)
        Logs an open block message to the build log. The method does not write to the build log immediately, instead it puts the message into a buffer which will be flushed later.
        Parameters:
        blockName - name of the block
        blockType - type of the block
        attrs - message attributes
        Since:
        2022.10
      • openBlockAsync

        void openBlockAsync​(@NotNull
                            String blockName,
                            @NotNull
                            String blockType,
                            @NotNull
                            MessageAttrs attrs,
                            @NotNull
                            Consumer<Integer> anchorConsumer)
        Logs an open block message to the build log. The method does not write to the build log immediately, instead it puts the message into a buffer which will be flushed later.
        Parameters:
        blockName - name of the block
        blockType - type of the block
        attrs - message attributes
        anchorConsumer - a consumer that is populated by message id that can later be used to access the message
        Since:
        2022.10
      • closeBlockAsync

        void closeBlockAsync​(@NotNull
                             String blockName,
                             @NotNull
                             String blockType,
                             @NotNull
                             Date timestamp,
                             @NotNull
                             String flowId)
        Marks an open block message as closed in the build log. The method does not write to the build log immediately, instead it puts the message into a buffer which will be flushed later.
        Parameters:
        blockName - name of the block to close
        blockType - type of the block to close
        timestamp - finish date
        flowId - block flow identifier
        Since:
        2023.4
      • message

        @Deprecated
        @Nullable
        default LogMessage message​(@Nullable
                                   String text,
                                   @Nullable
                                   Status status,
                                   @Nullable
                                   Date timestamp,
                                   @Nullable
                                   String renderingHint,
                                   @Nullable
                                   String flowId)
        Deprecated.
        use messageAsync(String, Status, MessageAttrs) or #messageAsync(String, Status, MessageAttrs, Consumer)
        Adds message and returns it
        Parameters:
        text - message text
        status - message status
        timestamp - timestamp
        renderingHint - hint for rendering this message
        flowId - message flow identifier
        Returns:
        message
      • message

        @Deprecated
        @Nullable
        LogMessage message​(@Nullable
                           String text,
                           @Nullable
                           Status status,
                           @Nullable
                           Date timestamp,
                           @Nullable
                           String renderingHint,
                           @Nullable
                           String flowId,
                           @Nullable
                           Collection<String> tags)
        Deprecated.
        use messageAsync(String, Status, MessageAttrs) or #messageAsync(String, Status, MessageAttrs, Consumer)
        Adds message and returns it
        Parameters:
        text - message text
        status - message status
        timestamp - timestamp
        renderingHint - hint for rendering this message
        flowId - message flow identifier
        tags - message tags which may be used to pass additional data
        Returns:
        message
      • messageAsync

        void messageAsync​(@Nullable
                          String text,
                          @Nullable
                          Status status,
                          @NotNull
                          MessageAttrs attrs)
        Logs a message to the build log. The method does not write to the build log immediately, instead it puts the message into a buffer which will be flushed later.
        Parameters:
        text - message text
        status - message status
        attrs - message attributes
        Since:
        2022.10
      • messageAsync

        void messageAsync​(@Nullable
                          String text,
                          @Nullable
                          Status status,
                          @NotNull
                          MessageAttrs attrs,
                          @NotNull
                          Consumer<Integer> anchorConsumer)
        Logs a message to the build log. The method does not write to the build log immediately, instead it puts the message into a buffer which will be flushed later.
        Parameters:
        text - message text
        status - message status
        attrs - message attributes
        anchorConsumer - a consumer that is populated by message id that can later be used to access the message
        Since:
        2022.10
      • error

        @Deprecated
        @Nullable
        default LogMessage error​(@Nullable
                                 String type,
                                 @Nullable
                                 String message,
                                 @Nullable
                                 Date timestamp,
                                 @Nullable
                                 String renderingHint,
                                 @Nullable
                                 String flowId)
        Deprecated.
        use messageAsync(String, Status, MessageAttrs) or #messageAsync(String, Status, MessageAttrs, Consumer)
        Creates and returns a new log message, which reports about an error.
        Parameters:
        type - the error type
        message - the error message
        timestamp - timestamp
        renderingHint - rendering hint
        flowId - message flow identifier
        Returns:
        corresponding log message
      • error

        @Deprecated
        @Nullable
        LogMessage error​(@Nullable
                         String type,
                         @Nullable
                         String message,
                         @Nullable
                         Date timestamp,
                         @Nullable
                         String renderingHint,
                         @Nullable
                         String flowId,
                         @Nullable
                         Collection<String> tags)
        Deprecated.
        use messageAsync(String, Status, MessageAttrs) or #messageAsync(String, Status, MessageAttrs, Consumer)
        Creates and returns a new log message, which reports about an error.
        Parameters:
        type - the error type
        message - the error message
        timestamp - timestamp
        renderingHint - rendering hint
        flowId - message flow identifier
        tags - message tags which may be used to pass additional data
        Returns:
        corresponding log message
      • getLastBlockMessage

        @Deprecated
        @Nullable
        BlockLogMessage getLastBlockMessage​(@NotNull
                                            String flowId)
        Deprecated.
        Returns last block message inside specified flow
        Parameters:
        flowId - flow id
        Returns:
        last opened block or null if no such flow or no blocks are open
      • openProgressBlockAsync

        void openProgressBlockAsync​(@NotNull
                                    String blockName,
                                    @NotNull
                                    MessageAttrs attrs)
        Logs an open progress block message to the build log. The method does not write to the build log immediately, instead it puts the message into a buffer which will be flushed later.
        Parameters:
        blockName - progress block name
        attrs - progress block attributes
        Since:
        2023.4
      • closeProgressBlockAsync

        void closeProgressBlockAsync​(@NotNull
                                     Date timestamp,
                                     @NotNull
                                     String flowId)
        Marks an open progress block message as closed in the build log. The method does not write to the build log immediately, instead it puts the message into a buffer which will be flushed later.
        Parameters:
        timestamp - finish date
        flowId - block flow identifier
        Since:
        2023.4
      • progressMessageAsync

        void progressMessageAsync​(@NotNull
                                  String message,
                                  @NotNull
                                  MessageAttrs attrs)
        Logs a progress message to the build log. The method does not write to the build log immediately, instead it puts the message into a buffer which will be flushed later.
        Parameters:
        message - progress message text (empty parameter will be perceived as "drop progress text command" - current progress text for specified flow will be cleared)
        attrs - progress message attributes
        Since:
        2023.4
      • getCurrentProgressText

        @Nullable
        String getCurrentProgressText()
        Returns:
        current progress text, i.e. text defined via progress messages; returns null if there is no progress text defined