Package dev.getelements.elements.sdk.dao
Interface MissionDao
- All Known Implementing Classes:
MongoMissionDao
public interface MissionDao
Created by davidjbrooks on 11/24/18.
-
Method Summary
Modifier and TypeMethodDescriptioncreateMission
(Mission mission) Creates a mission.void
deleteMission
(String missionId) Deletes a mission.findMissionByNameOrId
(String missionNameOrId) default Mission
getMissionByNameOrId
(String missionNameOrId) Gets the mission with the id, or throws aNotFoundException
if the mission can't be found.getMissions
(int offset, int count, String search) Gets missions specifying the offset and the count, specifying a search filter.getMissions
(int offset, int count, List<String> tags) Gets missions specifying the offset and the count.getMissionsMatching
(Collection<String> missionNamesOrIds) Gets allMission
s matching the list of names or ids.updateMission
(Mission mission) Updates the mission, or throws aNotFoundException
if the mission can't be found.
-
Method Details
-
getMissions
Gets missions specifying the offset and the count.- Parameters:
offset
- the offsetcount
- the counttags
-- Returns:
- a
Pagination
ofMission
objects.
-
getMissions
Gets missions specifying the offset and the count, specifying a search filter.- Parameters:
offset
- the offsetcount
- the countsearch
- a query to filter the results- Returns:
- a
Pagination
ofMission
objects.
-
getMissionsMatching
Gets allMission
s matching the list of names or ids. -
findMissionByNameOrId
-
getMissionByNameOrId
Gets the mission with the id, or throws aNotFoundException
if the mission can't be found.- Returns:
- the
Mission
that was requested, never null
-
updateMission
Updates the mission, or throws aNotFoundException
if the mission can't be found. TheMission.getId()
is used to key the mission being updated.- Returns:
- the
Mission
as it was written into the database - Throws:
InvalidDataException
- if the state of the passed in Mission is invalid
-
createMission
Creates a mission. The value ofMission.getId()
will be ignored.- Returns:
- the
Mission
as it was written into the database - Throws:
InvalidDataException
- if the state of the passed in Mission is invalidDuplicateException
- if the passed in Mission has a name that already exists
-
deleteMission
Deletes a mission.- Parameters:
missionId
- the mission ID
-