Interface IIndexer
-
- All Known Implementing Classes:
BasicIndexer,ReassignmentIndexer
public interface IIndexer
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIIndexer.SelectionStatus
-
Field Summary
Fields Modifier and Type Field Description static gov.nist.secauto.metaschema.model.common.metapath.MetapathExpressionHAS_PROP_KEEP_METAPATHstatic Predicate<IEntityItem>KEEP_ENTITY_PREDICATE
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description IEntityItemaddControl(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem control)IEntityItemaddGroup(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem group)IEntityItemaddLocation(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem location)IEntityItemaddParameter(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem parameter)IEntityItemaddPart(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem part)IEntityItemaddParty(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem party)IEntityItemaddResource(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem resource)IEntityItemaddRole(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem role)voidappend(IIndexer result)static <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.Map<IEntityItem.ItemType,Map<String,IEntityItem>>getEntities()Get a copy of the entity map.Collection<IEntityItem>getEntitiesByItemType(IEntityItem.ItemType itemType)default IEntityItemgetEntity(IEntityItem.ItemType itemType, String identifier)Lookup an item of the givenitemTypehaving the givenidentifier.IEntityItemgetEntity(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.IIndexer.SelectionStatusgetSelectionStatus(gov.nist.secauto.metaschema.model.common.metapath.item.INodeItem item)Map<gov.nist.secauto.metaschema.model.common.metapath.item.INodeItem,IIndexer.SelectionStatus>getSelectionStatusMap()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 voidlogIndex(IIndexer indexer, org.apache.logging.log4j.Level logLevel)booleanremoveItem(IEntityItem entity)voidresetSelectionStatus()voidsetSelectionStatus(gov.nist.secauto.metaschema.model.common.metapath.item.INodeItem item, IIndexer.SelectionStatus selectionStatus)
-
-
-
Field Detail
-
HAS_PROP_KEEP_METAPATH
static final gov.nist.secauto.metaschema.model.common.metapath.MetapathExpression HAS_PROP_KEEP_METAPATH
-
KEEP_ENTITY_PREDICATE
static final Predicate<IEntityItem> KEEP_ENTITY_PREDICATE
-
-
Method Detail
-
isReferencedEntity
static boolean isReferencedEntity(@NonNull IEntityItem entity)
-
getReferencedEntitiesAsStream
static Stream<IEntityItem> getReferencedEntitiesAsStream(@NonNull 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.- 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
static void logIndex(@NonNull IIndexer indexer, @NonNull org.apache.logging.log4j.Level logLevel)
-
addRole
@NonNull IEntityItem addRole(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem role)
-
addLocation
@NonNull IEntityItem addLocation(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem location)
-
addParty
@NonNull IEntityItem addParty(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem party)
-
addGroup
@Nullable IEntityItem addGroup(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem group)
-
addControl
@NonNull IEntityItem addControl(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem control)
-
addParameter
@NonNull IEntityItem addParameter(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem parameter)
-
addPart
@Nullable IEntityItem addPart(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem part)
-
addResource
@NonNull IEntityItem addResource(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem resource)
-
getEntitiesByItemType
@NonNull Collection<IEntityItem> getEntitiesByItemType(@NonNull IEntityItem.ItemType itemType)
-
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
boolean removeItem(@NonNull IEntityItem entity)
-
isSelected
boolean isSelected(@NonNull IEntityItem entity)
-
getSelectionStatusMap
Map<gov.nist.secauto.metaschema.model.common.metapath.item.INodeItem,IIndexer.SelectionStatus> getSelectionStatusMap()
-
getSelectionStatus
@NonNull IIndexer.SelectionStatus getSelectionStatus(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.INodeItem item)
-
setSelectionStatus
void setSelectionStatus(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.INodeItem item, @NonNull IIndexer.SelectionStatus selectionStatus)
-
resetSelectionStatus
void resetSelectionStatus()
-
getEntities
@NonNull Map<IEntityItem.ItemType,Map<String,IEntityItem>> getEntities()
Get a copy of the entity map.- Returns:
- the copy
-
-