Interface ServiceMessageTranslator
-
- All Superinterfaces:
ServerExtension
,TeamCityExtension
public interface ServiceMessageTranslator extends ServerExtension
Translator for specific type of service messages.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getServiceMessageName()
Returns name of the service message supported by this translator.static void
requireAttributes(ServiceMessage serviceMessage, java.lang.String... attributes)
java.util.List<BuildMessage1>
translate(SRunningBuild runningBuild, BuildMessage1 originalMessage, ServiceMessage serviceMessage)
Called to translate service message to a number of usual messages.
-
-
-
Method Detail
-
translate
@NotNull java.util.List<BuildMessage1> translate(@NotNull SRunningBuild runningBuild, @NotNull BuildMessage1 originalMessage, @NotNull ServiceMessage serviceMessage) throws TranslateMessageException
Called to translate service message to a number of usual messages.
Note: no attempts should be made to use the build log from the running build to log some messages
SBuild.getBuildLog()
, instead the translator should return all the messages which should be inserted into the build log instead of the processed service message.- Parameters:
runningBuild
- running buildoriginalMessage
- original message from which service message was createdserviceMessage
- service message- Returns:
- a list of translated messages
- Throws:
TranslateMessageException
- since 2018.2, when there is a error translating the message or the message has an incorrect format
-
getServiceMessageName
@NotNull java.lang.String getServiceMessageName()
Returns name of the service message supported by this translator. Only service messages with such name will be passed to the translator.- Returns:
- see above.
-
requireAttributes
static void requireAttributes(@NotNull ServiceMessage serviceMessage, java.lang.String... attributes) throws TranslateMessageException
- Parameters:
serviceMessage
- service messagesattributes
- list of attributes which must be present in the service message- Throws:
TranslateMessageException
- Since:
- 2019.1
-
-