Package i5.las2peer.security
Class BasicAgentStorage
java.lang.Object
i5.las2peer.security.BasicAgentStorage
- All Implemented Interfaces:
AgentStorage
A simple Hashtable based storage for agents.
-
Constructor Summary
ConstructorsConstructorDescriptioncreate a new basic agent storageBasicAgentStorage(AgentStorage backupStorage) create a basic agent storage with a backupStorage to use, if a requested agent is not stored here (i.e. -
Method Summary
Modifier and TypeMethodDescriptionget an agent from this storagebooleandoes this storage know the requested agent? Does not refer to the backup storage if applicablevoidregisterAgent(AgentImpl agent) register an agent for later use use a locked copy to storevoidregisterAgents(AgentImpl... agents) register multiple agents to this storagevoidunregisterAgent(AgentImpl agent) remove an agent from this storagevoidremove an agent from this storage
-
Constructor Details
-
BasicAgentStorage
create a basic agent storage with a backupStorage to use, if a requested agent is not stored here (i.e. aNodeto look for the requested agent in the whole network- Parameters:
backupStorage-
-
BasicAgentStorage
public BasicAgentStorage()create a new basic agent storage
-
-
Method Details
-
registerAgent
register an agent for later use use a locked copy to store- Parameters:
agent-
-
registerAgents
register multiple agents to this storage- Parameters:
agents-
-
unregisterAgent
remove an agent from this storage- Parameters:
agent-
-
unregisterAgent
remove an agent from this storage- Parameters:
id-
-
getAgent
Description copied from interface:AgentStorageget an agent from this storage- Specified by:
getAgentin interfaceAgentStorage- Parameters:
id- the agent id- Returns:
- a new locked Agent instance
- Throws:
AgentNotFoundException- If the agent is not found in this storageAgentException- If any other issue with the agent occurs, e. g. XML not readable
-
hasAgent
Description copied from interface:AgentStoragedoes this storage know the requested agent? Does not refer to the backup storage if applicable- Specified by:
hasAgentin interfaceAgentStorage- Returns:
- true, if this storage knows an agent of the given id
-