Interface MessagesState
-
- All Known Subinterfaces:
BuildLog
,BuildLogEx
,BuildLogWriter
,BuildLogWriterEx
- All Known Implementing Classes:
NoOpBuildLog
,ServerBuildLog
public interface MessagesState
Represents current messages state.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_LAST_MESSAGE_TEXT_SIZE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description BlockLogMessage
closeBlock(String blockName, String blockType, Date timestamp, String flowId)
Deprecated.void
closeBlockAsync(String blockName, String blockType, Date timestamp, String flowId)
Marks an open block message as closed in the build log.BlockLogMessage
closeProgressBlock(Date timestamp, String flowId)
Deprecated.void
closeProgressBlockAsync(Date timestamp, String flowId)
Marks an open progress block message as closed in the build log.void
dropProgressText(String flowId)
Deprecated.useprogressMessageAsync(String, MessageAttrs)
with an empty string as a first argument.default LogMessage
error(String type, String message, Date timestamp, String renderingHint, String flowId)
Deprecated.usemessageAsync(String, Status, MessageAttrs)
or#messageAsync(String, Status, MessageAttrs, Consumer
) LogMessage
error(String type, String message, Date timestamp, String renderingHint, String flowId, Collection<String> tags)
Deprecated.usemessageAsync(String, Status, MessageAttrs)
or#messageAsync(String, Status, MessageAttrs, Consumer
) String
getCurrentProgressText()
BlockLogMessage
getLastBlockMessage(String flowId)
Deprecated.LogMessage
getLastMessage()
Returns last message.default LogMessage
message(String text, Status status, Date timestamp, String renderingHint, String flowId)
Deprecated.usemessageAsync(String, Status, MessageAttrs)
or#messageAsync(String, Status, MessageAttrs, Consumer
) LogMessage
message(String text, Status status, Date timestamp, String renderingHint, String flowId, Collection<String> tags)
Deprecated.usemessageAsync(String, Status, MessageAttrs)
or#messageAsync(String, Status, MessageAttrs, Consumer
) LogMessage
message(String text, Status status, MessageAttrs attrs)
Deprecated.usemessageAsync(String, Status, MessageAttrs)
or#messageAsync(String, Status, MessageAttrs, Consumer
) void
messageAsync(String text, Status status, MessageAttrs attrs)
Logs a message to the build log.void
messageAsync(String text, Status status, MessageAttrs attrs, Consumer<Integer> anchorConsumer)
Logs a message to the build log.default BlockLogMessage
openBlock(String blockName, String blockType, Date timestamp, String renderingHint, String flowId)
Deprecated.useopenBlockAsync(String, String, MessageAttrs)
or#openBlockAsync(String, String, MessageAttrs, Consumer
) BlockLogMessage
openBlock(String blockName, String blockType, Date timestamp, String renderingHint, String flowId, Collection<String> tags)
Deprecated.useopenBlockAsync(String, String, MessageAttrs)
or#openBlockAsync(String, String, MessageAttrs, Consumer
) BlockLogMessage
openBlock(String blockName, String blockType, MessageAttrs attrs)
Deprecated.useopenBlockAsync(String, String, MessageAttrs)
or#openBlockAsync(String, String, MessageAttrs, Consumer
) void
openBlockAsync(String blockName, String blockType, MessageAttrs attrs)
Logs an open block message to the build log.void
openBlockAsync(String blockName, String blockType, MessageAttrs attrs, Consumer<Integer> anchorConsumer)
Logs an open block message to the build log.default BlockLogMessage
openProgressBlock(String blockName, Date timestamp, String flowId)
Deprecated.BlockLogMessage
openProgressBlock(String blockName, Date timestamp, String flowId, Collection<String> tags)
Deprecated.void
openProgressBlockAsync(String blockName, MessageAttrs attrs)
Logs an open progress block message to the build log.default LogMessage
progressMessage(String message, Date timestamp, String flowId)
Deprecated.LogMessage
progressMessage(String message, Date timestamp, String flowId, Collection<String> tags)
Deprecated.void
progressMessageAsync(String message, MessageAttrs attrs)
Logs a progress message to the build log.
-
-
-
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.useopenBlockAsync(String, String, MessageAttrs)
or#openBlockAsync(String, String, MessageAttrs, Consumer
) Opens new block.- Parameters:
blockName
- name of the blockblockType
- type of the blocktimestamp
- timestamprenderingHint
- hint for rendering this blockflowId
- 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.useopenBlockAsync(String, String, MessageAttrs)
or#openBlockAsync(String, String, MessageAttrs, Consumer
) Opens new block.- Parameters:
blockName
- name of the blockblockType
- type of the blocktimestamp
- timestamprenderingHint
- hint for rendering this blockflowId
- block flow identifiertags
- block tags which may be used to pass additional data- Returns:
- block message
-
openBlock
@Deprecated @Nullable BlockLogMessage openBlock(@NotNull String blockName, @NotNull String blockType, @NotNull MessageAttrs attrs)
Deprecated.useopenBlockAsync(String, String, MessageAttrs)
or#openBlockAsync(String, String, MessageAttrs, Consumer
) Opens new block.- Parameters:
blockName
- name of the blockblockType
- type of the blockattrs
- message attributes- 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 blockblockType
- type of the blockattrs
- 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 blockblockType
- type of the blockattrs
- message attributesanchorConsumer
- a consumer that is populated by message id that can later be used to access the message- Since:
- 2022.10
-
closeBlock
@Deprecated @Nullable BlockLogMessage closeBlock(@NotNull String blockName, @NotNull String blockType, @NotNull Date timestamp, @NotNull String flowId)
Deprecated.Closes last opened block with specified name and type and returns it.- Parameters:
blockName
- name of the block to closeblockType
- type of the block to closetimestamp
- finish dateflowId
- block flow identifier
-
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 closeblockType
- type of the block to closetimestamp
- finish dateflowId
- 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.usemessageAsync(String, Status, MessageAttrs)
or#messageAsync(String, Status, MessageAttrs, Consumer
) Adds message and returns it- Parameters:
text
- message textstatus
- message statustimestamp
- timestamprenderingHint
- hint for rendering this messageflowId
- 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.usemessageAsync(String, Status, MessageAttrs)
or#messageAsync(String, Status, MessageAttrs, Consumer
) Adds message and returns it- Parameters:
text
- message textstatus
- message statustimestamp
- timestamprenderingHint
- hint for rendering this messageflowId
- message flow identifiertags
- message tags which may be used to pass additional data- Returns:
- message
-
message
@Deprecated @Nullable LogMessage message(@Nullable String text, @Nullable Status status, @NotNull MessageAttrs attrs)
Deprecated.usemessageAsync(String, Status, MessageAttrs)
or#messageAsync(String, Status, MessageAttrs, Consumer
) Adds message and returns it- Parameters:
text
- message textstatus
- message statusattrs
- message attributes- 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 textstatus
- message statusattrs
- 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 textstatus
- message statusattrs
- message attributesanchorConsumer
- 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.usemessageAsync(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 typemessage
- the error messagetimestamp
- timestamprenderingHint
- rendering hintflowId
- 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.usemessageAsync(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 typemessage
- the error messagetimestamp
- timestamprenderingHint
- rendering hintflowId
- message flow identifiertags
- 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
-
getLastMessage
@Nullable LogMessage getLastMessage()
Returns last message. Same asgetLastBlockMessage(String)
if last message is block message. Will return no more thanMAX_LAST_MESSAGE_TEXT_SIZE
chars of original text- Returns:
- last message
-
openProgressBlock
@Deprecated @Nullable default BlockLogMessage openProgressBlock(@NotNull String blockName, @Nullable Date timestamp, @NotNull String flowId)
Deprecated.
-
openProgressBlock
@Deprecated @Nullable BlockLogMessage openProgressBlock(@NotNull String blockName, @Nullable Date timestamp, @NotNull String flowId, @Nullable Collection<String> tags)
Deprecated.
-
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 nameattrs
- progress block attributes- Since:
- 2023.4
-
closeProgressBlock
@Deprecated @Nullable BlockLogMessage closeProgressBlock(@NotNull Date timestamp, @NotNull String flowId)
Deprecated.Closes last progress block and returns it.- Parameters:
timestamp
- finish dateflowId
- flow id- Returns:
- closed progress block or null
-
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 dateflowId
- block flow identifier- Since:
- 2023.4
-
progressMessage
@Deprecated @Nullable default LogMessage progressMessage(@NotNull String message, @Nullable Date timestamp, @NotNull String flowId)
Deprecated.
-
progressMessage
@Deprecated @Nullable LogMessage progressMessage(@NotNull String message, @Nullable Date timestamp, @NotNull String flowId, @Nullable Collection<String> tags)
Deprecated.
-
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
-
dropProgressText
@Deprecated void dropProgressText(@NotNull String flowId)
Deprecated.useprogressMessageAsync(String, MessageAttrs)
with an empty string as a first argument.Drops current progress text.- Parameters:
flowId
- flow id
-
getCurrentProgressText
@Nullable String getCurrentProgressText()
- Returns:
- current progress text, i.e. text defined via progress messages; returns null if there is no progress text defined
-
-