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 Details

    • addInputStream

      MasterDataInstanceImportBuilder addInputStream(String resourceName, InputStream inputStream)
      Adds a master data json file to this builder.
    • addClasspathResource

      MasterDataInstanceImportBuilder addClasspathResource(String resource)
      Adds a master data json file from the classpath to this builder.
    • addResourceDocument

      MasterDataInstanceImportBuilder addResourceDocument(String resourceDocument)
      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

      MasterDataInstanceImportBuilder dataObjectDefinitionKey(String 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

      MasterDataInstanceImportBuilder dataObjectDefinitionId(String 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

      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