Class StorageLogFactory

    • Method Detail

      • getInstance

        public static StorageLog getInstance​(java.util.List<java.lang.Integer> tenants,
                                             java.nio.file.Path basePath)
                                      throws java.io.IOException
        get Thread-Safe instance instance.
        Returns:
        the instance.
        Throws:
        java.io.IOException
      • getInstanceForTest

        public static StorageLog getInstanceForTest​(java.util.List<java.lang.Integer> tenants,
                                                    java.nio.file.Path basePath)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • 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 interface StorageLog
        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 interface StorageLog
        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 interface StorageLog
        Parameters:
        tenant - tenant used for the rotation
        Throws:
        java.io.IOException
      • initializeStorageLogs

        public void initializeStorageLogs()
                                   throws java.io.IOException
        Specified by:
        initializeStorageLogs in interface StorageLog
        Throws:
        java.io.IOException
      • getFileName

        public java.lang.String getFileName​(boolean isWriteOperation)
        Specified by:
        getFileName in interface StorageLog
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface VitamAutoCloseable