forked from p34709852/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`
|
||||
"""
|
||||
|
||||
@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
|
||||
def get_agent_by_id(self, agent_id: AgentID) -> Agent:
|
||||
"""
|
||||
|
|
|
@ -38,6 +38,9 @@ class MongoAgentRepository(IAgentRepository):
|
|||
f"but no agents were inserted"
|
||||
)
|
||||
|
||||
def get_agents(self) -> Sequence[Agent]:
|
||||
return []
|
||||
|
||||
def get_agent_by_id(self, agent_id: AgentID) -> Agent:
|
||||
try:
|
||||
agent_dict = self._agents_collection.find_one(
|
||||
|
|
Loading…
Reference in New Issue