Class StorageLogService
- java.lang.Object
-
- fr.gouv.vitam.storage.engine.server.storagelog.StorageLogService
-
- All Implemented Interfaces:
VitamAutoCloseable,StorageLog,java.lang.AutoCloseable
public class StorageLogService extends java.lang.Object implements StorageLog
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringACCESS_LOG_DIRstatic java.lang.StringWRITE_LOG_DIR
-
Constructor Summary
Constructors Constructor Description StorageLogService(java.util.List<java.lang.Integer> tenants, java.nio.file.Path basePath)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendAccessLog(java.lang.Integer tenant, AccessLogParameters parameters)Add a storage access operation log entry.voidappendWriteLog(java.lang.Integer tenant, StorageLogbookParameters parameters)Add a storage write operation log entry.voidclose()java.lang.StringgetFileName(boolean isWriteOperation)voidinitializeStorageLogs()java.util.List<LogInformation>rotateLogFile(java.lang.Integer tenant, boolean isWriteOperation)Rotate log file, and return previous log information
-
-
-
Field Detail
-
WRITE_LOG_DIR
public static final java.lang.String WRITE_LOG_DIR
- See Also:
- Constant Field Values
-
ACCESS_LOG_DIR
public static final java.lang.String ACCESS_LOG_DIR
- See Also:
- Constant Field Values
-
-
Method Detail
-
appendWriteLog
public void appendWriteLog(java.lang.Integer tenant, StorageLogbookParameters parameters) throws java.io.IOExceptionDescription copied from interface:StorageLogAdd a storage write operation log entry.- Specified by:
appendWriteLogin interfaceStorageLogparameters- the entry parameters- Throws:
java.io.IOException- if an error is encountered
-
appendAccessLog
public void appendAccessLog(java.lang.Integer tenant, AccessLogParameters parameters) throws java.io.IOExceptionDescription copied from interface:StorageLogAdd a storage access operation log entry.- Specified by:
appendAccessLogin interfaceStorageLogparameters- the entry parameters- Throws:
java.io.IOException- if an error is encountered
-
rotateLogFile
public java.util.List<LogInformation> rotateLogFile(java.lang.Integer tenant, boolean isWriteOperation) throws java.io.IOException
Description copied from interface:StorageLogRotate log file, and return previous log information- Specified by:
rotateLogFilein interfaceStorageLog- Parameters:
tenant- tenant used for the rotation- Throws:
java.io.IOException
-
initializeStorageLogs
public void initializeStorageLogs() throws java.io.IOException- Specified by:
initializeStorageLogsin interfaceStorageLog- Throws:
java.io.IOException
-
getFileName
public java.lang.String getFileName(boolean isWriteOperation)
- Specified by:
getFileNamein interfaceStorageLog
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceVitamAutoCloseable
-
-