Class WrongAgentException

java.lang.Object
java.lang.Throwable
java.lang.Exception
de.aristaflow.adept2.model.execution.WrongAgentException
All Implemented Interfaces:
Serializable

public class WrongAgentException extends Exception
This exception is thrown, if either the agent calling the requested operation does not match the required one or the agent is not member of a specific SAR.
See Also:
  • Field Details

    • callingAgent

      protected final QualifiedAgent callingAgent
      The agent who called the operation.
    • expectedAgent

      protected final QualifiedAgent expectedAgent
      The agent who is expected to call the given operation. This will be null if the expected agent is not specified but the calling agent is not member of a specific SAR.
    • expectedSar

      protected final String expectedSar
      The SAR of which the calling agent needs to be member of but is not. This will be null if a specific agent is expected.
  • Constructor Details

    • WrongAgentException

      public WrongAgentException(String message, QualifiedAgent callingAgent, QualifiedAgent expectedAgent)
      Creates a new exception indicating that the calling agent is not the expected one and therefore is not allowed to execute the called method.
      Parameters:
      message - The exception message.
      callingAgent - The agent that called the method but is not allowed to execute it.
      expectedAgent - The agent that is allowed to execute the called method.
    • WrongAgentException

      public WrongAgentException(String message, QualifiedAgent callingAgent, String expectedSar)
      Creates a new exception indicating that the calling agent is not a member of the SAR of which the members are allowed to execute the called method.
      Parameters:
      message - The exception message.
      callingAgent - The agent that called the method but is not allowed to execute it.
      expectedSar - The SAR that specifies the agents that are allowed to execute the called method.
  • Method Details

    • getCallingAgent

      public QualifiedAgent getCallingAgent()
      Gets the agent that called the method but is not allowed to execute it.
      Returns:
      The agent that called the method but is not allowed to execute it.
    • getExpectedAgent

      public QualifiedAgent getExpectedAgent()
      Gets the agent that is allowed to execute the called method or null in case the allowed agents are specified as SAR.
      Returns:
      The agent that is allowed to execute the called method or null in case the allowed agents are specified as SAR.
    • getExpectedSar

      public String getExpectedSar()
      Gets the SAR that specifies the agents that are allowed to execute the called method or null in case a specific agent is expected.
      Returns:
      The SAR that specifies the agents that are allowed to execute the called method or null in case a specific agent is expected.