Interface ImportSourceConfigurationFacade

All Known Implementing Classes:
ImportSourceConfigurationFacadeImpl

@PublicApi public interface ImportSourceConfigurationFacade
Service for handling configuration of import sources and import configuration
Since:
5.0
  • Method Details

    • findImportSourcesBySchema

      List<ImportSource> findImportSourcesBySchema(Integer objectSchemaId) throws InsightException
      Finds all import source configurations by the given object schema id.
      Returns:
      The import sources in the list will have all passwords masked see loadImportSource(Integer)
      Throws:
      InsightException
    • findImportSourcesForObjectTypeId

      List<ImportSource> findImportSourcesForObjectTypeId(Integer objectTypeId) throws InsightException
      Finds all the import sources where the specified object type id is used in any object type mapping configuration.
      Returns:
      A list of import source configurations where each import source contains a ImportSourceOT configuration with the ObjectTypeBean specified by the argument. The import sources in the list will have all passwords masked see loadImportSource(Integer)
      Throws:
      InsightException
    • findImportSourcesByModule

      List<ImportSource> findImportSourcesByModule(String moduleKey) throws InsightException
      Finds import sources for a specific import module type (each integration module specifies it's own type with a module key e.g. AWS integration specifies insight-aws-import as the module key)
      Returns:
      The import sources in the list will have all passwords masked see loadImportSource(Integer)
      Throws:
      InsightException
    • findImportSourcesByModuleAndSchemaId

      List<ImportSource> findImportSourcesByModuleAndSchemaId(String moduleKey, Integer objectSchemaId) throws InsightException
      Finds import sources for a specific import module type (each integration module specifies it's own type with a module key e.g. AWS integration specifies insight-aws-import as the module key) and a given object schema id
      Returns:
      The import sources in the list will have all passwords masked see loadImportSource(Integer)
      Throws:
      InsightException
    • loadImportSource

      ImportSource loadImportSource(Integer importSourceId) throws InsightException
      Loads the ImportSource from the database and validates it if it is ready to be synchronised. If the ImportSource is invalid this method will throw a ValidationInsightException rather than returning an Invalid import source. Note that the validation state of the import source will be persisted to the database. I.e. a call to this function will update the stored import source with the current validation status
      Returns:
      an import source that can be used to run an import with all validations passed. The resulting import source will have all password fields in the ImportSource.getJsonConfiguration() removed. In other words all password fields (both name and value in the json config) will be missing. To get the password fields (names and masked values) use the loadImportSourceWithMaskedPasswords(Integer) instead.
      Throws:
      InsightException - / ValidationInsightException if the ImportSource is not valid.
    • passwordFieldNamesInModuleConfig

      List<String> passwordFieldNamesInModuleConfig(Integer importSourceId) throws InsightException
      Retrieves a list of all the keys (the json names) in the ImportSource.getJsonConfiguration() that represents a password field for the given import source. The password fields are masked in the fetched import source as described in loadImportSourceWithMaskedPasswords(Integer)
      Throws:
      InsightException
    • loadImportSourceWithMaskedPasswords

      ImportSource loadImportSourceWithMaskedPasswords(Integer importSourceId) throws InsightException
      Loads the ImportSource from the database and validate if it is ready to be synchronised. If the ImportSource is invalid this method will throw a ValidationInsightException rather than returning an Invalid import source. Note that the validation state of the import source will be persisted to the database. I.e. a call to this function will update the stored import source with the current validation status
      Returns:
      an import source that can be used to run an import with all validations passed. The resulting import source will have all password fields in the ImportSource.getJsonConfiguration() masked. In other words doing a call like storeImportSource(loadImportSourceWithMaskedPasswords(1)) will overwrite the stored passwords in the database with masked values leading to an invalid configuration
      Throws:
      InsightException
    • loadImportSourceOT

      ImportSourceOT loadImportSourceOT(Integer importSourceOTId) throws InsightException
      Load a specific import source OT configuration item.
      Throws:
      InsightException
    • loadImportSourceOTAttr

      ImportSourceOTAttr loadImportSourceOTAttr(Integer importSourceOTAttrId) throws InsightException
      Load a specific import source OT Attr configuration item.
      Throws:
      InsightException
    • storeImportSource

      ImportSource storeImportSource(ImportSource importSource) throws InsightException
      Store the entire import source together with all attached ImportSourceOTs and ImportSourceOTAs. If id is left as null new ones will be created
      Parameters:
      importSource - the import source that will be persisted. If the ImportSource.getId() != null an existing import source will be updated. When an import source is sent to be updated and the ImportSource.getJsonConfiguration() do not have any of the configured password fields present (i.e the json name of the password field is not present at all) the already saved password from the database will be used. In other words in all cases when the passwords are not to be updated the passwords should not be present at all in the ImportSource.getJsonConfiguration()
      Returns:
      The import source will have all passwords masked see loadImportSource(Integer)
      Throws:
      InsightException
    • storeImportSourceOT

      ImportSourceOT storeImportSourceOT(ImportSourceOT importSourceOT) throws InsightException
      Store a single import source OT configuration item together with all ImportSourceOTAs. If id is left as null a new one will be created
      Throws:
      InsightException
    • storeImportSourceOTAttr

      ImportSourceOTAttr storeImportSourceOTAttr(ImportSourceOTAttr importSourceOTAttr) throws InsightException
      Store a single import source OTAttr configuration item together with all ImportSourceOTAs. If id is left as null a new one will be created
      Throws:
      InsightException
    • deleteImportSource

      void deleteImportSource(Integer importSourceId) throws InsightException
      Deletes an Import Source
      Throws:
      InsightException
    • deleteImportSourceOT

      void deleteImportSourceOT(Integer importSourceOT) throws InsightException
      Deletes an Import Source OT
      Throws:
      InsightException
    • deleteImportSourceOTAttr

      void deleteImportSourceOTAttr(Integer importSourceOTAttr) throws InsightException
      Deletes an Import Source OTA
      Throws:
      InsightException
    • createPredefinedStructure

      void createPredefinedStructure(Integer importSourceId, ObjectTypeBean optionalParent) throws InsightException
      Creates a predefined structure based on the import component used. If the import component does not support a predefined structure an insight exception will be thrown
      Parameters:
      optionalParent - if this structure should be inserted under a specific parent. If left as null the object type tree will be created on the top level
      Throws:
      InsightException
    • createPredefinedConfiguration

      ImportSource createPredefinedConfiguration(Integer importSourceId, ObjectTypeBean optionalParent) throws InsightException
      Create the template configuration as specified by the component. If something is invalid in the configuration template or an object type is not mappable that one will be ignored. TODO the result of this operation should respond if a configuration was created
      Parameters:
      optionalParent - if this structure should be inserted under a specific parent. If left as null the object type tree will be created on the top level
      Returns:
      The import source will have all passwords masked see loadImportSource(Integer)
      Throws:
      InsightException
    • startImportSource

      Progress startImportSource(int importSourceId) throws InsightException
      Start an import given the id of the configuration. The returned Progress can be used to determine when the import is done.
      Throws:
      InsightException
    • startImportSourceForSpecificOTs

      Progress startImportSourceForSpecificOTs(int importSourceId, List<Integer> importSourceOTIds) throws InsightException
      Start an import given the id of the configuration but only import a specific number of object types. Note that the import source ot ids are the ids of the configuration item ant not the id of the object type
      Throws:
      InsightException