Package org.cxbox.core.service
Interface ResponseService<T extends org.cxbox.api.data.dto.DataResponseDTO,E extends BaseEntity>
-
- All Known Implementing Classes:
AbstractResponseService,HistoricityResponseService,VersionAwareResponseService
public interface ResponseService<T extends org.cxbox.api.data.dto.DataResponseDTO,E extends BaseEntity>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description AssociateResultDTOassociate(List<org.cxbox.api.data.dto.AssociateDTO> data, BusinessComponent bc)Сreates links between entitieslongcount(BusinessComponent bc)Returns the number of matching entitiesCreateResult<T>createEntity(BusinessComponent bc)Creates an entity based on a business componentActionResultDTO<T>deleteEntity(BusinessComponent bc)Deletes an entity based on a business componentActions<T>getActions()Returns actions for entity with conditions of their availability invoked by method getAvailableActionsActionsDTOgetAvailableActions(RowMetaType metaType, org.cxbox.api.data.dto.DataResponseDTO data, BusinessComponent bc)Returns actions for entity with conditions of their availability invoke method getActionsClass<? extends FieldMetaBuilder<T>>getFieldMetaBuilder()Returns FieldMetaBuilder for classorg.cxbox.api.data.ResultPage<T>getList(BusinessComponent bc)Returns a list of matched objects based on a business componentTgetOne(BusinessComponent bc)Returns object based on a business componentBaseEntitygetOneAsEntity(BusinessComponent bc)Returns an entity based on a business componentClass<T>getTypeOfDTO()Returns the number of matching entitiesClass<E>getTypeOfEntity()Returns the number of matching entitiesbooleanhasPersister()Determines whether the service interacts with an entity from the databaseActionResultDTO<T>invokeAction(BusinessComponent bc, String actionName, org.cxbox.api.data.dto.DataResponseDTO data)Invokes action with given name, add preactions, loads or updates entity if necessarybooleanisDeferredCreationSupported(BusinessComponent bc)Determines is deferred saving of new objects supportedActionResultDTOonCancel(BusinessComponent bc)Returns actions invoked with cancelActionResultDTO<T>preview(BusinessComponent bc, org.cxbox.api.data.dto.DataResponseDTO data)Updates an entity based on a business component by DTO Used in forceactive fields<V> Vunwrap(Class<V> cls)Deprecated.ActionResultDTO<T>updateEntity(BusinessComponent bc, org.cxbox.api.data.dto.DataResponseDTO data)Updates an entity based on a business component by DTOvoidvalidate(BusinessComponent bc, org.cxbox.api.data.dto.DataResponseDTO data)Validates the entry on save
-
-
-
Method Detail
-
getOneAsEntity
BaseEntity getOneAsEntity(BusinessComponent bc)
Returns an entity based on a business component- Parameters:
bc- businessComponent- Returns:
BaseEntityentity
-
getOne
T getOne(BusinessComponent bc)
Returns object based on a business component- Parameters:
bc- businessComponent- Returns:
- object
-
hasPersister
boolean hasPersister()
Determines whether the service interacts with an entity from the database- Returns:
- true/false
-
getList
org.cxbox.api.data.ResultPage<T> getList(BusinessComponent bc)
Returns a list of matched objects based on a business component- Parameters:
bc- businessComponent- Returns:
- list of matched objects
-
createEntity
CreateResult<T> createEntity(BusinessComponent bc)
Creates an entity based on a business component- Parameters:
bc- businessComponent- Returns:
CreateResultclass with DataResponseDTO and postactions
-
updateEntity
ActionResultDTO<T> updateEntity(BusinessComponent bc, org.cxbox.api.data.dto.DataResponseDTO data)
Updates an entity based on a business component by DTO- Parameters:
bc- businessComponentdata- information about entity, it's changed fields, errors- Returns:
ActionResultDTOclass with DataResponseDTO and postactions
-
preview
ActionResultDTO<T> preview(BusinessComponent bc, org.cxbox.api.data.dto.DataResponseDTO data)
Updates an entity based on a business component by DTO Used in forceactive fields- Parameters:
bc- businessComponentdata- information about entity, it's changed fields, errors- Returns:
ActionResultDTOclass with DataResponseDTO and postactions
-
deleteEntity
ActionResultDTO<T> deleteEntity(BusinessComponent bc)
Deletes an entity based on a business component- Parameters:
bc- businessComponent- Returns:
ActionResultDTOclass with DataResponseDTO and postactions
-
invokeAction
ActionResultDTO<T> invokeAction(BusinessComponent bc, String actionName, org.cxbox.api.data.dto.DataResponseDTO data)
Invokes action with given name, add preactions, loads or updates entity if necessary- Parameters:
bc- businessComponentactionName- name of actiondata- information about entity, it's changed fields, errors- Returns:
ActionResultDTOclass with DataResponseDTO and postactions
-
associate
AssociateResultDTO associate(List<org.cxbox.api.data.dto.AssociateDTO> data, BusinessComponent bc)
Сreates links between entities- Parameters:
data- information about an entity, whether the entity was associatedbc- businessComponent- Returns:
AssociateResultDTOclass with DataResponseDTO and postactions
-
getAvailableActions
ActionsDTO getAvailableActions(RowMetaType metaType, org.cxbox.api.data.dto.DataResponseDTO data, BusinessComponent bc)
Returns actions for entity with conditions of their availability invoke method getActions- Parameters:
metaType- type of metadata- information about entity, it's changed fields, errorsbc- businessComponent- Returns:
AssociateResultDTOclass with DataResponseDTO and postactions
-
getActions
Actions<T> getActions()
Returns actions for entity with conditions of their availability invoked by method getAvailableActions- Returns:
AssociateResultDTOclass with DataResponseDTO and postactions
-
onCancel
ActionResultDTO onCancel(BusinessComponent bc)
Returns actions invoked with cancel- Parameters:
bc- businessComponent- Returns:
AssociateResultDTOclass with DataResponseDTO and postactions
-
getFieldMetaBuilder
Class<? extends FieldMetaBuilder<T>> getFieldMetaBuilder()
Returns FieldMetaBuilder for class- Returns:
FieldMetaBuilderclass for building field meta
-
count
long count(BusinessComponent bc)
Returns the number of matching entities- Parameters:
bc- businessComponent- Returns:
- count
-
validate
void validate(BusinessComponent bc, org.cxbox.api.data.dto.DataResponseDTO data)
Validates the entry on save- Parameters:
bc- businessComponentdata- information about entity, it's changed fields, errors
-
unwrap
@Deprecated <V> V unwrap(Class<V> cls)
Deprecated.
-
isDeferredCreationSupported
boolean isDeferredCreationSupported(BusinessComponent bc)
Determines is deferred saving of new objects supported- Parameters:
bc- businessComponent
-
-