Package i5.las2peer.api.security
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.StringgetEmail()Getter for the email address of this user.java.lang.StringgetLoginName()Getter for the login name.booleanhasEmail()Check if the agent has an email address set.booleanhasLoginName()Check if the agent has a login name set.voidsetEmail(java.lang.String address)Set the email address for this user.voidsetLoginName(java.lang.String name)Set the login name for this user.
-
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.IllegalArgumentExceptionSet 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 onContext.storeAgent(i5.las2peer.api.security.Agent). If the name is already taken, the store operation will fail with aLoginNameAlreadyTakenException.- 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.IllegalArgumentExceptionSet 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 onContext.storeAgent(i5.las2peer.api.security.Agent). If the address is already taken, the store operation will fail with aEmailAlreadyTakenException.- Parameters:
address- A valid email address.- Throws:
AgentLockedException- If the agent is locked.java.lang.IllegalArgumentException- If the email address is of invalid format.
-