public static class DefaultRolloverStrategy.Builder extends java.lang.Object implements Builder<DefaultRolloverStrategy>
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
compressionLevelStr |
private Configuration |
config |
private Action[] |
customActions |
private java.lang.String |
fileIndex |
private java.lang.String |
max |
private java.lang.String |
min |
private boolean |
stopCustomActionsOnError |
private java.lang.String |
tempCompressedFilePattern |
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
DefaultRolloverStrategy |
build()
Builds the object after all configuration has been set.
|
java.lang.String |
getCompressionLevelStr() |
Configuration |
getConfig() |
Action[] |
getCustomActions() |
java.lang.String |
getFileIndex() |
java.lang.String |
getMax() |
java.lang.String |
getMin() |
java.lang.String |
getTempCompressedFilePattern() |
boolean |
isStopCustomActionsOnError() |
DefaultRolloverStrategy.Builder |
withCompressionLevelStr(java.lang.String compressionLevelStr)
Defines compression level.
|
DefaultRolloverStrategy.Builder |
withConfig(Configuration config)
Defines configuration.
|
DefaultRolloverStrategy.Builder |
withCustomActions(Action[] customActions)
Defines custom actions.
|
DefaultRolloverStrategy.Builder |
withFileIndex(java.lang.String fileIndex)
Defines the file index for rolling strategy.
|
DefaultRolloverStrategy.Builder |
withMax(java.lang.String max)
Defines the maximum number of files to keep.
|
DefaultRolloverStrategy.Builder |
withMin(java.lang.String min)
Defines the minimum number of files to keep.
|
DefaultRolloverStrategy.Builder |
withStopCustomActionsOnError(boolean stopCustomActionsOnError)
Defines whether to stop executing asynchronous actions if an error occurs.
|
DefaultRolloverStrategy.Builder |
withTempCompressedFilePattern(java.lang.String tempCompressedFilePattern)
Defines temporary compression file pattern.
|
@PluginBuilderAttribute(value="max") private java.lang.String max
@PluginBuilderAttribute(value="min") private java.lang.String min
@PluginBuilderAttribute(value="fileIndex") private java.lang.String fileIndex
@PluginBuilderAttribute(value="compressionLevel") private java.lang.String compressionLevelStr
@PluginElement(value="Actions") private Action[] customActions
@PluginBuilderAttribute(value="stopCustomActionsOnError") private boolean stopCustomActionsOnError
@PluginBuilderAttribute(value="tempCompressedFilePattern") private java.lang.String tempCompressedFilePattern
@PluginConfiguration private Configuration config
public DefaultRolloverStrategy build()
Builder
build
in interface Builder<DefaultRolloverStrategy>
public java.lang.String getMax()
public DefaultRolloverStrategy.Builder withMax(java.lang.String max)
max
- The maximum number of files to keep.public java.lang.String getMin()
public DefaultRolloverStrategy.Builder withMin(java.lang.String min)
min
- The minimum number of files to keep.public java.lang.String getFileIndex()
public DefaultRolloverStrategy.Builder withFileIndex(java.lang.String fileIndex)
fileIndex
- If set to "max" (the default), files with a higher index will be newer than files with a smaller
index. If set to "min", file renaming and the counter will follow the Fixed Window strategy.public java.lang.String getCompressionLevelStr()
public DefaultRolloverStrategy.Builder withCompressionLevelStr(java.lang.String compressionLevelStr)
compressionLevelStr
- The compression level, 0 (less) through 9 (more); applies only to ZIP files.public Action[] getCustomActions()
public DefaultRolloverStrategy.Builder withCustomActions(Action[] customActions)
customActions
- custom actions to perform asynchronously after rolloverpublic boolean isStopCustomActionsOnError()
public DefaultRolloverStrategy.Builder withStopCustomActionsOnError(boolean stopCustomActionsOnError)
stopCustomActionsOnError
- whether to stop executing asynchronous actions if an error occurspublic java.lang.String getTempCompressedFilePattern()
public DefaultRolloverStrategy.Builder withTempCompressedFilePattern(java.lang.String tempCompressedFilePattern)
tempCompressedFilePattern
- File pattern of the working file pattern used during compression, if null no temporary file are usedpublic Configuration getConfig()
public DefaultRolloverStrategy.Builder withConfig(Configuration config)
config
- The Configuration.