Class FSComponentExtRepositoryDB<FSCRC extends FSCRDBComponent>

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    FSComponentRepositoryDB

    public abstract class FSComponentExtRepositoryDB<FSCRC extends FSCRDBComponent>
    extends java.lang.Object
    implements java.io.Serializable
    A utility for component repository implementers. This helps implementing the index of components provided and query functionality (see IComponentsRepository.findComponents(X) as well as a simple query cache. This class is not thread safe.
    See Also:
    Serialized Form
    • Constructor Detail

      • FSComponentExtRepositoryDB

        public FSComponentExtRepositoryDB()
    • Method Detail

      • clearCache

        protected void clearCache()
        Clear the "find" cache.
      • getCacheHits

        public int getCacheHits()
        Stats of "find" cache.
      • getCacheQueries

        public int getCacheQueries()
        Stats of "find" cache.
      • getCacheSize

        public int getCacheSize()
        Stats of "find" cache.
      • delegate

        protected boolean delegate​(java.lang.String componentName)
        Decides whether a component should be allowed to be found by repos down the priority chain. Defaults to not delegate if the component's module was found here and to delegate otherwise.
        Parameters:
        componentName -
      • findComponents

        public java.util.Collection<java.lang.String> findComponents​(X propertyExpression)
                                                              throws java.io.IOException
        Find locally in this DB (see also IComponentsRepository.findComponents(X)
        Parameters:
        propertyExpression -
        Throws:
        java.io.IOException
      • getRevision

        public long getRevision​(java.lang.String cn)
        Gets rev of local component
        Parameters:
        cn -
      • getComponents

        public java.util.Map<java.lang.String,​FSCRC> getComponents()
      • putComponent

        public void putComponent​(java.lang.String componentName,
                                 FSCRC c)
        Adds a component, updates modules set.
      • createSyntheticComponent

        protected abstract FSCRC createSyntheticComponent​(java.lang.String componentName)
        Create a synthetic component without any particular properties yet. This is used for filling synthetic components, e.g. links to an existing component during alias expansion.
      • removeComponent

        public void removeComponent​(java.lang.String componentName)
        Remove a component
      • removeModule

        public void removeModule​(java.lang.String moduleName)
        Remove a complete module
      • hasModule

        public boolean hasModule​(java.lang.String moduleName)
        Checks whether this DB has the module
      • hasComponentModule

        public boolean hasComponentModule​(java.lang.String componentName)
        Checks whether this DB has the named component's module
      • getModules

        public java.util.Set<java.lang.String> getModules()
        gets the modules read-only
      • getComponentsOfModule

        public java.util.Set<java.lang.String> getComponentsOfModule​(java.lang.String moduleName)
        Gets all components of a given module
      • moduleOf

        public static java.lang.String moduleOf​(java.lang.String componentName)
        Extracts module name from component name (i.e. the "/" separated prefix)
      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object