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.voiddeleteMission(String missionId) Deletes a mission.findMissionByNameOrId(String missionNameOrId) default MissiongetMissionByNameOrId(String missionNameOrId) Gets the mission with the id, or throws aNotFoundExceptionif 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 allMissions matching the list of names or ids.updateMission(Mission mission) Updates the mission, or throws aNotFoundExceptionif 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
PaginationofMissionobjects.
-
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
PaginationofMissionobjects.
-
getMissionsMatching
Gets allMissions matching the list of names or ids. -
findMissionByNameOrId
-
getMissionByNameOrId
Gets the mission with the id, or throws aNotFoundExceptionif the mission can't be found.- Returns:
- the
Missionthat was requested, never null
-
updateMission
Updates the mission, or throws aNotFoundExceptionif the mission can't be found. TheMission.getId()is used to key the mission being updated.- Returns:
- the
Missionas 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
Missionas 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
-