Class MCPPrincipal

java.lang.Object
org.iam.policy.grammer.Principal
org.iam.policy.model.MCPPrincipal
All Implemented Interfaces:
MCPVar

public class MCPPrincipal extends Principal implements 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:
  • Constructor Details

    • MCPPrincipal

      public MCPPrincipal(Principal other)
      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:
      initialMCPFactory in interface MCPVar
    • 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:
      getMCPNodeCalculation in interface MCPVar
      Returns:
      the MCPBitVector node for this principal
    • toString

      public String toString()
      Returns a string representation of this MCPPrincipal.
      Overrides:
      toString in class Object
      Returns:
      a string representation