Class ConfigRepository

  • All Implemented Interfaces:
    java.io.Serializable

    public final class ConfigRepository
    extends Repository
    Repository of all entities configured in the system.
    See Also:
    Serialized Form
    • Method Detail

      • of

        public static Repository of​(cz.o2.proxima.typesafe.config.Config config)
        Create config from /Config.
        Parameters:
        config - the config to create Repository from
        Returns:
        new Repository
      • ofTest

        public static Repository ofTest​(cz.o2.proxima.typesafe.config.Config config,
                                        Repository.Validate... validates)
        Construct default repository from the config.
        Parameters:
        config - configuration to use
        validates - which validations to perform
        Returns:
        constructed repository
      • reloadConfig

        public void reloadConfig​(boolean loadFamilies,
                                 cz.o2.proxima.typesafe.config.Config conf)
      • findEntity

        public java.util.Optional<EntityDescriptor> findEntity​(java.lang.String name)
        Description copied from class: Repository
        Find entity descriptor based on entity name.
        Specified by:
        findEntity in class Repository
        Parameters:
        name - name of the entity to search for
        Returns:
        optional EntityDescriptor found by name
      • isShouldValidate

        public boolean isShouldValidate​(Repository.Validate what)
        Description copied from class: Repository
        Check if this Repository should eagerly validate various settings.
        Specified by:
        isShouldValidate in class Repository
        Parameters:
        what - validation flag
        Returns:
        true if this Repository should validate settings before usage (typically production settings, while test settings can be less strict).
      • drop

        public void drop()
        Description copied from class: Repository
        Drop the Repository and let it recreate from scratch using factory. This is intended for use in tests mostly to prevent influence between two test cases.
        Specified by:
        drop in class Repository
      • getAllFamilies

        public java.util.stream.Stream<AttributeFamilyDescriptor> getAllFamilies​(boolean includeSystem)
        Description copied from class: Repository
        List all unique attribute families, possibly including system attribute families.
        Specified by:
        getAllFamilies in class Repository
        Parameters:
        includeSystem - true if system families should be included
      • findFamilyByName

        public java.util.Optional<AttributeFamilyDescriptor> findFamilyByName​(java.lang.String name)
        Description copied from class: Repository
        Retrieve attribute family by name.

        Note that this searched all families that were specified in configuration. It might include families not listed in Repository.getAllFamilies(), because some families might be removed for various reasons (e.g. when proxying attributes).

        Specified by:
        findFamilyByName in class Repository
        Parameters:
        name - name of the family
        Returns:
        Optional AttributeFamilyDescriptor if family exists
      • getAllEntities

        public java.util.stream.Stream<EntityDescriptor> getAllEntities()
        Description copied from class: Repository
        Retrieve stream of all entities.
        Specified by:
        getAllEntities in class Repository
        Returns:
        Stream of all entities specified in this repository
      • isEmpty

        public boolean isEmpty()
        Check if this repository is empty.
        Specified by:
        isEmpty in class Repository
        Returns:
        true if this repository is empty
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object