public abstract class AbstractController<T extends UIObject,U extends org.qubership.automation.itf.core.model.common.Storable> extends AbstractStorableController<U> implements EntityController<T>
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOGGER |
| Constructor and Description |
|---|
AbstractController() |
| Modifier and Type | Method and Description |
|---|---|
protected U |
_beforeUpdate(T uiObject,
U object)
do something before update the object.
|
protected void |
_deleteSubObjects(U object)
delete all sub objects in deleted the object.
|
protected abstract Class<U> |
_getGenericUClass()
must be return generic UClass.
|
protected abstract org.qubership.automation.itf.core.model.common.Storable |
_getParent(String parentId)
logic how to find a parent for id.
|
protected boolean |
_isObjectSuitable(U object,
String... param) |
protected abstract T |
_newInstanceTClass(U object)
create new UIObject class.
|
List<? extends UIObject> |
asListUIObject(Collection<? extends U> collection,
boolean checkSuitable,
boolean isSimple,
String... param) |
protected void |
beforeStoreUpdated(U object,
T uiObject) |
protected void |
checkVersion(U object,
T uiObject) |
T |
create(org.qubership.automation.itf.core.model.common.Storable parent)
create storable object in repository for parent.
|
T |
create(String parentId)
create storable object in repository for parent.
|
T |
create(String parentId,
BigInteger projectId) |
T |
create(String parentId,
String type)
create storable object in repository for parent.
|
T |
create(String parentId,
String name,
String type)
create new object.
|
T |
create(String parentId,
String name,
String type,
String description,
List<String> labels)
create new object.
|
protected List<List<UIObject>> |
delete(Boolean ignoreUsages,
UIIds objectsToDelete)
Delete objects in repository and get result about it.
|
void |
delete(Collection<T> objectsToDelete)
Deletes all objects in the repository from the resulting list.
|
void |
delete(U object) |
List<UIObject> |
delete(UIIds objectsToDelete)
Deletes all objects in the repository from the resulting list.
|
List<? extends UIObject> |
getAll()
returns all objects of the generic type in repository.
|
List<? extends UIObject> |
getAll(String parentId)
returns all objects of the generic type and parent in repository.
|
protected List<? extends UIObject> |
getAllSimple()
returns all objects of the UIObject in repository.
|
protected List<? extends UIObject> |
getAllSuitable(String parentId,
String... param)
returns all objects of the generic type and parent if it suitable in repository.
|
List<UIECIObject> |
getAllWithEciParams() |
T |
getById(String id)
returns the required object from the repository by the identifier.
|
protected org.qubership.automation.itf.core.hibernate.spring.managers.base.ObjectManager<U> |
manager()
get manager of repository for generic class.
|
void |
setSimple(boolean simple)
if set true all object will be UIObject.
|
protected T |
storeUpdated(U object,
T uiObject) |
UIResult |
update(List<T> uiObjects)
update objects.
|
T |
update(T uiObject)
update older object in repository.
|
protected T |
updateUIObject(U object,
T uiObject) |
String |
usageInfoListAsString(Collection<org.qubership.automation.itf.core.model.usage.UsageInfo> usageInfoList) |
haveUsagespublic List<? extends UIObject> getAll()
getAll in interface EntityController<T extends UIObject>public List<UIECIObject> getAllWithEciParams()
public List<? extends UIObject> getAll(String parentId)
getAll in interface EntityController<T extends UIObject>parentId - parent identifierpublic T getById(String id)
getById in interface EntityController<T extends UIObject>id - Storable object in repository<T extends UIObject> by idpublic T create(String parentId)
create in interface EntityController<T extends UIObject>parentId - parent identifier for create objectpublic T create(org.qubership.automation.itf.core.model.common.Storable parent)
create in interface EntityController<T extends UIObject>parent - parentpublic T create(String parentId, BigInteger projectId)
create in interface EntityController<T extends UIObject>public T create(String parentId, String name, String type, String description, List<String> labels)
create in interface EntityController<T extends UIObject>parentId - parent identifiername - name identifiertype - type identifierdescription - description identifierlabels - labels identifierpublic T create(String parentId, String type)
create in interface EntityController<T extends UIObject>parentId - parent identifier for create objecttype - type of create objectpublic T create(String parentId, String name, String type)
EntityControllercreate in interface EntityController<T extends UIObject>parentId - parent identifiername - name of create objecttype - type of create objectpublic T update(T uiObject)
update in interface EntityController<T extends UIObject>uiObject - have new param for update objectpublic UIResult update(List<T> uiObjects)
EntityControllerupdate in interface EntityController<T extends UIObject>uiObjects - generic objects with new parampublic List<UIObject> delete(UIIds objectsToDelete)
delete in interface EntityController<T extends UIObject>objectsToDelete - list by deletepublic void delete(Collection<T> objectsToDelete)
delete in interface EntityController<T extends UIObject>objectsToDelete - list by deletepublic void setSimple(boolean simple)
simple - simplification parameterpublic void delete(U object)
protected List<? extends UIObject> getAllSuitable(String parentId, String... param)
parentId - parent identifierparam - parameters for check suitableprotected List<? extends UIObject> getAllSimple()
protected List<List<UIObject>> delete(Boolean ignoreUsages, UIIds objectsToDelete)
ignoreUsages - indicates whether to ignore usagesobjectsToDelete - list by deleteprotected U _beforeUpdate(T uiObject, U object)
uiObject - have param for updateobject - updatable objectprotected void _deleteSubObjects(U object)
object - parent objectprotected org.qubership.automation.itf.core.hibernate.spring.managers.base.ObjectManager<U> manager()
protected abstract Class<U> _getGenericUClass()
protected abstract T _newInstanceTClass(U object)
object - storable for create an object extends UIObjectprotected abstract org.qubership.automation.itf.core.model.common.Storable _getParent(String parentId)
parentId - parent identifypublic List<? extends UIObject> asListUIObject(Collection<? extends U> collection, boolean checkSuitable, boolean isSimple, String... param)
public String usageInfoListAsString(Collection<org.qubership.automation.itf.core.model.usage.UsageInfo> usageInfoList)
Copyright © 2025. All rights reserved.