public class ParameterExpander extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PARAMETERS_COUNT
How many default parameters there are (plus one) to initialize the size of the parameters-map.
|
static String |
MESSAGE_DELIMITER
The delimiter used to separate build URLs from their messages.
|
Constructor and Description |
---|
ParameterExpander(IGerritHudsonTriggerConfig config)
Constructor.
|
ParameterExpander(IGerritHudsonTriggerConfig config,
jenkins.model.Jenkins jenkins)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected String |
findMessage(String completedCommand)
Finds the --message part of the command.
|
String |
getBuildCompletedCommand(BuildMemory.MemoryImprint memoryImprint,
hudson.model.TaskListener listener)
Gets the "expanded" build completed command to send to gerrit.
|
String |
getBuildCompletedMessage(BuildMemory.MemoryImprint memoryImprint,
hudson.model.TaskListener listener)
Returns cover message to be send after build has been completed.
|
String |
getBuildStartedCommand(hudson.model.Run r,
hudson.model.TaskListener taskListener,
com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event,
BuildsStartedStats stats)
Gets the expanded string to send to Gerrit for a build-started event.
|
String |
getBuildStartedMessage(hudson.model.Run build,
hudson.model.TaskListener listener,
com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event,
BuildsStartedStats stats)
Returns cover message to be send after build has been started.
|
protected Integer |
getCodeReviewValue(hudson.model.Result res,
GerritTrigger trigger)
Finds the code review value for the specified build result on the configured trigger.
|
com.sonymobile.tools.gerrit.gerritevents.dto.rest.Notify |
getHighestNotificationLevel(BuildMemory.MemoryImprint memoryImprint,
boolean onlyBuilt)
Returns the highest configured notification level.
|
Integer |
getMinimumCodeReviewValue(BuildMemory.MemoryImprint memoryImprint,
boolean onlyBuilt)
Returns the minimum code review value for the build results in the memory.
|
Integer |
getMinimumVerifiedValue(BuildMemory.MemoryImprint memoryImprint,
boolean onlyBuilt)
Returns the minimum verified value for the build results in the memory.
|
com.sonymobile.tools.gerrit.gerritevents.dto.rest.Notify |
getNotificationLevel(GerritTrigger trigger)
Returns the notification level value for the given trigger.
|
protected Integer |
getVerifiedValue(hudson.model.Result res,
GerritTrigger trigger)
Finds the verified value for the specified build result on the configured trigger.
|
public static final int DEFAULT_PARAMETERS_COUNT
public static final String MESSAGE_DELIMITER
public ParameterExpander(IGerritHudsonTriggerConfig config, jenkins.model.Jenkins jenkins)
config
- the global config.jenkins
- the Hudson instance.public ParameterExpander(IGerritHudsonTriggerConfig config)
config
- the global config.public String getBuildStartedCommand(hudson.model.Run r, hudson.model.TaskListener taskListener, com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event, BuildsStartedStats stats)
r
- the build.taskListener
- the taskListener.event
- the event.stats
- the statistics.protected Integer getCodeReviewValue(hudson.model.Result res, GerritTrigger trigger)
res
- the build result.trigger
- the trigger that might have overridden values.protected Integer getVerifiedValue(hudson.model.Result res, GerritTrigger trigger)
res
- the build result.trigger
- the trigger that might have overridden values.@CheckForNull public Integer getMinimumVerifiedValue(BuildMemory.MemoryImprint memoryImprint, boolean onlyBuilt)
memoryImprint
- the memory.onlyBuilt
- only count builds that completed (no NOT_BUILT builds)@CheckForNull public Integer getMinimumCodeReviewValue(BuildMemory.MemoryImprint memoryImprint, boolean onlyBuilt)
memoryImprint
- the memoryonlyBuilt
- only count builds that completed (no NOT_BUILT builds)public com.sonymobile.tools.gerrit.gerritevents.dto.rest.Notify getHighestNotificationLevel(BuildMemory.MemoryImprint memoryImprint, boolean onlyBuilt)
memoryImprint
- the memoryonlyBuilt
- only count builds that completed (no NOT_BUILT builds)public com.sonymobile.tools.gerrit.gerritevents.dto.rest.Notify getNotificationLevel(GerritTrigger trigger)
trigger
- the trigger.public String getBuildCompletedCommand(BuildMemory.MemoryImprint memoryImprint, hudson.model.TaskListener listener)
memoryImprint
- the memory with all the informationlistener
- the taskListenerpublic String getBuildCompletedMessage(BuildMemory.MemoryImprint memoryImprint, hudson.model.TaskListener listener)
memoryImprint
- memorylistener
- listenerpublic String getBuildStartedMessage(hudson.model.Run build, hudson.model.TaskListener listener, com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event, BuildsStartedStats stats)
build
- buildlistener
- listenerevent
- eventstats
- statsCopyright © 2016–2020. All rights reserved.