Class VcsTriggerContext
- java.lang.Object
-
- jetbrains.buildServer.buildTriggers.vcs.VcsTriggerContext
-
- All Implemented Interfaces:
PolledTriggerContext
public class VcsTriggerContext extends Object implements PolledTriggerContext
-
-
Constructor Summary
Constructors Constructor Description VcsTriggerContext(PolledTriggerContext delegate, jetbrains.buildServer.buildTriggers.vcs.RepositoryStateUpdateListener repoStateUpdateListener, int defaultQuietPeriod, VcsTriggeringContext triggeringContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BuildCustomizer
createBuildCustomizer(SUser user)
Creates aBuildCustomizer
instance that should be used to trigger a build: the returned customizer is preconfigured with custom parameters specified in the trigger settings.SBuildType
getBuildType()
Build configuration for which the trigger is calledlong
getCurrentTime()
since processing trigger may take some time, trigger implementations shouldn't useSystem.currentTimeMillis()
for time Otherwise unnecessary triggering may occur if trigger depends on time.CustomDataStorage
getCustomDataStorage()
Returns custom data storage associated with build configuration and trigger descriptor.Logger
getLogger()
Returns logger which can be used to log trigger related activity.Logger
getLogger(Branch branch)
Date
getPreviousCallTime()
Time of the previous call of the trigger, can be null if this is the first time the trigger is calledSet<VcsRootInstance>
getRootsInChain()
BuildTriggerDescriptor
getTriggerDescriptor()
Build trigger settingsTriggerRules
getTriggerRules()
VcsTriggerDescriptor
getVcsTriggerDescriptor()
boolean
isRepositoryStateUpdated()
List<SBuildType>
watchedBuildTypes()
-
-
-
Constructor Detail
-
VcsTriggerContext
public VcsTriggerContext(@NotNull PolledTriggerContext delegate, @NotNull jetbrains.buildServer.buildTriggers.vcs.RepositoryStateUpdateListener repoStateUpdateListener, int defaultQuietPeriod, @NotNull VcsTriggeringContext triggeringContext)
-
-
Method Detail
-
getBuildType
@NotNull public SBuildType getBuildType()
Description copied from interface:PolledTriggerContext
Build configuration for which the trigger is called- Specified by:
getBuildType
in interfacePolledTriggerContext
- Returns:
- see above
-
getCurrentTime
public long getCurrentTime()
Description copied from interface:PolledTriggerContext
since processing trigger may take some time, trigger implementations shouldn't useSystem.currentTimeMillis()
for time Otherwise unnecessary triggering may occur if trigger depends on time. Instead ofSystem.currentTimeMillis()
use this method- Specified by:
getCurrentTime
in interfacePolledTriggerContext
- Returns:
- current time in milliseconds for this trigger processing (like
System.currentTimeMillis()
)
-
getTriggerDescriptor
@NotNull public BuildTriggerDescriptor getTriggerDescriptor()
Description copied from interface:PolledTriggerContext
Build trigger settings- Specified by:
getTriggerDescriptor
in interfacePolledTriggerContext
- Returns:
- see above
-
getPreviousCallTime
@Nullable public Date getPreviousCallTime()
Description copied from interface:PolledTriggerContext
Time of the previous call of the trigger, can be null if this is the first time the trigger is called- Specified by:
getPreviousCallTime
in interfacePolledTriggerContext
- Returns:
- see above
-
getCustomDataStorage
@NotNull public CustomDataStorage getCustomDataStorage()
Description copied from interface:PolledTriggerContext
Returns custom data storage associated with build configuration and trigger descriptor. This storage can be used for remembering the per build type state of the build trigger.- Specified by:
getCustomDataStorage
in interfacePolledTriggerContext
- Returns:
- custom data storage for the pair: build configuration and trigger descriptor
-
createBuildCustomizer
@NotNull public BuildCustomizer createBuildCustomizer(SUser user)
Description copied from interface:PolledTriggerContext
Creates aBuildCustomizer
instance that should be used to trigger a build: the returned customizer is preconfigured with custom parameters specified in the trigger settings.- Specified by:
createBuildCustomizer
in interfacePolledTriggerContext
- Parameters:
user
- optional user, will beBuildCustomizerFactory.createBuildCustomizer(SBuildType, SUser)
- See Also:
BuildTriggerService.supportsBuildCustomization()
-
getLogger
@NotNull public Logger getLogger()
Description copied from interface:PolledTriggerContext
Returns logger which can be used to log trigger related activity. Note the provided logger will automatically prepend all messages with id of the build configuration where the trigger belongs.- Specified by:
getLogger
in interfacePolledTriggerContext
- Returns:
- see above
-
getVcsTriggerDescriptor
@NotNull public VcsTriggerDescriptor getVcsTriggerDescriptor()
-
isRepositoryStateUpdated
public boolean isRepositoryStateUpdated()
-
watchedBuildTypes
@NotNull public List<SBuildType> watchedBuildTypes()
- Returns:
- buildTypes watched by the trigger. Result includes the buildType where the trigger is defined. If the 'trigger on changes from dependencies' option is enabled, result also includes all dependencies.
-
getTriggerRules
@NotNull public TriggerRules getTriggerRules()
-
getRootsInChain
@NotNull public Set<VcsRootInstance> getRootsInChain()
-
-