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.String
ACCESS_LOG_DIR
static java.lang.String
WRITE_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 void
appendAccessLog(java.lang.Integer tenant, AccessLogParameters parameters)
Add a storage access operation log entry.void
appendWriteLog(java.lang.Integer tenant, StorageLogbookParameters parameters)
Add a storage write operation log entry.void
close()
java.lang.String
getFileName(boolean isWriteOperation)
void
initializeStorageLogs()
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.IOException
Description copied from interface:StorageLog
Add a storage write operation log entry.- Specified by:
appendWriteLog
in interfaceStorageLog
parameters
- 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.IOException
Description copied from interface:StorageLog
Add a storage access operation log entry.- Specified by:
appendAccessLog
in interfaceStorageLog
parameters
- 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:StorageLog
Rotate log file, and return previous log information- Specified by:
rotateLogFile
in interfaceStorageLog
- Parameters:
tenant
- tenant used for the rotation- Throws:
java.io.IOException
-
initializeStorageLogs
public void initializeStorageLogs() throws java.io.IOException
- Specified by:
initializeStorageLogs
in interfaceStorageLog
- Throws:
java.io.IOException
-
getFileName
public java.lang.String getFileName(boolean isWriteOperation)
- Specified by:
getFileName
in interfaceStorageLog
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceVitamAutoCloseable
-
-