Class DataSetServiceImpl
java.lang.Object
org.qubership.atp.dataset.service.direct.impl.DataSetServiceImpl
- All Implemented Interfaces:
DataSetService,IdentifiedService<DataSet>,LabelProviderService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncollectAffectedDatasetsByDsId(UUID updatedDataSetId) Collects all affected DataSet Ids recursively.collectAffectedDatasetsByDslId(UUID updatedDataSetListId) Collects all affected DataSet Ids recursively.Copy DS.Copy DS to another dsl.Copy DS to another dsl.voidDelete DS by id.voiddeleteAllParameterOverlaps(UUID attributeId, List<UUID> dataSetsIds) deleteParameterOverlap(UUID dsId, UUID targetAttrId, List<UUID> attrPathIds) voidevictAllAffectedDatasetsFromContextCacheByDsId(UUID updatedDataSetId) Evict affected datasets from ATP_DATASETS_DATASET_LIST_CONTEXT_CACHE cache.voidevictAllAffectedDatasetsFromContextCacheByDslId(UUID updatedDataSetListId) Evict affected datasets from ATP_DATASETS_DATASET_LIST_CONTEXT_CACHE cache.booleanexistsById(UUID id) getAffectedDataSets(UUID dataSetId, Integer page, Integer size) List<?> getAffectedDataSetsByChangesDataSetReference(UUID dataSetId, boolean deleteDs) Finds dataSets with provided dataSet id.getAffectedDataSetsCount(UUID dataSetId) getAll()getAllDslDsByAttribute(UUID targetAttrId, List<UUID> attrPathIds) getByParentId(UUID dataSetListId) Returns all datasets (id + name) under targetDataSetList.getByParentId(UUID dataSetListId, boolean evaluate, String labelName) Returns all datasets under targetDataSetList.com.fasterxml.jackson.databind.node.ObjectNodeReturns dataSetLabels.List<?> getOverlapContainers(UUID dataSetId, UUID attributeId, boolean withInfo) Return all datasets which contains overlapped parameters.getParametersOnAttributePath(UUID dsId, List<UUID> attrPath, boolean evaluate) Returns attribute with parameters found by provided path.voidLock the datasets and their parameters from changes.Adds new dataSetLabel with name provided.voidRenames dataset.booleanrestore(com.fasterxml.jackson.databind.JsonNode dataSetJson) Restores dataSet.booleanDeletes dataSetLabel.writeInAtpFormat(MixInId id, Map<String, String> context, boolean evaluate)
-
Constructor Details
-
DataSetServiceImpl
public DataSetServiceImpl()
-
-
Method Details
-
create
- Specified by:
createin interfaceDataSetService
-
getInItfFormat
- Specified by:
getInItfFormatin interfaceDataSetService
-
writeInAtpFormat
@Nullable public CheckedConsumer<OutputStream,IOException> writeInAtpFormat(@Nonnull MixInId id, @Nullable Map<String, String> context, boolean evaluate) - Specified by:
writeInAtpFormatin interfaceDataSetService
-
get
- Specified by:
getin interfaceIdentifiedService<DataSet>
-
existsById
- Specified by:
existsByIdin interfaceIdentifiedService<DataSet>
-
getAll
- Specified by:
getAllin interfaceIdentifiedService<DataSet>
-
getAll
- Specified by:
getAllin interfaceDataSetService- Parameters:
dataSetsIds-Listof data sets ids- Returns:
ListofDataSet
-
getAllDslDsByAttribute
ReturnsListofDataSetfrom DSL which contains source attribute. In case attrPathIds not empty source attribute id is first id in attrPathIds list. In case attrPtathIds is empty source attribute id equals to target attribute id.- Specified by:
getAllDslDsByAttributein interfaceDataSetService- Returns:
ListofDataSet
-
rename
Renames dataset.- Specified by:
renamein interfaceDataSetService
-
lock
Lock the datasets and their parameters from changes.- Specified by:
lockin interfaceDataSetService- Parameters:
dataSetListId- dataSetList Iduuids- Ids datasetsisLock- Flag true/false lock
-
delete
Delete DS by id.- Specified by:
deletein interfaceDataSetService
-
copy
Copy DS.- Specified by:
copyin interfaceDataSetService
-
copy
public DataSet copy(@Nonnull UUID dataSetId, @Nonnull UUID dataSetListId, @Nonnull Map<UUID, UUID> attributes) Copy DS to another dsl.- Specified by:
copyin interfaceDataSetService- Parameters:
dataSetListId- - id of dsl where to copy.attributes- - mapping of old and new attributes if ds copied to another dsl.- Returns:
- data set with parameters and labels.
-
copy
public DataSet copy(@Nonnull DataSet dataSet, @Nonnull UUID dataSetListId, @Nonnull Map<UUID, UUID> attributes) Copy DS to another dsl.- Specified by:
copyin interfaceDataSetService
-
getParametersOnAttributePath
@Nullable public UiManAttribute getParametersOnAttributePath(@Nonnull UUID dsId, @Nonnull List<UUID> attrPath, boolean evaluate) Description copied from interface:DataSetServiceReturns attribute with parameters found by provided path.- Specified by:
getParametersOnAttributePathin interfaceDataSetService- Parameters:
attrPath- path to attribute inclusive
-
getOverlapContainers
public List<?> getOverlapContainers(@Nonnull UUID dataSetId, @Nonnull UUID attributeId, boolean withInfo) Return all datasets which contains overlapped parameters.- Specified by:
getOverlapContainersin interfaceDataSetService- Returns:
- DataSets with parameter overlaps on the target attribute provided.
-
getAffectedDataSetsByChangesDataSetReference
public List<?> getAffectedDataSetsByChangesDataSetReference(@Nonnull UUID dataSetId, boolean deleteDs) Finds dataSets with provided dataSet id.- Specified by:
getAffectedDataSetsByChangesDataSetReferencein interfaceDataSetService
-
deleteAllParameterOverlaps
- Specified by:
deleteAllParameterOverlapsin interfaceDataSetService
-
deleteParameterOverlap
@Transactional @CacheEvict(value="ATP_DATASETS_DATASET_LIST_CONTEXT_CACHE_OS", key="#dsId") public Parameter deleteParameterOverlap(@Nonnull UUID dsId, @Nonnull UUID targetAttrId, @Nonnull List<UUID> attrPathIds) - Specified by:
deleteParameterOverlapin interfaceDataSetService- Returns:
- the parameter which lays underneath deleted overlap.
-
getByParentId
@Nonnull public Stream<DataSet> getByParentId(UUID dataSetListId, boolean evaluate, @Nullable String labelName) Description copied from interface:DataSetServiceReturns all datasets under targetDataSetList.- Specified by:
getByParentIdin interfaceDataSetService- Parameters:
dataSetListId- - id of targetDataSetList.evaluate- - should apply structure changes or not.labelName- - name of a label.- Returns:
- list of
DataSetunder targetDataSetList.
-
getByParentId
Description copied from interface:DataSetServiceReturns all datasets (id + name) under targetDataSetList.- Specified by:
getByParentIdin interfaceDataSetService- Parameters:
dataSetListId- - id of targetDataSetList.- Returns:
- list of
DataSetunder targetDataSetList.
-
mark
Adds new dataSetLabel with name provided.- Specified by:
markin interfaceLabelProviderService- Parameters:
dataSetId- - id of target dataSetList or dataSet.name- - name of label.
-
getLabels
Returns dataSetLabels.- Specified by:
getLabelsin interfaceLabelProviderService
-
unmark
Deletes dataSetLabel.- Specified by:
unmarkin interfaceLabelProviderService- Parameters:
dataSetId- - id of target dataSetList or dataSet.
-
restore
@Transactional public boolean restore(@Nonnull com.fasterxml.jackson.databind.JsonNode dataSetJson) Restores dataSet.- Specified by:
restorein interfaceDataSetService
-
getAffectedDataSets
public PaginationResponse<TableResponse> getAffectedDataSets(UUID dataSetId, Integer page, Integer size) - Specified by:
getAffectedDataSetsin interfaceDataSetService
-
getAffectedDataSetsCount
- Specified by:
getAffectedDataSetsCountin interfaceDataSetService
-
evictAllAffectedDatasetsFromContextCacheByDslId
Evict affected datasets from ATP_DATASETS_DATASET_LIST_CONTEXT_CACHE cache.- Specified by:
evictAllAffectedDatasetsFromContextCacheByDslIdin interfaceDataSetService- Parameters:
updatedDataSetListId- updated dataset list id
-
evictAllAffectedDatasetsFromContextCacheByDsId
Evict affected datasets from ATP_DATASETS_DATASET_LIST_CONTEXT_CACHE cache.- Specified by:
evictAllAffectedDatasetsFromContextCacheByDsIdin interfaceDataSetService- Parameters:
updatedDataSetId- updated dataset id
-
collectAffectedDatasetsByDslId
Collects all affected DataSet Ids recursively. Used then dsl updated or attribute created/updated/deleted- Specified by:
collectAffectedDatasetsByDslIdin interfaceDataSetService- Parameters:
updatedDataSetListId- updated dataSetList id- Returns:
- set of updated dataset ids include updatedDataSetId
-
collectAffectedDatasetsByDsId
Collects all affected DataSet Ids recursively. Used then dataset updated or parameter updated- Specified by:
collectAffectedDatasetsByDsIdin interfaceDataSetService- Parameters:
updatedDataSetId- updated dataSet id- Returns:
- set of updated dataset ids include updatedDataSetId
-