Klasse ProcessorManager

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

@Component @Transactional(isolation=REPEATABLE_READ) public class ProcessorManager extends Object
Service methods required to manage processor versions.
Autor:
Dr. Thomas Bassler
  • Konstruktordetails

    • ProcessorManager

      public ProcessorManager()
  • Methodendetails

    • createProcessor

      public RestProcessor createProcessor(RestProcessor processor) throws IllegalArgumentException, SecurityException
      Create a new processor (version)
      Parameter:
      processor - a Json representation of the new processor
      Gibt zurück:
      a Json representation of the processor after creation (with ID and version number)
      Löst aus:
      IllegalArgumentException - if any of the input data was invalid
      SecurityException - if a cross-mission data access was attempted
    • getProcessors

      public List<RestProcessor> getProcessors(String mission, String processorName, String processorVersion, Integer recordFrom, Integer recordTo) throws javax.persistence.NoResultException, SecurityException
      Get processors by mission, name and version (user-defined version, not database version)
      Parameter:
      mission - the mission code
      processorName - the name of the processor (class)
      processorVersion - the processor version
      recordFrom - first record of filtered and ordered result to return
      recordTo - last record of filtered and ordered result to return
      Gibt zurück:
      a list of Json objects representing processors satisfying the search criteria
      Löst aus:
      javax.persistence.NoResultException - if no processors matching the given search criteria could be found
      SecurityException - if a cross-mission data access was attempted
    • getProcessorById

      public RestProcessor getProcessorById(Long id) throws IllegalArgumentException, javax.persistence.NoResultException, SecurityException
      Get a processor by ID
      Parameter:
      id - the processor ID
      Gibt zurück:
      a Json object corresponding to the processor found
      Löst aus:
      IllegalArgumentException - if no processor ID was given
      javax.persistence.NoResultException - if no processor with the given ID exists
      SecurityException - if a cross-mission data access was attempted
    • modifyProcessor

      public RestProcessor modifyProcessor(Long id, @Valid @Valid RestProcessor processor) throws javax.persistence.EntityNotFoundException, IllegalArgumentException, SecurityException, ConcurrentModificationException
      Update a processor by ID
      Parameter:
      id - the ID of the processor to update
      processor - a Json object containing the modified (and unmodified) attributes
      Gibt zurück:
      a response containing a Json object corresponding to the processor after modification (with ID and version for all contained objects)
      Löst aus:
      javax.persistence.EntityNotFoundException - if no processor 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 has been modified since retrieval by the client
    • deleteProcessorById

      public void deleteProcessorById(Long id) throws javax.persistence.EntityNotFoundException, RuntimeException, IllegalArgumentException, SecurityException
      Delete a processor by ID
      Parameter:
      id - the ID of the processor to delete
      Löst aus:
      javax.persistence.EntityNotFoundException - if the processor to delete does not exist in the database
      RuntimeException - if the deletion was not performed as expected
      IllegalArgumentException - if the ID of the processor to delete was not given, or if dependent objects exist
      SecurityException - if a cross-mission data access was attempted
    • countProcessors

      public String countProcessors(String missionCode, String processorName, String processorVersion)
      Count the processors matching the specified mission, processorName, or processorVersion
      Parameter:
      missionCode - the mission code
      processorName - the processor name
      processorVersion - the processor version
      Gibt zurück:
      the number of processors found as string
      Löst aus:
      SecurityException - if a cross-mission data access was attempted