Class PolledTriggerContextImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.PolledTriggerContextImpl
-
- All Implemented Interfaces:
PolledTriggerContext
public class PolledTriggerContextImpl extends Object implements PolledTriggerContext
-
-
Constructor Summary
Constructors Constructor Description PolledTriggerContextImpl(SBuildType bt, BuildTriggerDescriptor trd, Lazy<Date> prevCallTime, long currentTime, ProjectManager projectManager)
-
Method Summary
All Methods Static 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.static CustomDataStorage
getCustomDataStorage(SBuildType bt, BuildTriggerDescriptor trd)
Logger
getLogger()
Returns logger which can be used to log trigger related activity.Date
getPreviousCallTime()
Time of the previous call of the trigger, can be null if this is the first time the trigger is calledBuildTriggerDescriptor
getTriggerDescriptor()
Build trigger settings
-
-
-
Constructor Detail
-
PolledTriggerContextImpl
public PolledTriggerContextImpl(@NotNull SBuildType bt, @NotNull BuildTriggerDescriptor trd, @NotNull Lazy<Date> prevCallTime, long currentTime, ProjectManager projectManager)
-
-
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
-
getTriggerDescriptor
@NotNull public BuildTriggerDescriptor getTriggerDescriptor()
Description copied from interface:PolledTriggerContext
Build trigger settings- Specified by:
getTriggerDescriptor
in interfacePolledTriggerContext
- Returns:
- see above
-
getPreviousCallTime
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
-
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()
)
-
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
-
getCustomDataStorage
@NotNull public static CustomDataStorage getCustomDataStorage(@NotNull SBuildType bt, @NotNull BuildTriggerDescriptor trd)
-
-