Interface Container


  • public interface Container
    A container is created each time data are imported by importers. Its role is to host all data collected by importers during import process. After pushing data into the container, its content can be analyzed to verify its validity and then be processed by processors. Thus, containers are loaded by importers and unloaded by processors.

    See ContainerLoader for how to push graph and attributes data in the container and see ContainerUnloader for how to retrieve data in the container.

    Author:
    Mathieu Bastian
    See Also:
    Importer, Processor
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static interface  Container.Factory
      Container factory.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void closeLoader()
      Close the current loading and clean content before unloading.
      ContainerLoader getLoader()
      Gets the container loading interface.
      Report getReport()
      Returns the report associated to this container, if it exists.
      String getSource()
      If exists, returns the source of the data.
      ContainerUnloader getUnloader()
      Get the container unloading interface.
      boolean hasDynamicAttributes()
      Returns true if this container contains elements that have dynamic attributes.
      boolean hasSelfLoops()
      Returns true if edges in this container are self-loops.
      boolean isDynamicGraph()
      Returns true if this container contains a dynamic graph.
      boolean isMultiGraph()
      Returns true if this container contains a multigraph.
      void setReport​(Report report)
      Sets a report this container can use to report issues detected when loading the container.
      void setSource​(String source)
      Sets the source of the data put in the container.
      boolean verify()
      This method must be called after the loading is complete and before unloading.
    • Method Detail

      • getSource

        String getSource()
        If exists, returns the source of the data.
        Returns:
        source of the data, or null if source is not defined.
      • setSource

        void setSource​(String source)
        Sets the source of the data put in the container. Could be a file name.
        Parameters:
        source - original source of data.
        Throws:
        NullPointerException - if source is null
      • getLoader

        ContainerLoader getLoader()
        Gets the container loading interface.

        The loader is used by modules which put data in the container, whereas the unloader interface is used by modules which read containers content.

        Returns:
        containers loading interface
      • getUnloader

        ContainerUnloader getUnloader()
        Get the container unloading interface.

        The unloader interface is used by modules which read containers content, whereas the loader is used for pushing data in the container.

        Returns:
        container unloading interface
      • getReport

        Report getReport()
        Returns the report associated to this container, if it exists.
        Returns:
        report set for this container or null if no report is defined
      • setReport

        void setReport​(Report report)
        Sets a report this container can use to report issues detected when loading the container.

        Report are used to log info and issues during import process. Only one report can be associated to a container.

        Parameters:
        report - set report as the default report for this container
        Throws:
        NullPointerException - if report is null
      • verify

        boolean verify()
        This method must be called after the loading is complete and before unloading.

        It aims to verify data consistency as a whole.

        Returns:
        true if container data is consistent, false otherwise
      • closeLoader

        void closeLoader()
        Close the current loading and clean content before unloading.
      • isDynamicGraph

        boolean isDynamicGraph()
        Returns true if this container contains a dynamic graph.

        A dynamic graph has elements that appear or disappear over time.

        Returns:
        true if dynamic, false otherwise
      • hasDynamicAttributes

        boolean hasDynamicAttributes()
        Returns true if this container contains elements that have dynamic attributes.

        Dynamic attributes are attributes with different values over time.

        Returns:
        true if dynamic attributes, false otherwise
      • hasSelfLoops

        boolean hasSelfLoops()
        Returns true if edges in this container are self-loops.
        Returns:
        true if presence of self-loops, false otherwise
      • isMultiGraph

        boolean isMultiGraph()
        Returns true if this container contains a multigraph.

        A multi-graph is a graph that has several types of edges (i.e. edges with different labels).

        Returns:
        true if multigraph, false otherwise