Class BufferedCache

java.lang.Object
net.aifusion.metamodel.InMemoryCache
net.aifusion.metamodel.BufferedCache
All Implemented Interfaces:
Repository

@Deprecated(forRemoval=true) public class BufferedCache extends InMemoryCache
Deprecated, for removal: This API element is subject to removal in a future version.
Class to implement a simple in-memory buffer backed by a repository for parsing messages. The buffer uses a backing store to resolve any classes not contained in it. However, any objects added to (or deleted from) the buffer do not affect the objects in the backing store. The buffer does not provide any persistence.
Author:
Sharad Singhal
  • Constructor Summary

    Constructors
    Constructor
    Description
    BufferedCache(Repository backingStore)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a repository buffer with a backing store for additional definitions.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Check if an element exists in the buffer.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get a named element from the buffer.
    getAllElements(String elementTypes, String localNameSpaces, String elementNames, boolean locateSubtypes)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get all elements from the buffer (as well as from the backing store)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the backing store for this repository
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get a named element from the buffer.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the named elements from the buffer, but not the backing store
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the list of name spaces defined in the buffer (or the backing store)

    Methods inherited from class net.aifusion.metamodel.InMemoryCache

    delete, filter, getElements, put, shutdown

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BufferedCache

      public BufferedCache(Repository backingStore)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a repository buffer with a backing store for additional definitions. New definitions are added to the buffer, while the backing store is used for any additional definitions needed for input resolution
      Parameters:
      backingStore - - Repository backing this buffer
  • Method Details

    • getBackingStore

      public Repository getBackingStore()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the backing store for this repository
      Returns:
      - Repository backing this repository
    • get

      public NamedElement get(ObjectPath path)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get a named element from the buffer. If the element does not exist in the buffer, it is retrieved from the backing store.
      Specified by:
      get in interface Repository
      Overrides:
      get in class InMemoryCache
      Parameters:
      path - - object path for the element being requested
      Returns:
      - named element from the buffer (or the backing store). Null if none found
      See Also:
    • contains

      public boolean contains(ObjectPath path)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Check if an element exists in the buffer. If the element does not exist in the buffer, it is checked in the backing store
      Specified by:
      contains in interface Repository
      Overrides:
      contains in class InMemoryCache
      Parameters:
      path - object path for the element being checked
      Returns:
      true if the buffer (or the backing store) contains the element, false otherwise
    • getNameSpaces

      public List<NameSpacePath> getNameSpaces()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the list of name spaces defined in the buffer (or the backing store)
      Specified by:
      getNameSpaces in interface Repository
      Overrides:
      getNameSpaces in class InMemoryCache
      Returns:
      list of all name spaces
    • getBufferedElement

      public NamedElement getBufferedElement(ObjectPath path)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get a named element from the buffer. Only the buffer is checked for the element during retrieval
      Parameters:
      path - - objectPath for the element being requested
      Returns:
      - named element from the buffered values
      See Also:
    • getBufferedElements

      public List<NamedElement> getBufferedElements()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the named elements from the buffer, but not the backing store
      Returns:
      - list of all elements from this repository
    • getAllElements

      public List<NamedElement> getAllElements(String elementTypes, String localNameSpaces, String elementNames, boolean locateSubtypes)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get all elements from the buffer (as well as from the backing store)
      Parameters:
      elementTypes - - comma separated list of element types to search. Null implies all types
      localNameSpaces - - comma separated list of local name spaces to search. Null implies all name spaces
      elementNames - - comma separated list of element names to retrieve. Null matches all element names
      locateSubtypes - - true if subclasses should be collected, false if only the named elements are required
      Returns:
      - list of retrieved elements. Empty if no elements found