Class FileSystemJsonDataStore

  • All Implemented Interfaces:
    DataStore

    public class FileSystemJsonDataStore
    extends java.lang.Object
    implements DataStore
    Stores and loads network instances with certs and schemas on the file system
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete​(java.lang.String identifier)  
      java.lang.Object load​(java.lang.String identifier, java.lang.Class<?> T)
      Loads an object from a JSON file on the file system
      void save​(java.lang.String identifier, java.lang.Object data)
      Saves an instance in data store.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileSystemJsonDataStore

        public FileSystemJsonDataStore()
        Instantiates the data store with the default path
      • FileSystemJsonDataStore

        public FileSystemJsonDataStore​(java.lang.String path)
        Instantiates the data store with a given path
        Parameters:
        path - relative path
    • Method Detail

      • save

        public void save​(java.lang.String identifier,
                         java.lang.Object data)
        Saves an instance in data store.
        Specified by:
        save in interface DataStore
        Parameters:
        identifier - filename
        data - saved data
      • load

        public java.lang.Object load​(java.lang.String identifier,
                                     java.lang.Class<?> T)
                              throws java.lang.Exception
        Loads an object from a JSON file on the file system
        Specified by:
        load in interface DataStore
        Parameters:
        identifier - filename
        T - Object type to deserialize the json into
        Returns:
        the loaded object
        Throws:
        java.lang.Exception
      • delete

        public void delete​(java.lang.String identifier)