Class DefaultBuildLoggerManager
- java.lang.Object
-
- com.atlassian.bamboo.build.logger.DefaultBuildLoggerManager
-
- All Implemented Interfaces:
BuildLoggerManager,FlushableBuildLoggerManager,ServerBuildLoggerManager
public class DefaultBuildLoggerManager extends Object implements FlushableBuildLoggerManager, ServerBuildLoggerManager
-
-
Field Summary
Fields Modifier and Type Field Description static longLOG_TRANSMISSION_KEEPALIVE_SECONDS
-
Constructor Summary
Constructors Constructor Description DefaultBuildLoggerManager(@NotNull ExpiryTicker expiryTicker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Future<?>flushAllFileLogs()Flush active file logs to disk.@NotNull FileWritingBuildLoggergetFileWritingLogger(@NotNull LoggerId<? extends Key> loggerId)Returns aBuildLogger.@NotNull BuildLoggergetLogger(@NotNull Key key)Returns aBuildLoggerfor the given plan@NotNull BuildLoggergetLogger(@NotNull ResultKey resultKey)Returns aBuildLoggerfor the given result.<T extends Key>
@NotNull BuildLoggerWithoutLogAccessgetLoggerWithoutLogAccess(@NotNull LoggerId<T> loggerId)Returns aBuildLoggerWithoutLogAccessfor the givenLoggerId@NotNull BuildLoggerWithoutLogAccessgetLoggerWithoutLogAccess(@NotNull Key key)Returns aBuildLoggerWithoutLogAccessfor the given result@NotNull FileWritingBuildLoggergetNonPersistentLogger(@NotNull ResultKey resultKey)Returns aBuildLoggerfor the given result.FileWritingBuildLoggergetPersistentLogger(@NotNull ResultKey resultKey)Returns aBuildLoggerfor the given result.voidremoveBuildLogger(PlanKey planKey)Removes plan logger for given plan key.voidremoveBuildLogger(PlanResultKey buildResultKey)Removes buildLogger for finished build process.voidremoveLogger(@NotNull ResultKey resultKey)Remove a logger if you are finished with it.<T extends Key>
voidremoveLogger(LoggerId<T> loggerId)Remove a logger if you are finished with it.voidtransferLogs(BuildLogger buildLogger, CommonContext commonContext)Transfers log to the final location.
-
-
-
Field Detail
-
LOG_TRANSMISSION_KEEPALIVE_SECONDS
public static final long LOG_TRANSMISSION_KEEPALIVE_SECONDS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultBuildLoggerManager
public DefaultBuildLoggerManager(@NotNull @NotNull ExpiryTicker expiryTicker)
-
-
Method Detail
-
getLogger
@NotNull public @NotNull BuildLogger getLogger(@NotNull @NotNull Key key)
Description copied from interface:BuildLoggerManagerReturns aBuildLoggerfor the given plan- Specified by:
getLoggerin interfaceBuildLoggerManager
-
getLogger
@NotNull public @NotNull BuildLogger getLogger(@NotNull @NotNull ResultKey resultKey)
Description copied from interface:BuildLoggerManagerReturns aBuildLoggerfor the given result. Does not guarantee a persistent logger.- Specified by:
getLoggerin interfaceBuildLoggerManager- Returns:
-
getPersistentLogger
public FileWritingBuildLogger getPersistentLogger(@NotNull @NotNull ResultKey resultKey)
Description copied from interface:ServerBuildLoggerManagerReturns aBuildLoggerfor the given result. Enforces switching logger to persistent if current logger is not persistent. Internal use only.- Specified by:
getPersistentLoggerin interfaceServerBuildLoggerManager
-
getNonPersistentLogger
@NotNull public @NotNull FileWritingBuildLogger getNonPersistentLogger(@NotNull @NotNull ResultKey resultKey)
Description copied from interface:ServerBuildLoggerManagerReturns aBuildLoggerfor the given result. Enforces switching logger to non persistent if current logger is persistent. Internal use only.- Specified by:
getNonPersistentLoggerin interfaceServerBuildLoggerManager
-
getFileWritingLogger
@NotNull public @NotNull FileWritingBuildLogger getFileWritingLogger(@NotNull @NotNull LoggerId<? extends Key> loggerId)
Description copied from interface:ServerBuildLoggerManagerReturns aBuildLogger. Enforces switching persistence on/off if necessary. Internal use only.- Specified by:
getFileWritingLoggerin interfaceServerBuildLoggerManager
-
getLoggerWithoutLogAccess
@NotNull public @NotNull BuildLoggerWithoutLogAccess getLoggerWithoutLogAccess(@NotNull @NotNull Key key)
Description copied from interface:BuildLoggerManagerReturns aBuildLoggerWithoutLogAccessfor the given result- Specified by:
getLoggerWithoutLogAccessin interfaceBuildLoggerManager- Returns:
-
getLoggerWithoutLogAccess
@NotNull public <T extends Key> @NotNull BuildLoggerWithoutLogAccess getLoggerWithoutLogAccess(@NotNull @NotNull LoggerId<T> loggerId)
Description copied from interface:BuildLoggerManagerReturns aBuildLoggerWithoutLogAccessfor the givenLoggerId- Specified by:
getLoggerWithoutLogAccessin interfaceBuildLoggerManager
-
removeBuildLogger
public void removeBuildLogger(PlanKey planKey)
Description copied from interface:BuildLoggerManagerRemoves plan logger for given plan key.- Specified by:
removeBuildLoggerin interfaceBuildLoggerManager
-
removeBuildLogger
public void removeBuildLogger(PlanResultKey buildResultKey)
Description copied from interface:BuildLoggerManagerRemoves buildLogger for finished build process. Removed build logger is not used anymore as build has been finished and build result should be persisted already.- Specified by:
removeBuildLoggerin interfaceBuildLoggerManager
-
removeLogger
public <T extends Key> void removeLogger(LoggerId<T> loggerId)
Description copied from interface:BuildLoggerManagerRemove a logger if you are finished with it.- Specified by:
removeLoggerin interfaceBuildLoggerManager- Parameters:
loggerId- of the logger to remove
-
removeLogger
public void removeLogger(@NotNull @NotNull ResultKey resultKey)Description copied from interface:BuildLoggerManagerRemove a logger if you are finished with it.- Specified by:
removeLoggerin interfaceBuildLoggerManager
-
transferLogs
public void transferLogs(BuildLogger buildLogger, CommonContext commonContext)
Description copied from interface:BuildLoggerManagerTransfers log to the final location. Called when the build/deployment is finished.- Specified by:
transferLogsin interfaceBuildLoggerManager
-
flushAllFileLogs
@NotNull public @NotNull Future<?> flushAllFileLogs()
Description copied from interface:FlushableBuildLoggerManagerFlush active file logs to disk.- Specified by:
flushAllFileLogsin interfaceFlushableBuildLoggerManager- Returns:
- future that is done when all the processing is finished.
-
-