Class FacmgrManager

java.lang.Object
de.dlr.proseo.facmgr.rest.FacmgrManager

@Component @Transactional(isolation=REPEATABLE_READ) public class FacmgrManager extends Object
Service methods required to create, modify and delete processing facility in the prosEO database, and to query the database about such facilities
Author:
Ranjitha Vignesh
  • Constructor Details

    • FacmgrManager

      public FacmgrManager()
  • Method Details

    • createFacility

      public RestProcessingFacility createFacility(RestProcessingFacility restFacility) throws IllegalArgumentException
      Create a processing facility with the specified attributes in the database.
      Parameters:
      restFacility - The ProcessingFacility to create in REST format
      Returns:
      The created RestProcessingFacility
      Throws:
      IllegalArgumentException - in case of invalid input data
    • getFacility

      public List<RestProcessingFacility> getFacility(String name) throws jakarta.persistence.NoResultException
      Retrieve a list of facilities filtered by mission and name.
      Parameters:
      name - the name of the facility
      Returns:
      a list of facilities matching mission and name
      Throws:
      jakarta.persistence.NoResultException - if no facilities matching the given search criteria could be found
    • getFacilityById

      public RestProcessingFacility getFacilityById(Long id) throws IllegalArgumentException, jakarta.persistence.NoResultException
      Find the facility with the given ID.
      Parameters:
      id - the ID to look for
      Returns:
      a Json object corresponding to the facility found
      Throws:
      IllegalArgumentException - if no facility ID was given
      jakarta.persistence.NoResultException - if no facility with the given ID exists
    • modifyFacility

      public RestProcessingFacility modifyFacility(Long id, RestProcessingFacility restFacility) throws IllegalArgumentException, jakarta.persistence.EntityNotFoundException, ConcurrentModificationException
      Update the facility with the given ID with the attribute values of the given Json object. Unchanged values must be provided, too, or they will be changed to null.
      Parameters:
      id - the ID of the facility to update
      restFacility - a Json object containing the modified and unmodified attributes
      Returns:
      a Json object corresponding to the facility after modification (with ID and version for all contained objects)
      Throws:
      jakarta.persistence.EntityNotFoundException - if no facility with the given ID exists
      IllegalArgumentException - if any of the input data was invalid
      ConcurrentModificationException - if the facility has been modified since retrieval by the client
    • deleteFacilityById

      public void deleteFacilityById(Long id) throws jakarta.persistence.EntityNotFoundException, IllegalArgumentException, RuntimeException
      Delete the facility with the given ID.
      Parameters:
      id - the ID of the facility to delete
      Throws:
      jakarta.persistence.EntityNotFoundException - if the facility to delete does not exist in the database
      IllegalArgumentException - if the facility to delete still has stored products
      RuntimeException - if the deletion was not performed as expected