Interface IIndexer
- All Known Implementing Classes:
BasicIndexer,ReassignmentIndexer
public interface IIndexer
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final gov.nist.secauto.metaschema.core.metapath.IMetapathExpressionstatic final Predicate<IEntityItem> -
Method Summary
Modifier and TypeMethodDescriptionaddControl(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> control) addGroup(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> group) addLocation(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> location) addParameter(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> parameter) addPart(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> part) addParty(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> party) addResource(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> resource) addRole(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> role) voidstatic <T,K> Stream<T> filterDistinct(Stream<T> resolvedItems, Collection<IEntityItem> importedEntityItems, 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.Get a copy of the entity map.getEntitiesByItemType(IEntityItem.ItemType itemType) default IEntityItemgetEntity(IEntityItem.ItemType itemType, String identifier) Lookup an item of the givenitemTypehaving the givenidentifier.getEntity(IEntityItem.ItemType itemType, String identifier, boolean normalize) Lookup an item of the givenitemTypehaving the givenidentifier.default IEntityItemgetEntity(IEntityItem.ItemType itemType, UUID identifier) static Stream<IEntityItem>getReferencedEntitiesAsStream(Collection<IEntityItem> entities) Keep entities that have a reference count greater than zero or are required to be kept based on the "keep"="always property.getSelectionStatus(gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem item) Map<gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem,IIndexer.SelectionStatus> static Stream<IEntityItem>getUnreferencedEntitiesAsStream(Collection<IEntityItem> entities) Keep entities that have a reference count of zero or are not required to be kept based on the "keep"="always property.static booleanisReferencedEntity(IEntityItem entity) booleanisSelected(IEntityItem entity) static voidbooleanremoveItem(IEntityItem entity) voidvoidsetSelectionStatus(gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem item, IIndexer.SelectionStatus selectionStatus)
-
Field Details
-
HAS_PROP_KEEP_METAPATH
-
KEEP_ENTITY_PREDICATE
-
-
Method Details
-
isReferencedEntity
-
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
static Stream<IEntityItem> getUnreferencedEntitiesAsStream(@NonNull Collection<IEntityItem> entities) 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 typeK- the key type- Parameters:
resolvedItems- a series of previously resolved items to add to prepend to the streamimportedEntityItems- a collection of new items to filter then append to the streamkeyMapper- 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
-
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 givenitemTypehaving the givenidentifier.Will normalize the case of a UUID-based identifier.
- Parameters:
itemType- the type of item to search foridentifier- the identifier to lookup- Returns:
- the matching item or
nullif no match was found
-
getEntity
@Nullable IEntityItem getEntity(@NonNull IEntityItem.ItemType itemType, @NonNull String identifier, boolean normalize) Lookup an item of the givenitemTypehaving the givenidentifier.Will normalize the case of a UUID-based the identifier when requested.
- Parameters:
itemType- the type of item to search foridentifier- the identifier to lookupnormalize-trueif the identifier case should be normalized orfalseotherwise- Returns:
- the matching item or
nullif no match was found
-
removeItem
-
isSelected
-
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
void resetSelectionStatus() -
append
-
getEntities
Get a copy of the entity map.- Returns:
- the copy
-