- All Implemented Interfaces:
public abstract class FingerprintTransparency extends Object implements AutoCloseableAlgorithm transparency API that can capture all intermediate data structures produced by SourceAFIS algorithm. See algorithm transparency pages on SourceAFIS website for more information and a tutorial on how to use this class. Applications can subclass
log(String, Map)method to define new transparency data logger. One default implementation of
FingerprintTransparencyis returned by
zip(OutputStream)method. An instance of
FingerprintTransparencymust be passed to
FingerprintMatcher.transparency(FingerprintTransparency)for transparency data to be actually collected. This class implements
AutoCloseableand callers must ensure that
close()is called, perhaps by using try-with-resources construct, unless the particular subclass is known to not need any cleanup.
Constructors Modifier Constructor and Description
FingerprintTransparency()Creates an instance of
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description
close()Release system resources held by this instance if any.
protected abstract void
log(String keyword, Map<String,Supplier<ByteBuffer>> data)Record transparency data.
zip(OutputStream stream)Write all transparency data to a ZIP file.
protected FingerprintTransparency()Creates an instance of
FingerprintTransparencyis an abstract class. This empty constructor is only called by subclasses.
protected abstract void log(String keyword, Map<String,Supplier<ByteBuffer>> data)Record transparency data. This is an abstract method that subclasses must override. If algorithm transparency is enabled by passing an instance of
FingerprintMatcher.transparency(FingerprintTransparency), this method is called with transparency data in its parameters. Parameter
keywordspecifies the kind of transparency data being logged, usually corresponding to some stage in the algorithm. For convenience, several related pieces of transparency data are reported together. All pieces are available via map in parameter
data, keyed by file suffix identifying the kind of data, usually
.datfor JSON and binary data respectively. See algorithm transparency on SourceAFIS website for documentation of the structure of the transparency data. Transparency data is offered indirectly via
Supplier. If this
Supplieris not evaluated, the data is never serialized. This allows applications to efficiently collect only transparency data that is actually needed.
public void close()Release system resources held by this instance if any. Subclasses can override this method to perform cleanup. Default implementation of this method is empty.
public static FingerprintTransparency zip(OutputStream stream)Write all transparency data to a ZIP file. This is a convenience method to enable easy exploration of the available data. Programmatic processing of transparency data should be done by subclassing
log(String, Map)method. The returned
FingerprintTransparencyobject holds system resources and callers are responsible for calling
close()method, perhaps using try-with-resources construct. Failure to close the returned
FingerprintTransparencyinstance may result in damaged ZIP file.