Class QualifiedAgent
- java.lang.Object
-
- de.aristaflow.adept2.base.sessionmanagement.QualifiedAgent
-
- All Implemented Interfaces:
Serializable
public final class QualifiedAgent extends Object implements Serializable
AQualifiedAgent
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 useRichAgent
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
QualifiedAgent(long agentID, String agentUserName, long orgPositionID, String orgPositionName)
Constructs a newQualifiedAgent
for the designated agent and organisational position ID.protected
QualifiedAgent(long agentID, String agentUserName, long orgPositionID, String orgPositionName, String userSessionID)
Constructs a newQualifiedAgent
for 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 QualifiedAgent
create(long agentID, String agentUserName, long orgPositionID, String orgPositionName)
Constructs a newQualifiedAgent
for the designated agent and organisational position ID.static QualifiedAgent
create(long agentID, String agentUserName, long orgPositionID, String orgPositionName, String userSessionID)
Constructs a newQualifiedAgent
for the designated agent and organisational position ID as well as the user session ID.boolean
equals(Object obj)
TwoQualifiedAgent
s are equal if their agent IDs and org position IDs match.long
getAgentID()
Returns the Agent's ID of this result entry.String
getAgentUserName()
Returns the Agent's user name of this result entry.long
getOrgPositionID()
Returns the OrgPosition ID (of the Agent's OrgPosition) of this result entry.String
getOrgPositionName()
Returns the OrgPosition name (of the Agent's OrgPosition) of this result entry.String
getUserSessionID()
Gets the ID of the user session which is provided by various (client) frameworks.int
hashCode()
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.String
toString()
-
-
-
Constructor Detail
-
QualifiedAgent
protected QualifiedAgent(long agentID, String agentUserName, long orgPositionID, String orgPositionName)
Constructs a newQualifiedAgent
for the designated agent and organisational position ID. Please pay attention to the order as both parameters areint
s. 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 newQualifiedAgent
for the designated agent and organisational position ID as well as the user session ID. Please pay attention to the order as both parameters areint
s.- 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 newQualifiedAgent
for the designated agent and organisational position ID. Please pay attention to the order as both parameters areint
s. 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 newQualifiedAgent
for the designated agent and organisational position ID as well as the user session ID. Please pay attention to the order as both parameters areint
s.- 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)
TwoQualifiedAgent
s are equal if their agent IDs and org position IDs match.getUserSessionID()
is not considered here!
-
-