Class AbstractBufferedAttributeProvider

    • Constructor Detail

      • AbstractBufferedAttributeProvider

        public AbstractBufferedAttributeProvider()
    • Method Detail

      • loadValue

        protected abstract AttributeValue loadValue​(String name)
                                             throws AttributeException
        Load a value from the data source.
        Parameters:
        name - is the name of the attribute to load
        Returns:
        the value of the attribute.
        Throws:
        AttributeException - on error or when the attribute does not exist
      • getAllAttributeNames

        @Pure
        public abstract Collection<String> getAllAttributeNames()
        Description copied from interface: AttributeProvider
        Replies all the attribute names. This function never load the attribute values even if they are not inside the storage layer.
        Returns:
        the list of all attribute names.
      • hasAttribute

        @Pure
        public boolean hasAttribute​(String name)
        Description copied from interface: AttributeProvider
        Replies if the given attribute exists.
        Parameters:
        name - the name.
        Returns:
        true is an attribute with the given name exists, otherwise false
      • getAllAttributes

        @Pure
        public Collection<Attribute> getAllAttributes()
        Description copied from interface: AttributeProvider
        Replies all the attributes.
        Returns:
        the list of all attributes
      • getAllAttributesByType

        @Pure
        public Map<AttributeType,​Collection<Attribute>> getAllAttributesByType()
        Description copied from interface: AttributeProvider
        Replies all the attributes sorted by type.

        The keys of the returned hashtable are the types and the values are array of attributes (Vector).

        Returns:
        the attributes grouped by type.
      • getAttribute

        @Pure
        public AttributeValue getAttribute​(String name)
        Description copied from interface: AttributeProvider
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value or null
      • getAttribute

        @Pure
        public AttributeValue getAttribute​(String name,
                                           AttributeValue defaultValue)
        Description copied from interface: AttributeProvider
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value or null
      • getAttributeObject

        @Pure
        public Attribute getAttributeObject​(String name)
        Description copied from interface: AttributeProvider
        Replies the attribute with the given name.
        Parameters:
        name - the name.
        Returns:
        the attribute or null
      • freeMemory

        public void freeMemory()
        Description copied from interface: AttributeProvider
        Clean the internal memory-storage structures if they exist.

        This function permits to limit the memory usage without removing the attribute value from a hard storage area (database, files...). The attribute which are freed by this method could be reloaded in memory with a call to a getting method.