Class QualifiedAgent
- java.lang.Object
-
- de.aristaflow.adept2.base.sessionmanagement.QualifiedAgent
-
- All Implemented Interfaces:
Serializable
public final class QualifiedAgent extends Object implements Serializable
AQualifiedAgentrepresents 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 useRichAgent.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedQualifiedAgent(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static QualifiedAgentcreate(long agentID, String agentUserName, long orgPositionID, String orgPositionName)Constructs 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.booleanequals(Object obj)TwoQualifiedAgents are equal if their agent IDs and org position IDs match.longgetAgentID()Returns the Agent's ID of this result entry.StringgetAgentUserName()Returns the Agent's user name of this result entry.longgetOrgPositionID()Returns the OrgPosition ID (of the Agent's OrgPosition) of this result entry.StringgetOrgPositionName()Returns the OrgPosition name (of the Agent's OrgPosition) of this result entry.StringgetUserSessionID()Gets the ID of the user session which is provided by various (client) frameworks.inthashCode()QualifiedAgentintern()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.StringtoString()
-
-
-
Constructor Detail
-
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 Detail
-
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
public String 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
public String getOrgPositionName()
Returns the OrgPosition name (of the Agent's OrgPosition) of this result entry.- Returns:
- the OrgPosition ID of this result entry
-
getUserSessionID
public String 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
public QualifiedAgent 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
public boolean equals(Object obj)
TwoQualifiedAgents are equal if their agent IDs and org position IDs match.getUserSessionID()is not considered here!
-
-