Class Archiver


  • public class Archiver
    extends Object
    This Archiver archives the files by timestamping them and keeping them in the same directory. At any point of time, the file being written to is a non-timestamped file. Each logger object is associated with an archiver. Archiver also keeps track of the number of files being written to the present key store. once it reaches a limit, a new key store has to be generated.

    Summarizing, This Archiver main functionalities are to timeStamp the file and store it in the same directory and to keep track of the number of files written to the current key store.

    Any other implementation to the archiver can be given, if some other form of archival mechanism is required.

    • Constructor Detail

      • Archiver

        public Archiver()
        Creates new Archiver
    • Method Detail

      • archive

        public void archive​(String fileName,
                            String location)
        This method generates a Date object, formatting according to the "DDMMyyyyHHmmss" format and saves the files in the same directory.

        also does some book keeping operations.

        Parameters:
        fileName - name of the archive file.
        location - location of the archive file.
      • checkCount

        public int checkCount()
        Returns the current count of the archival.
      • incrementCount

        public void incrementCount()
        Increment the current count of the archival.
      • archiveKeyStore

        public void archiveKeyStore​(String logName,
                                    String location)
        Archives the keystore after the specified number of files have been used with this keystore. Archives according to the name of the last archives file in the list of files used with this keystore.
        Parameters:
        logName - Name of the log which is to be archived.
        location - The location of the keystores.