Package de.dlr.proseo.procmgr.rest
Class ProcessorManager
java.lang.Object
de.dlr.proseo.procmgr.rest.ProcessorManager
Service methods required to manage processor versions.
- Author:
- Dr. Thomas Bassler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncountProcessors(Long id, String missionCode, String processorName, String processorVersion) Count the processors matching the specified mission, processorName, or processorVersioncreateProcessor(RestProcessor processor) Create a new processor (version)voidDelete a processor by IDgetProcessorById(Long id) Get a processor by IDgetProcessors(Long id, String mission, String processorName, String processorVersion, Integer recordFrom, Integer recordTo, String[] orderBy) Get processors by mission, name and version (user-defined version, not database version)modifyProcessor(Long id, @Valid RestProcessor processor) Update a processor by ID
-
Constructor Details
-
ProcessorManager
public ProcessorManager()
-
-
Method Details
-
createProcessor
public RestProcessor createProcessor(RestProcessor processor) throws IllegalArgumentException, SecurityException Create a new processor (version)- Parameters:
processor- a Json representation of the new processor- Returns:
- a Json representation of the processor after creation (with ID and version number)
- Throws:
IllegalArgumentException- if any of the input data was invalidSecurityException- if a cross-mission data access was attempted
-
getProcessors
public List<RestProcessor> getProcessors(Long id, String mission, String processorName, String processorVersion, Integer recordFrom, Integer recordTo, String[] orderBy) throws jakarta.persistence.NoResultException, SecurityException Get processors by mission, name and version (user-defined version, not database version)- Parameters:
mission- the mission codeprocessorName- the name of the processor (class)processorVersion- the processor versionrecordFrom- first record of filtered and ordered result to returnrecordTo- last record of filtered and ordered result to returnorderBy- 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 processors satisfying the search criteria
- Throws:
jakarta.persistence.NoResultException- if no processors matching the given search criteria could be foundSecurityException- if a cross-mission data access was attempted
-
getProcessorById
public RestProcessor getProcessorById(Long id) throws IllegalArgumentException, jakarta.persistence.NoResultException, SecurityException Get a processor by ID- Parameters:
id- the processor ID- Returns:
- a Json object corresponding to the processor found
- Throws:
IllegalArgumentException- if no processor ID was givenjakarta.persistence.NoResultException- if no processor with the given ID existsSecurityException- if a cross-mission data access was attempted
-
modifyProcessor
public RestProcessor modifyProcessor(Long id, @Valid @Valid RestProcessor processor) throws jakarta.persistence.EntityNotFoundException, IllegalArgumentException, SecurityException, ConcurrentModificationException Update a processor by ID- Parameters:
id- the ID of the processor to updateprocessor- a Json object containing the modified (and unmodified) attributes- Returns:
- a response containing a Json object corresponding to the processor after modification (with ID and version for all contained objects)
- Throws:
jakarta.persistence.EntityNotFoundException- if no processor with the given ID existsIllegalArgumentException- if any of the input data was invalidSecurityException- if a cross-mission data access was attemptedConcurrentModificationException- if the processor has been modified since retrieval by the client
-
deleteProcessorById
public void deleteProcessorById(Long id) throws jakarta.persistence.EntityNotFoundException, RuntimeException, IllegalArgumentException, SecurityException Delete a processor by ID- Parameters:
id- the ID of the processor to delete- Throws:
jakarta.persistence.EntityNotFoundException- if the processor to delete does not exist in the databaseRuntimeException- if the deletion was not performed as expectedIllegalArgumentException- if the ID of the processor to delete was not given, or if dependent objects existSecurityException- if a cross-mission data access was attempted
-
countProcessors
public String countProcessors(Long id, String missionCode, String processorName, String processorVersion) Count the processors matching the specified mission, processorName, or processorVersion- Parameters:
missionCode- the mission codeprocessorName- the processor nameprocessorVersion- the processor version- Returns:
- the number of processors found as string
- Throws:
SecurityException- if a cross-mission data access was attempted
-