Class Database.AgentEntry

All Implemented Interfaces:
Named
Enclosing class:
Database

public static class Database.AgentEntry extends Database.Listable
Author:
Stephen G. Ware
  • Constructor Details

    • AgentEntry

      public AgentEntry(String name)
      Constructs a new agent database entry from a name.
      Parameters:
      name - the system name of the agent
  • Method Details

    • verify

      public boolean verify(String password)
      Checks whether a given password matches this agent's password. Technically, this method checks whether the salted hashes of the agent's password and the given password match; hash collisions are unlikely but possible.
      Parameters:
      password - the password to check against the agent's password
      Returns:
      true if this agent has no password or if the passwords match, false otherwise
    • setPassword

      public void setPassword(String password)
      Sets this agent's password. The given password can be null to remove password protection from this agent.
      Parameters:
      password - the new agent password, or null to remove password protection
    • getLimit

      public int getLimit()
      Returns the maximum number of agents with this entry's name that may be participating in sessions simultaneously. Agent limits can be used to prevent agents which require many resources from overwhelming the server.
      Returns:
      the maximum number of instances of this agent that may be in sessions simultaneously, or 0 if there is no limit
    • setLimit

      public void setLimit(int limit)
      Sets the maximum number of agents with this entry's name that may be participating in sessions simultaneously.
      Parameters:
      limit - the maximum number of instances of this agent that may be in sessions simultaneously, or 0 for no limit