Package org.iam.policy.model
Class MCPPrincipal
java.lang.Object
org.iam.policy.grammer.Principal
org.iam.policy.model.MCPPrincipal
- All Implemented Interfaces:
MCPVar
MCPPrincipal extends Principal and implements MCPVar for symbolic encoding.
Represents a principal entity as a symbolic MCPBitVector, supporting initialization of symbolic domains and computation of the principal's symbolic node.
- Since:
- 2025-02-28
- Author:
-
Field Summary
Fields inherited from class org.iam.policy.grammer.Principal
domainName, values -
Constructor Summary
ConstructorsConstructorDescriptionMCPPrincipal(Principal other) Constructs an MCPPrincipal by copying from another Principal. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.mcp.core.MCPFactorygetMCPFactory(org.mcp.core.MCPFactory mcpFactory) Returns the MCPFactory used by all MCPPrincipal instances.org.mcp.core.MCPBitVectorComputes and returns the symbolic encoding node for this principal.voidInitializes the MCPFactory with domain variables for this principal.static voidsetMCPFactory(org.mcp.core.MCPFactory mcpFactory) Sets the MCPFactory for all MCPPrincipal instances.toString()Returns a string representation of this MCPPrincipal.Methods inherited from class org.iam.policy.grammer.Principal
equals, getDomainName, getValues, hashCode, setDomainName, setValues
-
Constructor Details
-
MCPPrincipal
Constructs an MCPPrincipal by copying from another Principal.- Parameters:
other- the Principal to copy
-
-
Method Details
-
setMCPFactory
public static void setMCPFactory(org.mcp.core.MCPFactory mcpFactory) Sets the MCPFactory for all MCPPrincipal instances.- Parameters:
mcpFactory- the MCPFactory to use
-
getMCPFactory
public static org.mcp.core.MCPFactory getMCPFactory(org.mcp.core.MCPFactory mcpFactory) Returns the MCPFactory used by all MCPPrincipal instances.- Parameters:
mcpFactory- (unused, kept for compatibility)- Returns:
- the MCPFactory
-
initialMCPFactory
public void initialMCPFactory()Initializes the MCPFactory with domain variables for this principal. Adds each value as a domain variable with the appropriate type.- Specified by:
initialMCPFactoryin interfaceMCPVar
-
getMCPNodeCalculation
public org.mcp.core.MCPBitVector getMCPNodeCalculation()Computes and returns the symbolic encoding node for this principal. Returns the cached value if already computed.- Specified by:
getMCPNodeCalculationin interfaceMCPVar- Returns:
- the MCPBitVector node for this principal
-
toString
Returns a string representation of this MCPPrincipal.
-