Class MissionControllerImpl

java.lang.Object
de.dlr.proseo.ordermgr.rest.MissionControllerImpl
All Implemented Interfaces:
MissionController

@Component public class MissionControllerImpl extends Object implements MissionController
Spring MVC controller for the prosEO Order Manager; implements the services required to manage missions. Handles the HTTP requests related to mission management.
Author:
Ranjitha Vignesh
  • Field Details

    • orderManagerConfig

      @Autowired OrdermgrConfiguration orderManagerConfig
      The Order Manager configuration
    • rtb

      @Autowired org.springframework.boot.web.client.RestTemplateBuilder rtb
      REST template builder
  • Constructor Details

    • MissionControllerImpl

      public MissionControllerImpl()
  • Method Details

    • getMissions

      public org.springframework.http.ResponseEntity<List<RestMission>> getMissions(String missionCode)
      Retrieves a list of all missions or a mission with a specific code.
      Specified by:
      getMissions in interface MissionController
      Parameters:
      missionCode - The code of the mission to retrieve.
      Returns:
      A response entity with either a list of missions and HTTP status OK or an error message and an HTTP status indicating failure.
    • createMission

      public org.springframework.http.ResponseEntity<RestMission> createMission(@Valid @Valid RestMission mission) throws IllegalArgumentException
      Creates a new mission with the provided data.
      Specified by:
      createMission in interface MissionController
      Parameters:
      mission - The JSON object representing the mission to be created.
      Returns:
      A response entity containing the JSON object corresponding to the created mission (with ID and version for all contained objects) and HTTP status "CREATED" or an error message and an HTTP status indicating failure.
      Throws:
      IllegalArgumentException - If any of the input data is invalid.
    • getMissionById

      public org.springframework.http.ResponseEntity<RestMission> getMissionById(Long id)
      Retrieves the mission with the specified ID.
      Specified by:
      getMissionById in interface MissionController
      Parameters:
      id - The ID of the mission to retrieve.
      Returns:
      A response entity corresponding to the found mission and HTTP status "OK", or an error message and HTTP status "NOT_FOUND" if no mission with the given ID exists.
    • modifyMission

      public org.springframework.http.ResponseEntity<RestMission> modifyMission(Long id, @Valid @Valid RestMission mission)
      Updates the mission with the specified ID using the attribute values of the given JSON object.
      Specified by:
      modifyMission in interface MissionController
      Parameters:
      id - The ID of the mission to update.
      mission - A JSON object containing the modified (and unmodified) attributes.
      Returns:
      A response entity containing a JSON object corresponding to the mission after modification (with ID and version for all contained objects) and HTTP status "OK", or HTTP status "FORBIDDEN" and an error message if a cross-mission data access was attempted, or HTTP status "NOT_FOUND" and an error message if no mission with the given ID exists.
    • deleteMissionById

      public org.springframework.http.ResponseEntity<?> deleteMissionById(Long id, Boolean force, Boolean deleteProducts)
      Delete a mission by ID.
      Specified by:
      deleteMissionById in interface MissionController
      Parameters:
      id - the ID of the mission to delete
      force - flag whether to also delete all configured items (but not products)
      deleteProducts - flag whether to also delete all stored products (also from all processing facilities, requires "force")
      Returns:
      a response entity with HTTP status "NO_CONTENT", if the deletion was successful, "BAD_REQUEST" if "deleteProducts" was specified without "force" or if dependent objects exist for the mission, "NOT_FOUND" if the mission did not exist, or "NOT_MODIFIED" if the deletion was unsuccessful