java.lang.Object
de.aristaflow.adept2.base.sessionmanagement.RichAgent
All Implemented Interfaces:
Serializable

public class RichAgent extends Object implements Serializable
A RichAgent enhances a QualifiedAgent by providing far more information and is therefore a "user-friendly" version of a QualifiedAgent. The latter is used internally to allow for efficient progressing without the unneeded data provided by this class.

This data includes a user-readable name for display purpose (instead of IDs or short logon names), a mail address as well as the preferred locale which is used to provide the user-interface with the right language and other locale-specific characteristics.

See Also:
  • Constructor Details

    • RichAgent

      public RichAgent(QualifiedAgent agent, String userReadableName, String mailAddress, Locale locale, Map<String,String> additionalAttributes)
      Constructs a new RichAgent for the designated (qualified) agent with the designated additional information on name, mail address and locale as well as the provided map of additional information.
      Parameters:
      agent - The system identification of this agent.
      userReadableName - The name of the agent in a user readable form, usually the first and the last name. This may be null but should not be null.
      mailAddress - The mail-address of the agent. This may be null but should not be null.
      locale - The locale for this agent. If this is null, the default locale of the JVM will be used.
      additionalAttributes - Additional attributes as provided by the organisational model. This may be null.
    • RichAgent

      public RichAgent(long agentID, String agentUserName, long orgPositionID, String orgPositionName, String userSessionID, String userReadableName, String mailAddress, Locale locale, Map<String,String> additionalAttributes)
      Constructs a new RichAgent for the designated attributes of a qualified agent with the designated additional information on name, mail address and locale as well as the provided map of additional information.
      Parameters:
      agentID - The ID of the (qualified) agent.
      agentUserName - The name of the (qualified) agent.
      orgPositionID - The ID of the organisational position of the (qualified) agent.
      userSessionID - The session ID identifying the agent as provided by various (client) frameworks like HTTP-Session-IDs. This may be null.
      orgPositionName - The name of the organisational position of the (qualified) agent.
      userReadableName - The name of the agent in a user readable form, usually the first and the last name. This may be null but should not be null.
      mailAddress - The mail-address of the agent. This may be null but should not be null.
      locale - The locale for this agent. If this is null, the default locale of the JVM will be used.
      additionalAttributes - Additional attributes as provided by the organisational model. This may be null.
  • Method Details

    • getQualifiedAgent

      public QualifiedAgent getQualifiedAgent()
      Gets the agent identifying attributes.
      Returns:
      The attributes identifying the agent.
    • getUserReadableName

      public String getUserReadableName()
      Gets the name of the agent in a user-readable form. In case this name is not set, the empty string will be returned.
      Returns:
      The name of the agent in a user-readable form.
    • getMailAddress

      public String getMailAddress()
      Gets the mail-address of this agent or null in case the mail-address is not set in the corresponding organisational model. In case the address is not set, the empty string will be returned.
      Returns:
      The mail-address of this agent or null in case the mail-address is unknown.
    • getLocale

      public Locale getLocale()
      Gets the locale which is configured for this agent. This is not necessarily the one used at a client. This may differ, for instance, when the client does not support this locale.
      Returns:
      The configured locale for this agent.
    • getAdditionalAttributes

      public Map<String,String> getAdditionalAttributes()
      Gets the additional attributes that are stored in the organisational model for this agent. The map is unmodifiable and may be empty.
      Returns:
      The additional attributes that are stored in the organisational model for this agent.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object