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
  • Felddetails

  • 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 code
      productType - 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 classes
      level - the required level of processing for the retrieved product classes
      visibility - the visibility of products from the retrieved product classes to external users
      orderBy - an array of strings containing a column name and an optional sort direction (ASC/DESC), separated by white space
      recordFrom - the first result to return
      recordTo - 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 found
      SecurityException - if a cross-mission data access was attempted
      org.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 code
      productType - 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 classes
      level - the required level of processing for the retrieved product classes
      visibility - 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 found
      SecurityException - 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 code
      productType - 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 found
      SecurityException - 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 invalid
      javax.ws.rs.ServerErrorException - if saving the product class to the database fails
      SecurityException - 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 given
      javax.persistence.NoResultException - if no product class with the given ID exists
      SecurityException - 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 update
      productClass - 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 exists
      IllegalArgumentException - if any of the input data was invalid
      SecurityException - if a cross-mission data access was attempted
      ConcurrentModificationException - 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 database
      RuntimeException - if the deletion was not performed as expected
      IllegalArgumentException - if the product class ID was not given, or if dependent objects exist
      SecurityException - 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 from
      sourceClass - 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 found
      SecurityException - 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 class
      selectionRuleStrings - 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 invalid
      SecurityException - 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 read
      id - 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 exist
      SecurityException - 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 update
      id - the database ID of the product class
      selectionRuleString - 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 exist
      IllegalArgumentException - if any of the input data was invalid
      SecurityException - if a cross-mission data access was attempted
      ConcurrentModificationException - 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 delete
      id - 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 database
      IllegalArgumentException - if the ID of the product class or the selection rule was not given, or the rule cannot be deleted due to existing product queries
      SecurityException - 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 rule
      ruleid - the database ID of the simple selection rule
      id - 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 exist
      IllegalArgumentException - if the product class ID, the selection rule ID or the name of the configured processor were not given
      SecurityException - 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 rule
      ruleid - the database ID of the simple selection rule
      id - 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 exist
      IllegalArgumentException - if the product class ID, the selection rule ID or the name of the configured processor were not given
      SecurityException - if a cross-mission data access was attempted