forked from p15670423/monkey
Island: Add IAgentRepository.get_agents()
This commit is contained in:
parent
61bda27d7f
commit
84f21b0c1d
|
@ -19,6 +19,15 @@ class IAgentRepository(ABC):
|
||||||
:raises StorageError: If an error occurs while attempting to store the `Agent`
|
:raises StorageError: If an error occurs while attempting to store the `Agent`
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def get_agents(self) -> Sequence[Agent]:
|
||||||
|
"""
|
||||||
|
Get all `Agents` stored in the repository
|
||||||
|
|
||||||
|
:return: All agents in the repository
|
||||||
|
:raises RetrievalError: If an error occurs while attempting to retrieve the `Agents`
|
||||||
|
"""
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def get_agent_by_id(self, agent_id: AgentID) -> Agent:
|
def get_agent_by_id(self, agent_id: AgentID) -> Agent:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -38,6 +38,9 @@ class MongoAgentRepository(IAgentRepository):
|
||||||
f"but no agents were inserted"
|
f"but no agents were inserted"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get_agents(self) -> Sequence[Agent]:
|
||||||
|
return []
|
||||||
|
|
||||||
def get_agent_by_id(self, agent_id: AgentID) -> Agent:
|
def get_agent_by_id(self, agent_id: AgentID) -> Agent:
|
||||||
try:
|
try:
|
||||||
agent_dict = self._agents_collection.find_one(
|
agent_dict = self._agents_collection.find_one(
|
||||||
|
|
Loading…
Reference in New Issue