Interface UserAgent

All Superinterfaces:
Agent, PassphraseAgent
All Known Implementing Classes:
BotAgent, EthereumAgent, UserAgentImpl

public interface UserAgent
extends PassphraseAgent
An agent representing a user.
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getEmail()
    Getter for the email address of this user.
    java.lang.String getLoginName()
    Getter for the login name.
    boolean hasEmail()
    Check if the agent has an email address set.
    boolean hasLoginName()
    Check if the agent has a login name set.
    void setEmail​(java.lang.String address)
    Set the email address for this user.
    void setLoginName​(java.lang.String name)
    Set the login name for this user.

    Methods inherited from interface i5.las2peer.api.security.Agent

    getIdentifier, isLocked

    Methods inherited from interface i5.las2peer.api.security.PassphraseAgent

    unlock, unlockPrivateKey
  • Method Details

    • getLoginName

      java.lang.String getLoginName()
      Getter for the login name. Login names are unique in the network.
      Returns:
      The login name.
    • getEmail

      java.lang.String getEmail()
      Getter for the email address of this user. Emails are unique in the network.
      Returns:
      The login name.
    • hasLoginName

      boolean hasLoginName()
      Check if the agent has a login name set.
      Returns:
      true If a login name is set up.
    • hasEmail

      boolean hasEmail()
      Check if the agent has an email address set.
      Returns:
      true If an email address is set up.
    • setLoginName

      void setLoginName​(java.lang.String name) throws AgentLockedException, java.lang.IllegalArgumentException
      Set the login name for this user. Note that user names are unique in the network. The name will be stored and reserved in the network only on Context.storeAgent(i5.las2peer.api.security.Agent). If the name is already taken, the store operation will fail with a LoginNameAlreadyTakenException.
      Parameters:
      name - A user name matching [a-zA-Z].*.
      Throws:
      AgentLockedException - If the agent is locked.
      java.lang.IllegalArgumentException - If the name is of invalid format.
    • setEmail

      void setEmail​(java.lang.String address) throws AgentLockedException, java.lang.IllegalArgumentException
      Set the email address for this user. Note that user names are unique in the network. The address will be stored and reserved in the network only on Context.storeAgent(i5.las2peer.api.security.Agent). If the address is already taken, the store operation will fail with a EmailAlreadyTakenException.
      Parameters:
      address - A valid email address.
      Throws:
      AgentLockedException - If the agent is locked.
      java.lang.IllegalArgumentException - If the email address is of invalid format.