Interface MasterDataInstanceImportBuilder
- All Known Implementing Classes:
MasterDataInstanceImportBuilderImpl
public interface MasterDataInstanceImportBuilder
An Import Builder which allows importing master data instances in bulk from master data documents.
The documents being imported should have the following format:
Single tenant:
{
"dataObjectDefinitionKey": "country",
"tenantId": "acme",
"masterData": [
{...},
...
]
}
Multi tenants:
{
"dataObjectDefinitionKey": "country",
"tenantIds": [ "acme", "megacorp" ],
"masterData": [
{...},
...
]
}
If the data object definition key or id are provided then the document can also have the following format:
[
{...},
...
]
- Author:
- Filip Hrisafov
-
Method Summary
Modifier and Type Method Description MasterDataInstanceImportBuilderaddClasspathResource(java.lang.String resource)Adds a master data json file from the classpath to this builder.MasterDataInstanceImportBuilderaddInputStream(java.lang.String resourceName, java.io.InputStream inputStream)Adds a master data json file to this builder.MasterDataInstanceImportBuilderaddResourceDocument(java.lang.String resourceDocument)Adds a master data json document to this builder.MasterDataInstanceImportBuilderdataObjectDefinitionId(java.lang.String dataObjectDefinitionId)The data object definition id that should be used when deploying the master data resource documents.MasterDataInstanceImportBuilderdataObjectDefinitionKey(java.lang.String dataObjectDefinitionKey)The data object definition key that should be used when deploying the master data resource documents.java.util.Collection<MasterDataInstance>doImport()MasterDataInstanceImportBuilderoverwrite()Before importing master data instances from the document.MasterDataInstanceImportBuildertenantId(java.lang.String tenantId)The tenantId that should be used when deploying the master data resource documents.
-
Method Details
-
addInputStream
MasterDataInstanceImportBuilder addInputStream(java.lang.String resourceName, java.io.InputStream inputStream)Adds a master data json file to this builder. -
addClasspathResource
Adds a master data json file from the classpath to this builder. -
addResourceDocument
Adds a master data json document to this builder. -
tenantId
The tenantId that should be used when deploying the master data resource documents. If set then the tenantId from the document would be ignored.- Parameters:
tenantId- the id of the tenant to which to deploy
-
dataObjectDefinitionKey
The data object definition key that should be used when deploying the master data resource documents. If set then the dataObjectDefinitionKey from the document would be ignored.- Parameters:
dataObjectDefinitionKey- the key of the data object that should be used for deployment
-
dataObjectDefinitionId
The data object definition id that should be used when deploying the master data resource documents. If set then the dataObjectDefinitionKey from the document would be ignored.- Parameters:
dataObjectDefinitionId- the id of the data object that should be used for deployment
-
overwrite
MasterDataInstanceImportBuilder overwrite()Before importing master data instances from the document. Delete all of them that matched the definition id / key in the matching tenant. This should be used with care. If set then the overwrite flag from the document would be ignored. -
doImport
java.util.Collection<MasterDataInstance> doImport()
-