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 QualifiedAgentcallingAgentThe agent who called the operation.protected QualifiedAgentexpectedAgentThe agent who is expected to call the given operation.protected StringexpectedSarThe 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 QualifiedAgentgetCallingAgent()Gets the agent that called the method but is not allowed to execute it.QualifiedAgentgetExpectedAgent()Gets the agent that is allowed to execute the called method ornullin case the allowed agents are specified as SAR.StringgetExpectedSar()Gets the SAR that specifies the agents that are allowed to execute the called method ornullin 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 benullif 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 benullif 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 ornullin case the allowed agents are specified as SAR.- Returns:
- The agent that is allowed to execute the called method or
nullin 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 ornullin case a specific agent is expected.- Returns:
- The SAR that specifies the agents that are allowed to execute the called method or
nullin case a specific agent is expected.
-
-