Package io.gravitee.reporter.file.vertx
Class VertxFileWriter<T extends io.gravitee.reporter.api.Reportable>
- java.lang.Object
-
- io.gravitee.reporter.file.vertx.VertxFileWriter<T>
-
public class VertxFileWriter<T extends io.gravitee.reporter.api.Reportable> extends Object
- Author:
- David BRASSELY (david.brassely at graviteesource.com), GraviteeSource Team
-
-
Constructor Summary
Constructors Constructor Description VertxFileWriter(io.vertx.core.Vertx vertx, MetricsType type, Formatter<T> formatter, String filename, FileReporterConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.vertx.core.Future<Void>initialize()protected booleanshouldDeleteFile(File file, long currentTimeInMs)File should be deleted if its last modification date is older than configured retainDays.io.vertx.core.Future<Void>stop()voidwrite(T data)
-
-
-
Constructor Detail
-
VertxFileWriter
public VertxFileWriter(io.vertx.core.Vertx vertx, MetricsType type, Formatter<T> formatter, String filename, FileReporterConfiguration configuration)
-
-
Method Detail
-
initialize
public io.vertx.core.Future<Void> initialize()
-
write
public void write(T data)
-
stop
public io.vertx.core.Future<Void> stop()
-
shouldDeleteFile
protected boolean shouldDeleteFile(File file, long currentTimeInMs)
File should be deleted if its last modification date is older than configured retainDays.- Parameters:
file- filecurrentTimeInMs- current time in milliseconds- Returns:
- true if file should be deleted, false elsewhere
-
-