Class FacmgrControllerImpl

java.lang.Object
de.dlr.proseo.facmgr.rest.FacmgrControllerImpl
All Implemented Interfaces:
FacilityController

@Component public class FacmgrControllerImpl extends Object implements FacilityController
Spring MVC controller for the prosEO Facility Manager; implements the services required to manage processing facilities
Author:
Ranjitha Vignesh
  • Constructor Details

    • FacmgrControllerImpl

      public FacmgrControllerImpl()
  • Method Details

    • createFacility

      public org.springframework.http.ResponseEntity<RestProcessingFacility> createFacility(RestProcessingFacility restFacility)
      Create a facility from the given Json object
      Specified by:
      createFacility in interface FacilityController
      Parameters:
      restFacility - the Json object to create the facility from
      Returns:
      HTTP status "CREATED" and a response containing a Json object corresponding to the facility after persistence (with ID and version for all contained objects) or HTTP status "BAD_REQUEST", if any of the input data was invalid
    • getFacilities

      public org.springframework.http.ResponseEntity<List<RestProcessingFacility>> getFacilities(String name)
      Retrieve a list of facilities filtered by mission and name.
      Specified by:
      getFacilities in interface FacilityController
      Parameters:
      name - the name of the facility
      Returns:
      a response entity with either a list of facilities and HTTP status "OK" or an error message and HTTP status "NOT_FOUND" if no matching facilities were found
    • getFacilityById

      public org.springframework.http.ResponseEntity<RestProcessingFacility> getFacilityById(Long id)
      Find the facility with the given ID
      Specified by:
      getFacilityById in interface FacilityController
      Parameters:
      id - the ID to look for
      Returns:
      a response entity corresponding to the found facility and HTTP status "OK" or an error message and HTTP status "NOT_FOUND", if no facility with the given ID exists
    • deleteFacilityById

      public org.springframework.http.ResponseEntity<?> deleteFacilityById(Long id)
      Delete a facility by ID
      Specified by:
      deleteFacilityById in interface FacilityController
      Parameters:
      id - the ID of the facility to delete
      Returns:
      a response entity with HTTP status "NO_CONTENT", if the deletion was successful, "BAD_REQUEST", if the facility still has stored products, "NOT_FOUND", if the facility did not exist, or "NOT_MODIFIED", if the deletion was unsuccessful
    • modifyFacility

      public org.springframework.http.ResponseEntity<RestProcessingFacility> modifyFacility(Long id, RestProcessingFacility restFacility)
      Update the facility with the given ID with the attribute values of the given Json object. Both modified and unmodified attributes need to be provided.
      Specified by:
      modifyFacility in interface FacilityController
      Parameters:
      id - the ID of the facility to update
      restFacility - a Json object containing the modified and unmodified attributes
      Returns:
      a response containing HTTP status "OK" and a Json object corresponding to the facility after modification (with ID and version for all contained objects) or HTTP status "NOT_MODIFIED" and the unchanged facility, if no attributes were actually changed, or HTTP status "NOT_FOUND" and an error message, if no facility with the given ID exists