Class ProcessorClassManager

java.lang.Object
de.dlr.proseo.procmgr.rest.ProcessorClassManager

@Component @Transactional(isolation=REPEATABLE_READ) public class ProcessorClassManager extends Object
Service methods required to manage processor classes.
Author:
Dr. Thomas Bassler
  • Field Details

  • Constructor Details

    • ProcessorClassManager

      public ProcessorClassManager()
  • Method Details

    • getProcessorClasses

      public List<RestProcessorClass> getProcessorClasses(String mission, Long id, String[] productClasses, String processorName, Integer recordFrom, Integer recordTo, String[] orderBy) throws jakarta.persistence.NoResultException, SecurityException
      Get processor classes by mission and name
      Parameters:
      mission - the mission code (optional)
      processorName - the processor name (optional)
      recordFrom - first record of filtered and ordered result to return
      recordTo - last record of filtered and ordered result to return
      orderBy - an array of strings containing a column name and an optional sort direction (ASC/DESC), separated by white space
      Returns:
      a list of Json objects representing processor classes satisfying the search criteria
      Throws:
      jakarta.persistence.NoResultException - if no processor classes matching the given search criteria could be found
      SecurityException - if a cross-mission data access was attempted
    • createProcessorClass

      public RestProcessorClass createProcessorClass(@Valid @Valid RestProcessorClass processorClass) throws IllegalArgumentException, SecurityException
      Create a new processor class
      Parameters:
      processorClass - a Json representation of the new processor class
      Returns:
      a Json representation of the processor class after creation (with ID and version number)
      Throws:
      IllegalArgumentException - if any of the input data was invalid
      SecurityException - if a cross-mission data access was attempted
    • getProcessorClassById

      public RestProcessorClass getProcessorClassById(Long id) throws IllegalArgumentException, jakarta.persistence.NoResultException, SecurityException
      Get a processor class by ID
      Parameters:
      id - the processor class ID
      Returns:
      a Json object corresponding to the processor class found
      Throws:
      IllegalArgumentException - if no processor class ID was given
      jakarta.persistence.NoResultException - if no processor class with the given ID exists
      SecurityException - if a cross-mission data access was attempted
    • modifyProcessorClass

      public RestProcessorClass modifyProcessorClass(Long id, @Valid @Valid RestProcessorClass processorClass) throws jakarta.persistence.EntityNotFoundException, IllegalArgumentException, SecurityException, ConcurrentModificationException
      Update a processor class by ID
      Parameters:
      id - the ID of the processor class to update
      processorClass - a Json object containing the modified (and unmodified) attributes
      Returns:
      a response containing a Json object corresponding to the processor class after modification (with ID and version for all contained objects)
      Throws:
      jakarta.persistence.EntityNotFoundException - if no processor class with the given ID exists
      IllegalArgumentException - if any of the input data was invalid
      SecurityException - if a cross-mission data access was attempted
      ConcurrentModificationException - if the processor class has been modified since retrieval by the client
    • deleteProcessorClassById

      public void deleteProcessorClassById(Long id) throws jakarta.persistence.EntityNotFoundException, RuntimeException, IllegalArgumentException, SecurityException
      Delete a processor class by ID
      Parameters:
      id - the ID of the processor class to delete
      Throws:
      jakarta.persistence.EntityNotFoundException - if the processor class to delete does not exist in the database
      RuntimeException - if the deletion was not performed as expected
      IllegalArgumentException - if the ID of the processor class to delete was not given, or if dependent objects exist
      SecurityException - if a cross-mission data access was attempted
    • countProcessorClasses

      public String countProcessorClasses(String missionCode, Long id, String[] productClasses, String processorName)
      Count the processor classes matching the specified mission or processorName.
      Parameters:
      missionCode - the mission code
      processorName - the processor name
      Returns:
      the number of processor classes found as string
      Throws:
      SecurityException - if a cross-mission data access was attempted