Interface MissionDao

All Known Implementing Classes:
MongoMissionDao

public interface MissionDao
Created by davidjbrooks on 11/24/18.
  • Method Details

    • getMissions

      Pagination<Mission> getMissions(int offset, int count, List<String> tags)
      Gets missions specifying the offset and the count.
      Parameters:
      offset - the offset
      count - the count
      tags -
      Returns:
      a Pagination of Mission objects.
    • getMissions

      Pagination<Mission> getMissions(int offset, int count, String search)
      Gets missions specifying the offset and the count, specifying a search filter.
      Parameters:
      offset - the offset
      count - the count
      search - a query to filter the results
      Returns:
      a Pagination of Mission objects.
    • getMissionsMatching

      List<Mission> getMissionsMatching(Collection<String> missionNamesOrIds)
      Gets all Missions matching the list of names or ids.
      Parameters:
      missionNamesOrIds - a list containing missions or ids
      Returns:
      the List<Mission>
    • findMissionByNameOrId

      Optional<Mission> findMissionByNameOrId(String missionNameOrId)
    • getMissionByNameOrId

      default Mission getMissionByNameOrId(String missionNameOrId)
      Gets the mission with the id, or throws a NotFoundException if the mission can't be found.
      Returns:
      the Mission that was requested, never null
    • updateMission

      Mission updateMission(Mission mission)
      Updates the mission, or throws a NotFoundException if the mission can't be found. The Mission.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

      Mission createMission(Mission mission)
      Creates a mission. The value of Mission.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 invalid
      DuplicateException - if the passed in Mission has a name that already exists
    • deleteMission

      void deleteMission(String missionId)
      Deletes a mission.
      Parameters:
      missionId - the mission ID