Package org.qubership.atp.ram.services
Class RootCauseService
java.lang.Object
org.qubership.atp.ram.services.CrudService<RootCause>
org.qubership.atp.ram.services.RootCauseService
-
Constructor Summary
ConstructorsConstructorDescriptionRootCauseService(RootCauseRepository repository, TestRunService testRunService, org.modelmapper.ModelMapper modelMapper) RootCauseService constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreate(@Valid RootCauseUpsertRequest request) Create root cause.voiddeleteById(UUID id) Delete root cause by id.voiddeleteRootCauseHierarchy(RootCause rootCause) Delete all parent root cause sub nodes.voidDisable root cause by specified identifier.voidEnable root cause by specified identifier.booleanexistsById(UUID id) getByIdOrNull(UUID id) Gets root cause by id or returns null.getByIds(Collection<UUID> ids) getChildrenRootCauses(RootCause parentRootCause, UUID projectId) Collects children root causes by parent root cause and project id.Get root cause name by id.getRootCausesByParentId(UUID parentId) Get root cause list by parent id.getRootCauseTree(UUID projectId, boolean filterDisabled) Get root cause tree by project id.booleanisNameUsed(RootCause rootCause, UUID targetProjectId) Checks if root cause already exists in target project.update(UUID id, @Valid RootCauseUpsertRequest request) Update root cause.Methods inherited from class org.qubership.atp.ram.services.CrudService
get, getAll, save, saveAll
-
Constructor Details
-
RootCauseService
public RootCauseService(RootCauseRepository repository, @Lazy TestRunService testRunService, org.modelmapper.ModelMapper modelMapper) RootCauseService constructor.- Parameters:
repository- root cause repositorytestRunService- test run servicemodelMapper- model mapper
-
-
Method Details
-
repository
- Specified by:
repositoryin classCrudService<RootCause>
-
getAllRootCauses
-
getById
-
getByIdOrNull
Gets root cause by id or returns null.- Parameters:
id- root cause id- Returns:
- root cause
-
create
@CacheEvict(value="rootcauses", allEntries=true) public RootCause create(@Valid @Valid RootCauseUpsertRequest request) Create root cause.- Parameters:
request- creation request- Returns:
- created root cause
-
update
@CacheEvict(value="rootcauses", allEntries=true) public RootCause update(UUID id, @Valid @Valid RootCauseUpsertRequest request) Update root cause.- Parameters:
id- root cause identifierrequest- root cause update request- Returns:
- updated request
-
deleteById
Delete root cause by id.- Parameters:
id- root cause identifier
-
deleteRootCauseHierarchy
Delete all parent root cause sub nodes.- Parameters:
rootCause- deleted parent root cause
-
getByIds
-
getRootCauseTree
@Cacheable("rootcauses") public List<RootCauseTreeNode> getRootCauseTree(UUID projectId, boolean filterDisabled) Get root cause tree by project id.- Parameters:
projectId- project identifierfilterDisabled- exclude disabled root cause nodes- Returns:
- result tree
-
getRootCauseNameById
Get root cause name by id.- Parameters:
id- root cause identifier- Returns:
- name
-
getChildrenRootCauses
Collects children root causes by parent root cause and project id.- Parameters:
parentRootCause- parent root causeprojectId- project id- Returns:
- list of child root causes
-
isNameUsed
Checks if root cause already exists in target project.- Parameters:
rootCause- root cause to checktargetProjectId- target project id- Returns:
- true if exists
-
disable
Disable root cause by specified identifier.- Parameters:
id- root cause identifier
-
enable
Enable root cause by specified identifier.- Parameters:
id- root cause identifier
-
getRootCausesByParentId
Get root cause list by parent id.- Parameters:
parentId- parent root cause identifier- Returns:
- name
-
existsById
-