Class BasicIndexer
java.lang.Object
gov.nist.secauto.oscal.lib.profile.resolver.support.BasicIndexer
- All Implemented Interfaces:
IIndexer
- Direct Known Subclasses:
ReassignmentIndexer
-
Nested Class Summary
Nested classes/interfaces inherited from interface gov.nist.secauto.oscal.lib.profile.resolver.support.IIndexer
IIndexer.SelectionStatus
-
Field Summary
Fields inherited from interface gov.nist.secauto.oscal.lib.profile.resolver.support.IIndexer
HAS_PROP_KEEP_METAPATH, KEEP_ENTITY_PREDICATE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddControl
(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) addGroup
(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) protected IEntityItem
addItem
(gov.nist.secauto.oscal.lib.profile.resolver.support.AbstractEntityItem.Builder builder) protected IEntityItem
addItem
(IEntityItem item) addLocation
(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) addParameter
(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) addPart
(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) addParty
(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) addResource
(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) addRole
(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) void
Get a copy of the entity map.getEntitiesByItemType
(IEntityItem.ItemType itemType) getEntity
(IEntityItem.ItemType itemType, String identifier, boolean normalize) Lookup an item of the givenitemType
having the givenidentifier
.getSelectionStatus
(gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem item) Map<gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem,
IIndexer.SelectionStatus> boolean
isSelected
(IEntityItem entity) protected gov.nist.secauto.oscal.lib.profile.resolver.support.AbstractEntityItem.Builder
newBuilder
(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item, IEntityItem.ItemType itemType, String identifier) Create a new builder with the provided info.protected final gov.nist.secauto.oscal.lib.profile.resolver.support.AbstractEntityItem.Builder
newBuilder
(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item, IEntityItem.ItemType itemType, UUID identifier) normalizeIdentifier
(String identifier) Lower case UUID-based identifiers and leave others unmodified.boolean
removeItem
(IEntityItem entity) void
void
setSelectionStatus
(gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem item, IIndexer.SelectionStatus selectionStatus)
-
Constructor Details
-
BasicIndexer
public BasicIndexer() -
BasicIndexer
-
-
Method Details
-
append
-
setSelectionStatus
public void setSelectionStatus(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem item, @NonNull IIndexer.SelectionStatus selectionStatus) - Specified by:
setSelectionStatus
in interfaceIIndexer
-
getSelectionStatusMap
public Map<gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem,IIndexer.SelectionStatus> getSelectionStatusMap()- Specified by:
getSelectionStatusMap
in interfaceIIndexer
-
getSelectionStatus
public IIndexer.SelectionStatus getSelectionStatus(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem item) - Specified by:
getSelectionStatus
in interfaceIIndexer
-
resetSelectionStatus
- Specified by:
resetSelectionStatus
in interfaceIIndexer
-
isSelected
- Specified by:
isSelected
in interfaceIIndexer
-
getEntities
Description copied from interface:IIndexer
Get a copy of the entity map.- Specified by:
getEntities
in interfaceIIndexer
- Returns:
- the copy
-
getEntitiesByItemType
@NonNull public Collection<IEntityItem> getEntitiesByItemType(@NonNull IEntityItem.ItemType itemType) - Specified by:
getEntitiesByItemType
in interfaceIIndexer
-
getEntity
public IEntityItem getEntity(@NonNull IEntityItem.ItemType itemType, @NonNull String identifier, boolean normalize) Description copied from interface:IIndexer
Lookup an item of the givenitemType
having the givenidentifier
.Will normalize the case of a UUID-based the identifier when requested.
-
addItem
-
addItem
@NonNull protected IEntityItem addItem(@NonNull gov.nist.secauto.oscal.lib.profile.resolver.support.AbstractEntityItem.Builder builder) -
removeItem
- Specified by:
removeItem
in interfaceIIndexer
-
addRole
public IEntityItem addRole(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) -
addLocation
public IEntityItem addLocation(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) - Specified by:
addLocation
in interfaceIIndexer
-
addParty
public IEntityItem addParty(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) -
addGroup
public IEntityItem addGroup(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) -
addControl
public IEntityItem addControl(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) - Specified by:
addControl
in interfaceIIndexer
-
addParameter
public IEntityItem addParameter(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) - Specified by:
addParameter
in interfaceIIndexer
-
addPart
public IEntityItem addPart(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) -
addResource
public IEntityItem addResource(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item) - Specified by:
addResource
in interfaceIIndexer
-
newBuilder
@NonNull protected final gov.nist.secauto.oscal.lib.profile.resolver.support.AbstractEntityItem.Builder newBuilder(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item, @NonNull IEntityItem.ItemType itemType, @NonNull UUID identifier) -
newBuilder
@NonNull protected gov.nist.secauto.oscal.lib.profile.resolver.support.AbstractEntityItem.Builder newBuilder(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> item, @NonNull IEntityItem.ItemType itemType, @NonNull String identifier) Create a new builder with the provided info.This method can be overloaded to support applying additional data to the returned builder.
When working with identifiers that are case insensitve, it is important to ensure that the identifiers are normalized to lower case.
- Parameters:
item
- the Metapath node to associate with the entityitemType
- the type of entityidentifier
- the entity's identifier- Returns:
- the entity builder
-
normalizeIdentifier
Lower case UUID-based identifiers and leave others unmodified.- Parameters:
identifier
- the identifier- Returns:
- the resulting normalized identifier
-