Klasse ConfigurationManager

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

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

  • Konstruktordetails

    • ConfigurationManager

      public ConfigurationManager()
  • Methodendetails

    • getConfigurations

      public List<RestConfiguration> getConfigurations(String mission, String processorName, String configurationVersion, Integer recordFrom, Integer recordTo) throws javax.persistence.NoResultException, SecurityException
      Get configurations by mission, processor name and configuration version
      Parameter:
      mission - the mission code
      processorName - the name of the processor class this configuration belongs to
      configurationVersion - the configuration 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 configurations satisfying the search criteria
      Löst aus:
      javax.persistence.NoResultException - if no processor classes matching the given search criteria could be found
      SecurityException - if a cross-mission data access was attempted
    • createConfiguration

      public RestConfiguration createConfiguration(@Valid @Valid RestConfiguration configuration) throws IllegalArgumentException, SecurityException
      Create a new configuration
      Parameter:
      configuration - a Json representation of the new configuration
      Gibt zurück:
      a Json representation of the configuration 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
    • getConfigurationById

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

      public RestConfiguration modifyConfiguration(Long id, @Valid @Valid RestConfiguration configuration) throws javax.persistence.EntityNotFoundException, IllegalArgumentException, SecurityException, ConcurrentModificationException
      Update a configuration by ID
      Parameter:
      id - the ID of the configuration to update
      configuration - a Json object containing the modified (and unmodified) attributes
      Gibt zurück:
      a response containing a Json object corresponding to the configuration after modification (with ID and version for all contained objects)
      Löst aus:
      javax.persistence.EntityNotFoundException - if no configuration with the given ID exists
      IllegalArgumentException - if any of the input data was invalid
      ConcurrentModificationException - if the configuration has been modified since retrieval by the client
      SecurityException - if a cross-mission data access was attempted
    • deleteConfigurationById

      public void deleteConfigurationById(Long id) throws javax.persistence.EntityNotFoundException, RuntimeException, IllegalArgumentException, SecurityException
      Delete a configuration by ID
      Parameter:
      id - the ID of the configuration to delete
      Löst aus:
      javax.persistence.EntityNotFoundException - if the configuration 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
    • countConfigurations

      public String countConfigurations(String missionCode, String processorName, String configurationVersion)
      Count the configurations matching the specified mission, processorName, or configurationVersion
      Parameter:
      missionCode - the mission code
      processorName - the name of the processor class this configuration belongs to
      configurationVersion - the configuration version
      Gibt zurück:
      the number of configurations found as string
      Löst aus:
      SecurityException - if a cross-mission data access was attempted