Package de.dlr.proseo.facmgr.rest
Class FacmgrControllerImpl
java.lang.Object
de.dlr.proseo.facmgr.rest.FacmgrControllerImpl
- All Implemented Interfaces:
FacilityController
Spring MVC controller for the prosEO Facility Manager; implements the
services required to manage processing facilities
- Author:
- Ranjitha Vignesh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<RestProcessingFacility> createFacility(RestProcessingFacility restFacility) Create a facility from the given Json objectorg.springframework.http.ResponseEntity<?> Delete a facility by IDorg.springframework.http.ResponseEntity<List<RestProcessingFacility>> getFacilities(String name) Retrieve a list of facilities filtered by mission and name.org.springframework.http.ResponseEntity<RestProcessingFacility> getFacilityById(Long id) Find the facility with the given IDorg.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.
-
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:
createFacilityin interfaceFacilityController- 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:
getFacilitiesin interfaceFacilityController- 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
Find the facility with the given ID- Specified by:
getFacilityByIdin interfaceFacilityController- 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
Delete a facility by ID- Specified by:
deleteFacilityByIdin interfaceFacilityController- 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:
modifyFacilityin interfaceFacilityController- Parameters:
id- the ID of the facility to updaterestFacility- 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
-