Package i5.las2peer.security
Class UserAgentManager
java.lang.Object
i5.las2peer.security.UserAgentManager
Maps usernames and emails to
UserAgentImpl
s.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAgentId
(String prefixedIdentifier) Get agent ID for a prefixed identifier, i.e., a string consisting of one of the prefixes defined in this class and the corresponding attribute (e.g., email address).getAgentIdByEmail
(String email) get anUserAgentImpl
's id by email addressgetAgentIdByGroupName
(String groupName) get anGroupAgentImpl
's id by group namegetAgentIdByLogin
(String name) get anUserAgentImpl
's id by login nameGets anUserAgentImpl
's id by OIDC sub.void
registerGroupAgent
(GroupAgent agent) Stores group name of a group agent to the networkvoid
registerOIDCSub
(UserAgentImpl agent, String sub) Stores OIDC sub of an user agent to the networkvoid
registerUserAgent
(UserAgent agent) Stores login name and email of an user agent to the network
-
Constructor Details
-
UserAgentManager
-
-
Method Details
-
registerUserAgent
public void registerUserAgent(UserAgent agent) throws EmailAlreadyTakenException, LoginNameAlreadyTakenException, AgentLockedException Stores login name and email of an user agent to the network- Parameters:
agent
- an unlocked UserAgent- Throws:
EmailAlreadyTakenException
- If the given email is already in use by another agentLoginNameAlreadyTakenException
- If the given login name is already in use by another agentAgentLockedException
- If the given agent is not unlocked
-
registerGroupAgent
public void registerGroupAgent(GroupAgent agent) throws LoginNameAlreadyTakenException, NameAlreadyBoundException, AgentLockedException Stores group name of a group agent to the network- Parameters:
agent
- an unlocked GroupAgent- Throws:
AgentLockedException
- If the given agent is not unlockedLoginNameAlreadyTakenException
NameAlreadyBoundException
-
registerOIDCSub
public void registerOIDCSub(UserAgentImpl agent, String sub) throws OIDCSubAlreadyTakenException, AgentLockedException Stores OIDC sub of an user agent to the network- Parameters:
agent
- an unlocked UserAgentsub
- The OIDC sub to register for this agent- Throws:
OIDCSubAlreadyTakenException
- If the given OIDC sub is already registeredAgentLockedException
- If the given agent is not unlocked
-
getAgentId
public String getAgentId(String prefixedIdentifier) throws AgentNotFoundException, AgentOperationFailedException Get agent ID for a prefixed identifier, i.e., a string consisting of one of the prefixes defined in this class and the corresponding attribute (e.g., email address).- Parameters:
prefixedIdentifier
-- Returns:
- agent ID
- Throws:
AgentNotFoundException
AgentOperationFailedException
-
getAgentIdByLogin
public String getAgentIdByLogin(String name) throws AgentNotFoundException, AgentOperationFailedException get anUserAgentImpl
's id by login name- Parameters:
name
-- Returns:
- the id of the agent
- Throws:
AgentNotFoundException
- If no agent for the given login is foundAgentOperationFailedException
- If any other issue with the agent occurs, e. g. XML not readable
-
getAgentIdByEmail
public String getAgentIdByEmail(String email) throws AgentNotFoundException, AgentOperationFailedException get anUserAgentImpl
's id by email address- Parameters:
email
-- Returns:
- the id of the agent
- Throws:
AgentNotFoundException
- If no agent for the given email is foundAgentOperationFailedException
- If any other issue with the agent occurs, e. g. XML not readable
-
getAgentIdByOIDCSub
public String getAgentIdByOIDCSub(String sub) throws AgentNotFoundException, AgentOperationFailedException Gets anUserAgentImpl
's id by OIDC sub.- Parameters:
sub
- The OIDC sub to identify the user.- Returns:
- The id of the agent
- Throws:
AgentNotFoundException
- If no agent for the given sub is foundAgentOperationFailedException
- If any other issue with the agent occurs, e. g. XML not readable
-
getAgentIdByGroupName
public String getAgentIdByGroupName(String groupName) throws AgentNotFoundException, AgentOperationFailedException get anGroupAgentImpl
's id by group name- Parameters:
groupName
-- Returns:
- the id of the agent
- Throws:
AgentNotFoundException
- If no agent for the given login is foundAgentOperationFailedException
- If any other issue with the agent occurs, e. g. XML not readable
-