Class QualifiedAgent
java.lang.Object
de.aristaflow.adept2.base.sessionmanagement.QualifiedAgent
- All Implemented Interfaces:
Serializable
A
QualifiedAgent represents an agent (tuple) that has been
authenticated and provides all information the system needs for unique
identification. Each agent tuple consists of the IDs of the agent and a
corresponding organisational position as well as the corresponding names. For
more information on an agent use RichAgent.- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedQualifiedAgent(long agentID, String agentUserName, long orgPositionID, String orgPositionName) Constructs a newQualifiedAgentfor the designated agent and organisational position ID.protectedQualifiedAgent(long agentID, String agentUserName, long orgPositionID, String orgPositionName, String userSessionID) Constructs a newQualifiedAgentfor the designated agent and organisational position ID as well as the user session ID. -
Method Summary
Modifier and TypeMethodDescriptionstatic QualifiedAgentConstructs a newQualifiedAgentfor the designated agent and organisational position ID.static QualifiedAgentcreate(long agentID, String agentUserName, long orgPositionID, String orgPositionName, String userSessionID) Constructs a newQualifiedAgentfor the designated agent and organisational position ID as well as the user session ID.booleanTwoQualifiedAgents are equal if their agent IDs and org position IDs match.longReturns the Agent's ID of this result entry.Returns the Agent's user name of this result entry.longReturns the OrgPosition ID (of the Agent's OrgPosition) of this result entry.Returns the OrgPosition name (of the Agent's OrgPosition) of this result entry.Gets the ID of the user session which is provided by various (client) frameworks.inthashCode()intern()Interns this qualified agent, that is, looks up the designated agent in an internal map and uses the very same object instance for the same agent, similar to a singleton.toString()
-
Constructor Details
-
QualifiedAgent
protected QualifiedAgent(long agentID, String agentUserName, long orgPositionID, String orgPositionName) Constructs a newQualifiedAgentfor the designated agent and organisational position ID. Please pay attention to the order as both parameters areints. The user session ID will be set to null.- Parameters:
agentID- The ID of this agent.agentUserName- The name of this agent.orgPositionID- The ID of the organisational position of the agent.orgPositionName- The name of the organisational position of the agent.
-
QualifiedAgent
protected QualifiedAgent(long agentID, String agentUserName, long orgPositionID, String orgPositionName, String userSessionID) Constructs a newQualifiedAgentfor the designated agent and organisational position ID as well as the user session ID. Please pay attention to the order as both parameters areints.- Parameters:
agentID- The ID of this agent.agentUserName- The name of this agent.orgPositionID- The ID of the organisational position of the agent.orgPositionName- The name of the organisational position of the agent.userSessionID- The session ID as provided by various (client) frameworks like HTTP-Session-IDs.
-
-
Method Details
-
create
public static QualifiedAgent create(long agentID, String agentUserName, long orgPositionID, String orgPositionName) Constructs a newQualifiedAgentfor the designated agent and organisational position ID. Please pay attention to the order as both parameters areints. The user session ID will be set to null.- Parameters:
agentID- The ID of this agent.agentUserName- The name of this agent.orgPositionID- The ID of the organisational position of the agent.orgPositionName- The name of the organisational position of the agent.- Returns:
- The newly created agent.
-
create
public static QualifiedAgent create(long agentID, String agentUserName, long orgPositionID, String orgPositionName, String userSessionID) Constructs a newQualifiedAgentfor the designated agent and organisational position ID as well as the user session ID. Please pay attention to the order as both parameters areints.- Parameters:
agentID- The ID of this agent.agentUserName- The name of this agent.orgPositionID- The ID of the organisational position of the agent.orgPositionName- The name of the organisational position of the agent.userSessionID- The session ID as provided by various (client) frameworks like HTTP-Session-IDs.- Returns:
- The newly created agent.
-
getAgentID
public long getAgentID()Returns the Agent's ID of this result entry.- Returns:
- the Agent's ID of this result entry
-
getAgentUserName
Returns the Agent's user name of this result entry.- Returns:
- the Agent's user name of this result entry
-
getOrgPositionID
public long getOrgPositionID()Returns the OrgPosition ID (of the Agent's OrgPosition) of this result entry.- Returns:
- the OrgPosition ID of this result entry
-
getOrgPositionName
Returns the OrgPosition name (of the Agent's OrgPosition) of this result entry.- Returns:
- the OrgPosition ID of this result entry
-
getUserSessionID
Gets the ID of the user session which is provided by various (client) frameworks. For instance HTTP-frameworks use a HTTP-Session-ID to identify each user uniquely. This will be null in case no corresponding ID is provided.- Returns:
- The ID of the user session that allows various frameworks to identify a user uniquely.
-
intern
Interns this qualified agent, that is, looks up the designated agent in an internal map and uses the very same object instance for the same agent, similar to a singleton. This method is equivalent toString.intern().
Only qualified agents without a user session ID will be interned.- Returns:
- The interned qualified agent, that is the one and only object instance representing this agent in one JVM or this object instance.
-
equals
TwoQualifiedAgents are equal if their agent IDs and org position IDs match.getUserSessionID()is not considered here! -
hashCode
public int hashCode() -
toString
-