Class MetadataFileHandler


  • public class MetadataFileHandler
    extends Object
    This class is used to handle the metadata file of the queue.
    • Constructor Detail

      • MetadataFileHandler

        public MetadataFileHandler​(String filePath)
                            throws PersistentQueueException
        Constructor of the MetadataFileHandler class.
        Parameters:
        filePath - path of the metadata file.
        Throws:
        PersistentQueueException - if an error occurs while creating the metadata file.
    • Method Detail

      • getAsJsonArray

        public Optional<com.google.gson.JsonArray> getAsJsonArray​(String key)
        Returns the value of the given key.
        Parameters:
        key - key of the value.
        Returns:
        value of the given key.
      • addJsonArray

        public void addJsonArray​(String key,
                                 com.google.gson.JsonArray value)
                          throws PersistentQueueException
        Adds an array to the metadata file.
        Parameters:
        key - key of the array.
        value - array to be added to metadata file.
        Throws:
        PersistentQueueException - if an error occurs while adding the array to the metadata file.
      • isInitialized

        public boolean isInitialized()
        Returns if the metadata file is initialized.
        Returns:
        boolean if the metadata file is initialized.
      • setIsInitialized

        public void setIsInitialized​(boolean isInitialized)
        Sets if the metadata file is initialized.
        Parameters:
        isInitialized - boolean if the metadata file is initialized.