Class SynchronizationExcelInJobRequest.SynchronizationExcelInJobRequestBuilder
- Enclosing class:
- SynchronizationExcelInJobRequest
-
Method Summary
Modifier and TypeMethodDescriptionbatchSize
(int batchSize) Sets the size of the batch.build()
deleteFile
(boolean deleteFile) Sets whether the Excel file should be deleted after the synchronization job is finished, regardless of the result.Sets the Excel file to upload.Sets theid
of uploaded Excel file.Sets the name of the Excel file to upload.finalizationStrategy
(String finalizationStrategy) headerRow
(boolean headerRow) Sets whether the first row of the synchronized Excel file is the header.missingAssetStatusId
(UUID missingAssetStatusId) sendNotification
(boolean sendNotification) Sets whether job status notification should be sent.sheetIndex
(Integer sheetIndex) Sets the index of the Excel sheet.Sets the name of the Excel sheet.simulation
(boolean simulation) Sets whether the synchronization should be triggered as a simulation.synchronizationId
(String synchronizationId) (required) Sets the synchronizationid
used to distinguish different synchronizations.Sets the template that should be used for parsing and synchronizing the contents of the Excel file.
-
Method Details
-
synchronizationId
public SynchronizationExcelInJobRequest.SynchronizationExcelInJobRequestBuilder synchronizationId(String synchronizationId) (required) Sets the synchronizationid
used to distinguish different synchronizations.- Parameters:
synchronizationId
- the synchronizationid
used to distinguish different synchronizations
-
sheetName
public SynchronizationExcelInJobRequest.SynchronizationExcelInJobRequestBuilder sheetName(String sheetName) Sets the name of the Excel sheet.If the name is
null
andSynchronizationExcelInJobRequest.sheetIndex
isnull
, the first sheet of the workbook will be used for the synchronization.If the name is
null
andSynchronizationExcelInJobRequest.sheetIndex
is notnull
, the sheet with the index specified by value ofSynchronizationExcelInJobRequest.sheetIndex
will be used for the synchronization.- Parameters:
sheetName
- the name of the sheet
-
sheetIndex
public SynchronizationExcelInJobRequest.SynchronizationExcelInJobRequestBuilder sheetIndex(Integer sheetIndex) Sets the index of the Excel sheet.If the index is
null
andSynchronizationExcelInJobRequest.sheetName
isnull
, the first sheet of the workbook will be used for the synchronization.If the index is
null
andSynchronizationExcelInJobRequest.sheetName
is notnull
, the sheet with the name specified by value ofSynchronizationExcelInJobRequest.sheetName
will be used for the synchronization.- Parameters:
sheetIndex
- the index of the sheet
-
headerRow
public SynchronizationExcelInJobRequest.SynchronizationExcelInJobRequestBuilder headerRow(boolean headerRow) Sets whether the first row of the synchronized Excel file is the header. The default value isfalse
.- Parameters:
headerRow
- whether the first row of the synchronized Excel file is the header
-
template
public SynchronizationExcelInJobRequest.SynchronizationExcelInJobRequestBuilder template(String template) Sets the template that should be used for parsing and synchronizing the contents of the Excel file.There is one placeholder currently supported:
- ${x} - refers to the x-th column in the Excel file (with numbering starting from 0, e.g. ${0}, ${1}, ...)
Example of a correct JSON template:
[ { "identifier": { "name": "${0}", "domain": { "name": "${1}", "community": { "name": "Some Community" } } }, "attributes" : { "00000000-0000-0000-0000-000000003115" : [ { "value" : "${2}" } ], "00000000-0000-0000-0000-000000000222" : [ { "value" : "${3}" } ] }, "resourceType": "Asset" } ]
- Parameters:
template
- the template that should be used for parsing and synchronizing the contents of the Excel file
-
fileId
Sets theid
of uploaded Excel file.NOTE: if this field is used,
FileImportRequest.file
should not be set.- Parameters:
fileId
- theid
of uploaded Excel file
-
file
Sets the Excel file to upload. If set, then alsoFileImportRequest.fileName
should be provided.NOTE: if this field is used,
FileImportRequest.fileId
should not be set.- Parameters:
file
- the Excel file to upload
-
fileName
public SynchronizationExcelInJobRequest.SynchronizationExcelInJobRequestBuilder fileName(String fileName) Sets the name of the Excel file to upload. If set, then alsoFileImportRequest.file
should be provided.NOTE: if this field is used,
FileImportRequest.fileId
should not be set.- Parameters:
fileName
- the name of the Excel file to upload
-
deleteFile
public SynchronizationExcelInJobRequest.SynchronizationExcelInJobRequestBuilder deleteFile(boolean deleteFile) Sets whether the Excel file should be deleted after the synchronization job is finished, regardless of the result. The default value isfalse
.NOTE: if the Excel file corresponds to an attachment, the attachment will be deleted. When import operation fails then file will not be deleted.
- Parameters:
deleteFile
- whether the Excel file should be deleted after the synchronization job is finished
-
sendNotification
public SynchronizationExcelInJobRequest.SynchronizationExcelInJobRequestBuilder sendNotification(boolean sendNotification) Sets whether job status notification should be sent. The default value isfalse
.- Parameters:
sendNotification
- whether job status notification should be sent
-
batchSize
public SynchronizationExcelInJobRequest.SynchronizationExcelInJobRequestBuilder batchSize(int batchSize) Sets the size of the batch. The default value is1000
.- Parameters:
batchSize
- the size of the batch
-
simulation
public SynchronizationExcelInJobRequest.SynchronizationExcelInJobRequestBuilder simulation(boolean simulation) Sets whether the synchronization should be triggered as a simulation. The default value isfalse
.If
true
, the result of the synchronization simulation will be available at the end of the job but no change will be applied to the DGC.- Parameters:
simulation
- whether the synchronization should be triggered as a simulation
-
finalizationStrategy
public SynchronizationExcelInJobRequest.SynchronizationExcelInJobRequestBuilder finalizationStrategy(String finalizationStrategy) -
missingAssetStatusId
public SynchronizationExcelInJobRequest.SynchronizationExcelInJobRequestBuilder missingAssetStatusId(UUID missingAssetStatusId) -
build
-