Package org.wildfly.security.audit
Class PeriodicRotatingFileAuditEndpoint
- java.lang.Object
- 
- org.wildfly.security.audit.FileAuditEndpoint
- 
- org.wildfly.security.audit.PeriodicRotatingFileAuditEndpoint
 
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- org.wildfly.common.function.ExceptionBiConsumer<EventPriority,String,IOException>,- AuditEndpoint
 
 public class PeriodicRotatingFileAuditEndpoint extends FileAuditEndpoint An audit endpoint which rotates the log at a preset time interval. Depending on set suffix, moves old log records into files tagged by timestamp.Based on PeriodicSizeRotatingFileHandler.- Author:
- Jan Kalina, James R. Perkins, Yeray Borges
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classPeriodicRotatingFileAuditEndpoint.BuilderA builder for periodic rotating file audit endpoints.(package private) static classPeriodicRotatingFileAuditEndpoint.PeriodPossible period values.
 - 
Field SummaryFields Modifier and Type Field Description private DateTimeFormatterformatprivate longnextRolloverprivate StringnextSuffixprivate PeriodicRotatingFileAuditEndpoint.Periodperiodprivate ZoneIdtimeZone- 
Fields inherited from class org.wildfly.security.audit.FileAuditEndpointclock
 
- 
 - 
Constructor SummaryConstructors Constructor Description PeriodicRotatingFileAuditEndpoint(PeriodicRotatingFileAuditEndpoint.Builder builder)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PeriodicRotatingFileAuditEndpoint.Builderbuilder()Obtain a newPeriodicRotatingFileAuditEndpoint.Buildercapable of building aPeriodicRotatingFileAuditEndpoint.private voidcalcNextRollover(long fromTime)For given time and period obtains time when should be new log file startedprivate static <T extends Comparable<? super T>>
 Tmin(T a, T b)protected voidpreWrite(Instant instant)Checks whether time-based log rotation should be done and if so, it moves current log file into time-tagged file and exchange target file to continue logging into new, non-time-tagged file.- 
Methods inherited from class org.wildfly.security.audit.FileAuditEndpointaccept, close, closeStreams, getFile, setFile, write
 
- 
 
- 
- 
- 
Field Detail- 
formatprivate final DateTimeFormatter format 
 - 
periodprivate final PeriodicRotatingFileAuditEndpoint.Period period 
 - 
timeZoneprivate final ZoneId timeZone 
 - 
nextRolloverprivate long nextRollover 
 - 
nextSuffixprivate String nextSuffix 
 
- 
 - 
Constructor Detail- 
PeriodicRotatingFileAuditEndpointPeriodicRotatingFileAuditEndpoint(PeriodicRotatingFileAuditEndpoint.Builder builder) throws IOException - Throws:
- IOException
 
 
- 
 - 
Method Detail- 
preWriteprotected void preWrite(Instant instant) Checks whether time-based log rotation should be done and if so, it moves current log file into time-tagged file and exchange target file to continue logging into new, non-time-tagged file.- Overrides:
- preWritein class- FileAuditEndpoint
- Parameters:
- instant- time of the message acceptance
 
 - 
calcNextRolloverprivate void calcNextRollover(long fromTime) For given time and period obtains time when should be new log file started
 - 
builderpublic static PeriodicRotatingFileAuditEndpoint.Builder builder() Obtain a newPeriodicRotatingFileAuditEndpoint.Buildercapable of building aPeriodicRotatingFileAuditEndpoint.- Returns:
- a new PeriodicRotatingFileAuditEndpoint.Buildercapable of building aPeriodicRotatingFileAuditEndpoint.
 
 - 
minprivate static <T extends Comparable<? super T>> T min(T a, T b) 
 
- 
 
-