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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected QualifiedAgent
callingAgent
The agent who called the operation.protected QualifiedAgent
expectedAgent
The agent who is expected to call the given operation.protected String
expectedSar
The SAR of which the calling agent needs to be member of but is not.
-
Constructor Summary
Constructors Constructor Description 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.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QualifiedAgent
getCallingAgent()
Gets the agent that called the method but is not allowed to execute it.QualifiedAgent
getExpectedAgent()
Gets the agent that is allowed to execute the called method ornull
in case the allowed agents are specified as SAR.String
getExpectedSar()
Gets the SAR that specifies the agents that are allowed to execute the called method ornull
in case a specific agent is expected.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
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 benull
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 benull
if a specific agent is expected.
-
-
Constructor Detail
-
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 Detail
-
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 ornull
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 ornull
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.
-
-