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 Summary
Modifier and TypeMethodDescriptioncreatePredefinedConfiguration
(Integer importSourceId, ObjectTypeBean optionalParent) Create the template configuration as specified by the component.void
createPredefinedStructure
(Integer importSourceId, ObjectTypeBean optionalParent) Creates a predefined structure based on the import component used.void
deleteImportSource
(Integer importSourceId) Deletes an Import Sourcevoid
deleteImportSourceOT
(Integer importSourceOT) Deletes an Import Source OTvoid
deleteImportSourceOTAttr
(Integer importSourceOTAttr) Deletes an Import Source OTAfindImportSourcesByModule
(String moduleKey) Finds import sources for a specific import module type (each integration module specifies it's own type with a module key e.g.findImportSourcesByModuleAndSchemaId
(String moduleKey, Integer objectSchemaId) Finds import sources for a specific import module type (each integration module specifies it's own type with a module key e.g.findImportSourcesBySchema
(Integer objectSchemaId) Finds all import source configurations by the given object schema id.findImportSourcesForObjectTypeId
(Integer objectTypeId) Finds all the import sources where the specified object type id is used in any object type mapping configuration.loadImportSource
(Integer importSourceId) Loads the ImportSource from the database and validates it if it is ready to be synchronised.loadImportSourceOT
(Integer importSourceOTId) Load a specific import source OT configuration item.loadImportSourceOTAttr
(Integer importSourceOTAttrId) Load a specific import source OT Attr configuration item.loadImportSourceWithMaskedPasswords
(Integer importSourceId) Loads the ImportSource from the database and validate if it is ready to be synchronised.passwordFieldNamesInModuleConfig
(Integer importSourceId) Retrieves a list of all the keys (the json names) in theImportSource.getJsonConfiguration()
that represents a password field for the given import source.startImportSource
(int importSourceId) Start an import given the id of the configuration.startImportSourceForSpecificOTs
(int importSourceId, List<Integer> importSourceOTIds) Start an import given the id of the configuration but only import a specific number of object types.storeImportSource
(ImportSource importSource) Store the entire import source together with all attached ImportSourceOTs and ImportSourceOTAs.storeImportSourceOT
(ImportSourceOT importSourceOT) Store a single import source OT configuration item together with all ImportSourceOTAs.storeImportSourceOTAttr
(ImportSourceOTAttr importSourceOTAttr) Store a single import source OTAttr configuration item together with all ImportSourceOTAs.
-
Method Details
-
findImportSourcesBySchema
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
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 theObjectTypeBean
specified by the argument. The import sources in the list will have all passwords masked seeloadImportSource(Integer)
- Throws:
InsightException
-
findImportSourcesByModule
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
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 aValidationInsightException
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 theloadImportSourceWithMaskedPasswords(Integer)
instead. - Throws:
InsightException
- / ValidationInsightException if the ImportSource is not valid.
-
passwordFieldNamesInModuleConfig
Retrieves a list of all the keys (the json names) in theImportSource.getJsonConfiguration()
that represents a password field for the given import source. The password fields are masked in the fetched import source as described inloadImportSourceWithMaskedPasswords(Integer)
- Throws:
InsightException
-
loadImportSourceWithMaskedPasswords
Loads the ImportSource from the database and validate if it is ready to be synchronised. If the ImportSource is invalid this method will throw aValidationInsightException
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
Load a specific import source OT configuration item.- Throws:
InsightException
-
loadImportSourceOTAttr
Load a specific import source OT Attr configuration item.- Throws:
InsightException
-
storeImportSource
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 theImportSource.getId()
!= null an existing import source will be updated. When an import source is sent to be updated and theImportSource.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 theImportSource.getJsonConfiguration()
- Returns:
- The import source will have all passwords masked see
loadImportSource(Integer)
- Throws:
InsightException
-
storeImportSourceOT
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
Deletes an Import Source- Throws:
InsightException
-
deleteImportSourceOT
Deletes an Import Source OT- Throws:
InsightException
-
deleteImportSourceOTAttr
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
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
-