Class AppData

  • All Implemented Interfaces:
    AutoCloseable

    public class AppData
    extends Object
    implements AutoCloseable
    An instance of AppData is the root of an application file system. Usually, an application will only have one instance of AppData. It is the first entrypoint of AFS, through which you can access to individual AppFileSystem objects.
       //Get AppData instance.
       AppData appData = ...
    
       //Print file system names to console
       appData.getFileSystems().stream().map(AppFileSystem::getName).forEach(System.out::println);
    
       //Get file system with name "fs1"
       AppFileSystem fs1 = appData.getFileSystem("fs1");
    
       //Get root folder of "fs1"
       Folder root = fs1.getRootFolder();
    
       //Get the node of type Project at /folder1/folder2/my_project, if it exists.
       Optional<Project> project = root.getChild(Project.class, "folder1", "folder2", "my_project");
    
       ...
    
     
    Author:
    Geoffroy Jamgotchian
    • Constructor Detail

      • AppData

        public AppData​(com.powsybl.computation.ComputationManager shortTimeExecutionComputationManager,
                       com.powsybl.computation.ComputationManager longTimeExecutionComputationManager)
      • AppData

        public AppData​(com.powsybl.computation.ComputationManager shortTimeExecutionComputationManager,
                       com.powsybl.computation.ComputationManager longTimeExecutionComputationManager,
                       EventsBus eventsBus)
      • AppData

        public AppData​(com.powsybl.computation.ComputationManager shortTimeExecutionComputationManager,
                       com.powsybl.computation.ComputationManager longTimeExecutionComputationManager,
                       List<AppFileSystemProvider> fileSystemProviders)
      • AppData

        public AppData​(com.powsybl.computation.ComputationManager shortTimeExecutionComputationManager,
                       com.powsybl.computation.ComputationManager longTimeExecutionComputationManager,
                       List<AppFileSystemProvider> fileSystemProviders,
                       EventsBus eventsBus)
    • Method Detail

      • addFileSystem

        public void addFileSystem​(AppFileSystem fileSystem)
      • getFileSystem

        public AppFileSystem getFileSystem​(String name)
        Gets a file system by its name.
      • getShortTimeExecutionComputationManager

        public com.powsybl.computation.ComputationManager getShortTimeExecutionComputationManager()
      • getLongTimeExecutionComputationManager

        public com.powsybl.computation.ComputationManager getLongTimeExecutionComputationManager()
      • getRemotelyAccessibleFileSystemNames

        public List<String> getRemotelyAccessibleFileSystemNames()
        Gets the list of remotely accessible file systems. Should not be used by the AFS API users.
      • getRemotelyAccessibleStorage

        public AppStorage getRemotelyAccessibleStorage​(String fileSystemName)
        Gets low level storage interface for remotely accessible file systems. Should not be used by the AFS API users.
      • findService

        public <U> U findService​(Class<U> serviceClass,
                                 boolean remoteStorage)
        Gets a registered service of type U. To register a service, see ServiceExtension.
        Parameters:
        serviceClass - the requested service type
        remoteStorage - if true, tries to get a remote implementation first.
        Throws:
        AfsException - if no service implementation is found.
      • getEventsBus

        public EventsBus getEventsBus()
        get the appData event Store instance.
      • close

        public void close()
        Closes any resources used by underlying file systems.
        Specified by:
        close in interface AutoCloseable