All Known Implementing Classes:
BasicIndexer, ReassignmentIndexer

public interface IIndexer
  • Field Details

  • Method Details

    • isReferencedEntity

      static boolean isReferencedEntity(@NonNull IEntityItem entity)
    • getReferencedEntitiesAsStream

      Keep entities that have a reference count greater than zero or are required to be kept based on the "keep"="always property.
      Parameters:
      entities - the entity items to filter
      Returns:
      the entities that pass the filter
    • getUnreferencedEntitiesAsStream

      Keep entities that have a reference count of zero or are not required to be kept based on the "keep"="always property.
      Parameters:
      entities - the entity items to filter
      Returns:
      the entities that pass the filter
    • filterDistinct

      static <T, K> Stream<T> filterDistinct(@NonNull Stream<T> resolvedItems, @NonNull Collection<IEntityItem> importedEntityItems, @NonNull Function<? super T,? extends K> keyMapper)
      Generates a stream of distinct items that have a reference count greater than zero or are required to be kept based on the "keep"="always property.

      Distinct items are determined based on the item's key using the provided keyMapper.

      Type Parameters:
      T - the item type
      K - the key type
      Parameters:
      resolvedItems - a series of previously resolved items to add to prepend to the stream
      importedEntityItems - a collection of new items to filter then append to the stream
      keyMapper - the key mapping function to determine the item's key
      Returns:
      the resulting series of items with duplicate items with the same key removed
    • logIndex

      static void logIndex(@NonNull IIndexer indexer, @NonNull org.apache.logging.log4j.Level logLevel)
    • addRole

      @NonNull IEntityItem addRole(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?,?> role)
    • addLocation

      @NonNull IEntityItem addLocation(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?,?> location)
    • addParty

      @NonNull IEntityItem addParty(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?,?> party)
    • addGroup

      @Nullable IEntityItem addGroup(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?,?> group)
    • addControl

      @NonNull IEntityItem addControl(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?,?> control)
    • addParameter

      @NonNull IEntityItem addParameter(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?,?> parameter)
    • addPart

      @Nullable IEntityItem addPart(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?,?> part)
    • addResource

      @NonNull IEntityItem addResource(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?,?> resource)
    • getEntitiesByItemType

    • getEntity

      @Nullable default IEntityItem getEntity(@NonNull IEntityItem.ItemType itemType, @NonNull UUID identifier)
    • getEntity

      @Nullable default IEntityItem getEntity(@NonNull IEntityItem.ItemType itemType, @NonNull String identifier)
      Lookup an item of the given itemType having the given identifier.

      Will normalize the case of a UUID-based identifier.

      Parameters:
      itemType - the type of item to search for
      identifier - the identifier to lookup
      Returns:
      the matching item or null if no match was found
    • getEntity

      @Nullable IEntityItem getEntity(@NonNull IEntityItem.ItemType itemType, @NonNull String identifier, boolean normalize)
      Lookup an item of the given itemType having the given identifier.

      Will normalize the case of a UUID-based the identifier when requested.

      Parameters:
      itemType - the type of item to search for
      identifier - the identifier to lookup
      normalize - true if the identifier case should be normalized or false otherwise
      Returns:
      the matching item or null if no match was found
    • removeItem

      boolean removeItem(@NonNull IEntityItem entity)
    • isSelected

      boolean isSelected(@NonNull IEntityItem entity)
    • getSelectionStatusMap

      Map<gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem,IIndexer.SelectionStatus> getSelectionStatusMap()
    • getSelectionStatus

      @NonNull IIndexer.SelectionStatus getSelectionStatus(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem item)
    • setSelectionStatus

      void setSelectionStatus(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem item, @NonNull IIndexer.SelectionStatus selectionStatus)
    • resetSelectionStatus

    • append

      void append(@NonNull IIndexer result)
    • getEntities

      Get a copy of the entity map.
      Returns:
      the copy