001/* 002 * SPDX-FileCopyrightText: none 003 * SPDX-License-Identifier: CC0-1.0 004 */ 005 006package gov.nist.secauto.oscal.lib.profile.resolver.support; 007 008import gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem; 009 010import java.net.URI; 011 012import edu.umd.cs.findbugs.annotations.NonNull; 013 014public interface IEntityItem { 015 016 enum ItemType { 017 ROLE(false), 018 LOCATION(true), 019 PARTY(true), 020 GROUP(false), 021 CONTROL(false), 022 PART(false), 023 PARAMETER(false), 024 RESOURCE(true); 025 026 private final boolean uuid; 027 028 ItemType(boolean isUuid) { 029 this.uuid = isUuid; 030 } 031 032 public boolean isUuid() { 033 return uuid; 034 } 035 } 036 037 /** 038 * Get the identifier originally assigned to this entity. 039 * <p> 040 * If the identifier value was reassigned, the return value of this method will 041 * be different than value returned by {@link #getIdentifier()}. In such cases, 042 * a call to {@link #isIdentifierReassigned()} is expected to return 043 * {@code true}. 044 * <p> 045 * If the value was not reassigned, the return value of this method will be the 046 * same value returned by {@link #getIdentifier()}. In this case, 047 * {@link #isIdentifierReassigned()} is expected to return {@code false}. 048 * 049 * @return the original identifier value before reassignment 050 */ 051 @NonNull 052 String getOriginalIdentifier(); 053 054 /** 055 * Get the entity's current identifier value. 056 * 057 * @return the identifier value 058 */ 059 @NonNull 060 String getIdentifier(); 061 062 /** 063 * Determine if the identifier was reassigned. 064 * 065 * @return {@code true} if the identifier was reassigned, or {@code false} 066 * otherwise 067 */ 068 boolean isIdentifierReassigned(); 069 070 @NonNull 071 IModelNodeItem<?, ?> getInstance(); 072 073 void setInstance(@NonNull IModelNodeItem<?, ?> item); 074 075 @NonNull 076 <T> T getInstanceValue(); 077 078 @NonNull 079 ItemType getItemType(); 080 081 URI getSource(); 082 083 int getReferenceCount(); 084 085 void incrementReferenceCount(); 086 087 int resetReferenceCount(); 088}