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 BuildCustomizercreateBuildCustomizer(SUser user)Creates aBuildCustomizerinstance that should be used to trigger a build: the returned customizer is preconfigured with custom parameters specified in the trigger settings.SBuildTypegetBuildType()Build configuration for which the trigger is calledlonggetCurrentTime()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.CustomDataStoragegetCustomDataStorage()Returns custom data storage associated with build configuration and trigger descriptor.static CustomDataStoragegetCustomDataStorage(SBuildType bt, BuildTriggerDescriptor trd)LoggergetLogger()Returns logger which can be used to log trigger related activity.DategetPreviousCallTime()Time of the previous call of the trigger, can be null if this is the first time the trigger is calledBuildTriggerDescriptorgetTriggerDescriptor()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:PolledTriggerContextBuild configuration for which the trigger is called- Specified by:
getBuildTypein interfacePolledTriggerContext- Returns:
- see above
-
getTriggerDescriptor
@NotNull public BuildTriggerDescriptor getTriggerDescriptor()
Description copied from interface:PolledTriggerContextBuild trigger settings- Specified by:
getTriggerDescriptorin interfacePolledTriggerContext- Returns:
- see above
-
getPreviousCallTime
public Date getPreviousCallTime()
Description copied from interface:PolledTriggerContextTime of the previous call of the trigger, can be null if this is the first time the trigger is called- Specified by:
getPreviousCallTimein interfacePolledTriggerContext- Returns:
- see above
-
getCurrentTime
public long getCurrentTime()
Description copied from interface:PolledTriggerContextsince 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:
getCurrentTimein interfacePolledTriggerContext- Returns:
- current time in milliseconds for this trigger processing (like
System.currentTimeMillis())
-
getCustomDataStorage
@NotNull public CustomDataStorage getCustomDataStorage()
Description copied from interface:PolledTriggerContextReturns 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:
getCustomDataStoragein interfacePolledTriggerContext- Returns:
- custom data storage for the pair: build configuration and trigger descriptor
-
createBuildCustomizer
@NotNull public BuildCustomizer createBuildCustomizer(SUser user)
Description copied from interface:PolledTriggerContextCreates aBuildCustomizerinstance that should be used to trigger a build: the returned customizer is preconfigured with custom parameters specified in the trigger settings.- Specified by:
createBuildCustomizerin interfacePolledTriggerContext- Parameters:
user- optional user, will beBuildCustomizerFactory.createBuildCustomizer(SBuildType, SUser)- See Also:
BuildTriggerService.supportsBuildCustomization()
-
getLogger
@NotNull public Logger getLogger()
Description copied from interface:PolledTriggerContextReturns 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:
getLoggerin interfacePolledTriggerContext- Returns:
- see above
-
getCustomDataStorage
@NotNull public static CustomDataStorage getCustomDataStorage(@NotNull SBuildType bt, @NotNull BuildTriggerDescriptor trd)
-
-