Class ForwardingAppStorage

  • All Implemented Interfaces:
    AppStorage, AutoCloseable

    public class ForwardingAppStorage
    extends Object
    implements AppStorage
    A storage implementation which simply delegates calls to another underlying AppStorage implementation.
    Author:
    Geoffroy Jamgotchian
    • Constructor Detail

      • ForwardingAppStorage

        public ForwardingAppStorage​(AppStorage storage)
    • Method Detail

      • setMetadata

        public void setMetadata​(String nodeId,
                                NodeGenericMetadata genericMetadata)
        Description copied from interface: AppStorage
        Update a node metadata
        Specified by:
        setMetadata in interface AppStorage
        Parameters:
        nodeId - id of the node
        genericMetadata - new metadata that will override previous ones
      • setConsistent

        public void setConsistent​(String nodeId)
        Description copied from interface: AppStorage
        mark the node with ID nodeId as consistent node.
        Specified by:
        setConsistent in interface AppStorage
      • isConsistent

        public boolean isConsistent​(String nodeId)
        Description copied from interface: AppStorage
        Return true if the node with ID nodeId is consistent, otherwise it returns false .
        Specified by:
        isConsistent in interface AppStorage
      • getChildNode

        public Optional<NodeInfo> getChildNode​(String nodeId,
                                               String name)
        Description copied from interface: AppStorage
        Gets NodeInfo for child node with name name of the node with ID nodeId, empty if such a node does not exist or node is inconsistent.
        Specified by:
        getChildNode in interface AppStorage
      • getParentNode

        public Optional<NodeInfo> getParentNode​(String nodeId)
        Description copied from interface: AppStorage
        Gets NodeInfo for parent node of the node with ID nodeId, empty if such a node does not exist or inconsistent.
        Specified by:
        getParentNode in interface AppStorage
      • setParentNode

        public void setParentNode​(String nodeId,
                                  String newParentNodeId)
        Description copied from interface: AppStorage
        Sets new parent node for the node with ID nodeId.
        Specified by:
        setParentNode in interface AppStorage
      • readBinaryData

        public Optional<InputStream> readBinaryData​(String nodeId,
                                                    String name)
        Description copied from interface: AppStorage
        Reads data associated to the node with ID nodeId. A node may have several data blobs associated to it, with different names. The parameters name specifies which of those data is requested.
        Specified by:
        readBinaryData in interface AppStorage
      • writeBinaryData

        public OutputStream writeBinaryData​(String nodeId,
                                            String name)
        Description copied from interface: AppStorage
        Returns an OutputStream to write data associated to the node with ID nodeId. A node may have several data blobs associated to it, with different names.
        Specified by:
        writeBinaryData in interface AppStorage
      • dataExists

        public boolean dataExists​(String nodeId,
                                  String name)
        Description copied from interface: AppStorage
        Returns true if data named name associated with the node with ID nodeId exists.
        Specified by:
        dataExists in interface AppStorage
      • getDataNames

        public Set<String> getDataNames​(String nodeId)
        Description copied from interface: AppStorage
        Returns the lists of names of data associated to the node with ID nodeId.
        Specified by:
        getDataNames in interface AppStorage
      • removeData

        public boolean removeData​(String nodeId,
                                  String name)
        Description copied from interface: AppStorage
        Removes the data blob named name associated with the node with ID nodeId.
        Specified by:
        removeData in interface AppStorage
      • createTimeSeries

        public void createTimeSeries​(String nodeId,
                                     com.powsybl.timeseries.TimeSeriesMetadata metadata)
        Description copied from interface: AppStorage
        Creates a time series associated with node with ID nodeId.
        Specified by:
        createTimeSeries in interface AppStorage
      • timeSeriesExists

        public boolean timeSeriesExists​(String nodeId,
                                        String timeSeriesName)
        Description copied from interface: AppStorage
        Returns true if a time series named timeSeriesName associated with the node with ID nodeId exists.
        Specified by:
        timeSeriesExists in interface AppStorage
      • getTimeSeriesMetadata

        public List<com.powsybl.timeseries.TimeSeriesMetadata> getTimeSeriesMetadata​(String nodeId,
                                                                                     Set<String> timeSeriesNames)
        Description copied from interface: AppStorage
        Returns metadata of time series associated with node with ID nodeId and with name in timeSeriesNames.
        Specified by:
        getTimeSeriesMetadata in interface AppStorage
      • getTimeSeriesDataVersions

        public Set<Integer> getTimeSeriesDataVersions​(String nodeId,
                                                      String timeSeriesName)
        Description copied from interface: AppStorage
        Gets versions of data for the time series with name timeSeriesName associated with node with ID nodeId.
        Specified by:
        getTimeSeriesDataVersions in interface AppStorage
      • getDoubleTimeSeriesData

        public Map<String,​List<com.powsybl.timeseries.DoubleDataChunk>> getDoubleTimeSeriesData​(String nodeId,
                                                                                                      Set<String> timeSeriesNames,
                                                                                                      int version)
        Description copied from interface: AppStorage
        Gets data (double) for the time series with names timeSeriesNames associated with node with ID nodeId.
        Specified by:
        getDoubleTimeSeriesData in interface AppStorage
      • addDoubleTimeSeriesData

        public void addDoubleTimeSeriesData​(String nodeId,
                                            int version,
                                            String timeSeriesName,
                                            List<com.powsybl.timeseries.DoubleDataChunk> chunks)
        Description copied from interface: AppStorage
        Adds data (double) to the time series with names timeSeriesNames associated with node with ID nodeId.
        Specified by:
        addDoubleTimeSeriesData in interface AppStorage
      • getStringTimeSeriesData

        public Map<String,​List<com.powsybl.timeseries.StringDataChunk>> getStringTimeSeriesData​(String nodeId,
                                                                                                      Set<String> timeSeriesNames,
                                                                                                      int version)
        Description copied from interface: AppStorage
        Gets data (string) for the time series with names timeSeriesNames associated with node with ID nodeId.
        Specified by:
        getStringTimeSeriesData in interface AppStorage
      • addStringTimeSeriesData

        public void addStringTimeSeriesData​(String nodeId,
                                            int version,
                                            String timeSeriesName,
                                            List<com.powsybl.timeseries.StringDataChunk> chunks)
        Description copied from interface: AppStorage
        Adds data (string) to the time series with names timeSeriesNames associated with node with ID nodeId.
        Specified by:
        addStringTimeSeriesData in interface AppStorage
      • clearTimeSeries

        public void clearTimeSeries​(String nodeId)
        Description copied from interface: AppStorage
        Deletes time series associated with node with ID nodeId
        Specified by:
        clearTimeSeries in interface AppStorage
      • addDependency

        public void addDependency​(String nodeId,
                                  String name,
                                  String toNodeId)
        Description copied from interface: AppStorage
        Adds a dependency from node with ID nodeId to node with ID toNodeId. The dependency will be associated with the specified name.
        Specified by:
        addDependency in interface AppStorage
      • getDependencies

        public Set<NodeInfo> getDependencies​(String nodeId,
                                             String name)
        Description copied from interface: AppStorage
        Gets NodeInfo objects for dependencies of node with ID nodeId, and associated to the dependency name name.
        Specified by:
        getDependencies in interface AppStorage
      • removeDependency

        public void removeDependency​(String nodeId,
                                     String name,
                                     String toNodeId)
        Description copied from interface: AppStorage
        Removes a dependency named name from node with ID nodeId to node with ID toNodeId.
        Specified by:
        removeDependency in interface AppStorage
      • flush

        public void flush()
        Description copied from interface: AppStorage
        Flush any changes to underlying storage.
        Specified by:
        flush in interface AppStorage
      • isClosed

        public boolean isClosed()
        Description copied from interface: AppStorage
        Check if storage is closed.
        Specified by:
        isClosed in interface AppStorage
      • close

        public void close()
        Description copied from interface: AppStorage
        Closes any resource associated with this storage.
        Specified by:
        close in interface AppStorage
        Specified by:
        close in interface AutoCloseable