Package de.dlr.proseo.prodclmgr.rest
Klasse ProductClassManager
java.lang.Object
de.dlr.proseo.prodclmgr.rest.ProductClassManager
@Component
@Transactional(isolation=REPEATABLE_READ)
public class ProductClassManager
extends Object
Service methods required to manage product classes and their selection rules
- Autor:
- Dr. Thomas Bassler
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibung(Package privat) ProductClassConfiguration
The product class configuration -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungaddProcessorToRule
(String configuredProcessor, Long ruleid, Long id) Add the configured processor to the selection rule (if it is not already part of the selection rule)countProductClasses
(String mission, String[] productType, String[] processorClass, String level, String visibility) Count product classes, optionally filtered by mission and/or product typecreateRestProductClass
(RestProductClass productClass) Create a new product classcreateSelectionRuleString
(Long id, @Valid List<SelectionRuleString> selectionRuleStrings) Create a selection rule using Rule Languagevoid
Delete a product class by ID (with all its selection rules)void
deleteSelectionrule
(Long ruleid, Long id) Delete a selection rulegetProductClassNames
(String mission, String productType) Get the product class names, optionally filtered by mission and/or product typegetRestProductClass
(String mission, String[] productType, String[] processorClass, String level, String visibility, String[] orderBy, Integer recordFrom, Integer recordTo) Get product classes, optionally filtered by mission and/or product typeGet a product class by IDgetSelectionRuleString
(Long ruleid, Long id) Get a selection rule by IDgetSelectionRuleStrings
(Long id, String sourceClass) Get the simple selection rules as formatted string, optionally selected by source classmodifyRestProductClass
(Long id, RestProductClass productClass) Update a product class by ID (does not update its selection rules)modifySelectionRuleString
(Long ruleid, Long id, SelectionRuleString selectionRuleString) Update a selection rule using Rule LanguageremoveProcessorFromRule
(String configuredProcessor, Long ruleid, Long id) Remove the configured processor from the selection rule (the selection rule will be disconnected from the configured processor)
-
Felddetails
-
config
The product class configuration
-
-
Konstruktordetails
-
ProductClassManager
public ProductClassManager()
-
-
Methodendetails
-
getRestProductClass
public List<RestProductClass> getRestProductClass(String mission, String[] productType, String[] processorClass, String level, String visibility, String[] orderBy, Integer recordFrom, Integer recordTo) throws javax.persistence.NoResultException, SecurityException, org.springframework.web.client.HttpClientErrorException.TooManyRequests Get product classes, optionally filtered by mission and/or product type- Parameter:
mission
- the mission codeproductType
- a list of product types as agreed in the mission specification documents (e. g. L2_CLOUD___)processorClass
- a list of processor types capable of producing products from the retrieved product classeslevel
- the required level of processing for the retrieved product classesvisibility
- the visibility of products from the retrieved product classes to external usersorderBy
- an array of strings containing a column name and an optional sort direction (ASC/DESC), separated by white spacerecordFrom
- the first result to returnrecordTo
- the last result to return- Gibt zurück:
- a list of product classes conforming to the search criteria
- Löst aus:
javax.persistence.NoResultException
- if no product classes matching the given search criteria could be foundSecurityException
- if a cross-mission data access was attemptedorg.springframework.web.client.HttpClientErrorException.TooManyRequests
- if the result list would exceed a configured maximum
-
countProductClasses
public String countProductClasses(String mission, String[] productType, String[] processorClass, String level, String visibility) throws javax.persistence.NoResultException, SecurityException Count product classes, optionally filtered by mission and/or product type- Parameter:
mission
- the mission codeproductType
- a list of product types as agreed in the mission specification documents (e. g. L2_CLOUD___)processorClass
- a list of processor types capable of producing products from the retrieved product classeslevel
- the required level of processing for the retrieved product classesvisibility
- the visibility of products from the retrieved product classes to external users- Gibt zurück:
- a list of product classes conforming to the search criteria
- Löst aus:
javax.persistence.NoResultException
- if no product classes matching the given search criteria could be foundSecurityException
- if a cross-mission data access was attempted
-
getProductClassNames
public List<String> getProductClassNames(String mission, String productType) throws javax.persistence.NoResultException, SecurityException Get the product class names, optionally filtered by mission and/or product type- Parameter:
mission
- the mission codeproductType
- a list of product types as agreed in the mission specification documents (e. g. L2_CLOUD___)- Gibt zurück:
- a list of product classes conforming to the search criteria
- Löst aus:
javax.persistence.NoResultException
- if no product classes matching the given search criteria could be foundSecurityException
- if a cross-mission data access was attempted
-
createRestProductClass
public RestProductClass createRestProductClass(RestProductClass productClass) throws IllegalArgumentException, javax.ws.rs.ServerErrorException, SecurityException Create a new product class- Parameter:
productClass
- a Json object describing the new product class- Gibt zurück:
- a Json object describing the product class created (including ID and version) and HTTP status CREATED
- Löst aus:
IllegalArgumentException
- if any of the input data was invalidjavax.ws.rs.ServerErrorException
- if saving the product class to the database failsSecurityException
- if a cross-mission data access was attempted
-
getRestProductClassById
public RestProductClass getRestProductClassById(Long id) throws IllegalArgumentException, javax.persistence.NoResultException, SecurityException Get a product class by ID- Parameter:
id
- the database ID of the product class- Gibt zurück:
- a Json object describing the product class and HTTP status OK
- Löst aus:
IllegalArgumentException
- if no product class ID was givenjavax.persistence.NoResultException
- if no product class with the given ID existsSecurityException
- if a cross-mission data access was attempted
-
modifyRestProductClass
public RestProductClass modifyRestProductClass(Long id, RestProductClass productClass) throws javax.persistence.EntityNotFoundException, IllegalArgumentException, SecurityException, ConcurrentModificationException Update a product class by ID (does not update its selection rules)- Parameter:
id
- the database ID of the product class to updateproductClass
- a Json object describing the product class to modify- Gibt zurück:
- a Json object describing the product class modified (including incremented version)
- Löst aus:
javax.persistence.EntityNotFoundException
- if no product class with the given ID existsIllegalArgumentException
- if any of the input data was invalidSecurityException
- if a cross-mission data access was attemptedConcurrentModificationException
- if the product class has been modified since retrieval by the client
-
deleteProductclassById
public void deleteProductclassById(Long id) throws javax.persistence.EntityNotFoundException, RuntimeException, IllegalArgumentException, SecurityException Delete a product class by ID (with all its selection rules)- Parameter:
id
- the database ID of the product class to delete- Löst aus:
javax.persistence.EntityNotFoundException
- if the processor to delete does not exist in the databaseRuntimeException
- if the deletion was not performed as expectedIllegalArgumentException
- if the product class ID was not given, or if dependent objects existSecurityException
- if a cross-mission data access was attempted
-
getSelectionRuleStrings
public List<SelectionRuleString> getSelectionRuleStrings(Long id, String sourceClass) throws javax.persistence.NoResultException, SecurityException Get the simple selection rules as formatted string, optionally selected by source class- Parameter:
id
- the database ID of the product class to get the selection rule fromsourceClass
- the prosEO product type of the source class, from which the product class can be generated (may be null)- Gibt zurück:
- a list of strings describing the selection rules for all configured processors
- Löst aus:
javax.persistence.NoResultException
- if no simple selection rules matching the given search criteria could be foundSecurityException
- if a cross-mission data access was attempted
-
createSelectionRuleString
public RestProductClass createSelectionRuleString(Long id, @Valid @Valid List<SelectionRuleString> selectionRuleStrings) throws IllegalArgumentException, SecurityException Create a selection rule using Rule Language- Parameter:
id
- the database ID of the product classselectionRuleStrings
- a Json representation of a selection rule in Rule Language- Gibt zurück:
- a Json object representing the simple selection rule created and HTTP status CREATED
- Löst aus:
IllegalArgumentException
- if any of the input data was invalidSecurityException
- if a cross-mission data access was attempted
-
getSelectionRuleString
public SelectionRuleString getSelectionRuleString(Long ruleid, Long id) throws javax.persistence.NoResultException, SecurityException Get a selection rule by ID- Parameter:
ruleid
- the database ID of the simple selection rule to readid
- the database ID of the product class- Gibt zurück:
- a Json object representing the simple selection rule in Rule Language
- Löst aus:
javax.persistence.NoResultException
- if no selection rule or product class with the given ID existSecurityException
- if a cross-mission data access was attempted
-
modifySelectionRuleString
public SelectionRuleString modifySelectionRuleString(Long ruleid, Long id, SelectionRuleString selectionRuleString) throws javax.persistence.EntityNotFoundException, IllegalArgumentException, SecurityException, ConcurrentModificationException Update a selection rule using Rule Language- Parameter:
ruleid
- the database ID of the simple selection rule to updateid
- the database ID of the product classselectionRuleString
- a Json object representing the simple selection rule in Rule Language- Gibt zurück:
- a Json object representing the modified simple selection rule in Rule Language
- Löst aus:
javax.persistence.EntityNotFoundException
- if no selection rule or product class with the given ID existIllegalArgumentException
- if any of the input data was invalidSecurityException
- if a cross-mission data access was attemptedConcurrentModificationException
- if the selection rule has been modified since retrieval by the client
-
deleteSelectionrule
public void deleteSelectionrule(Long ruleid, Long id) throws javax.persistence.EntityNotFoundException, IllegalArgumentException, SecurityException Delete a selection rule- Parameter:
ruleid
- the database ID of the simple selection rule to deleteid
- the database ID of the product class- Löst aus:
javax.persistence.EntityNotFoundException
- if the selection rule to delete or the product class do not exist in the databaseIllegalArgumentException
- if the ID of the product class or the selection rule was not given, or the rule cannot be deleted due to existing product queriesSecurityException
- if a cross-mission data access was attempted
-
addProcessorToRule
public SelectionRuleString addProcessorToRule(String configuredProcessor, Long ruleid, Long id) throws javax.persistence.EntityNotFoundException, IllegalArgumentException, SecurityException Add the configured processor to the selection rule (if it is not already part of the selection rule)- Parameter:
configuredProcessor
- the name of the configured processor to add to the selection ruleruleid
- the database ID of the simple selection ruleid
- the database ID of the product class- Gibt zurück:
- the modified selection rule in Rule Language
- Löst aus:
javax.persistence.EntityNotFoundException
- if no configured processor with the given name or no selection rule or product class with the given ID existIllegalArgumentException
- if the product class ID, the selection rule ID or the name of the configured processor were not givenSecurityException
- if a cross-mission data access was attempted
-
removeProcessorFromRule
public SelectionRuleString removeProcessorFromRule(String configuredProcessor, Long ruleid, Long id) throws javax.persistence.EntityNotFoundException, IllegalArgumentException, SecurityException Remove the configured processor from the selection rule (the selection rule will be disconnected from the configured processor)- Parameter:
configuredProcessor
- the name of the configured processor to remove from the selection ruleruleid
- the database ID of the simple selection ruleid
- the database ID of the product class- Gibt zurück:
- the Json representation of the modified selection rule
- Löst aus:
javax.persistence.EntityNotFoundException
- if no configured processor with the given name or no selection rule or product class with the given ID existIllegalArgumentException
- if the product class ID, the selection rule ID or the name of the configured processor were not givenSecurityException
- if a cross-mission data access was attempted
-