Package org.openiam.common.service
Class AbstractBaseService
- java.lang.Object
-
- org.openiam.common.service.AbstractBaseService
-
- Direct Known Subclasses:
AbstractProvisioningService,BatchTaskScheduler,KeyManagementRestController,KeyManagementServiceImpl,OrganizationTypeServiceImpl
public abstract class AbstractBaseService extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected AuditLogHelperauditLogHelperprotected DefaultEntityValidatorentityValidatorprotected PropertyValueCachepropertyValueSweeper
-
Constructor Summary
Constructors Constructor Description AbstractBaseService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetString(String key)protected <T extends BaseIdentity,R extends BaseDataResponse<T>>
Rtransaction(org.springframework.transaction.support.TransactionCallback<R> action)protected <T extends BaseIdentity,R extends BaseDataResponse<T>>
Rtransaction(org.springframework.transaction.support.TransactionCallback<R> action, Function<T,T> onSuccessTransaction)protected <T extends BaseIdentity,R extends BaseDataResponse<T>>
Rtransaction(org.springframework.transaction.support.TransactionCallback<R> action, Function<T,T> onSuccessTransaction, Function<R,Void> onFailTransaction)is used to managed Transactional operations.
-
-
-
Field Detail
-
auditLogHelper
@Autowired protected AuditLogHelper auditLogHelper
-
entityValidator
@Autowired protected DefaultEntityValidator entityValidator
-
propertyValueSweeper
@Autowired protected PropertyValueCache propertyValueSweeper
-
-
Method Detail
-
transaction
protected <T extends BaseIdentity,R extends BaseDataResponse<T>> R transaction(org.springframework.transaction.support.TransactionCallback<R> action, Function<T,T> onSuccessTransaction, Function<R,Void> onFailTransaction) throws BasicDataServiceException
is used to managed Transactional operations. Mostly we use for ES reindex case, baseuse reindex can't be call fromTransactionalmethods. in case {@param action } throws Exception and {@param onFailTransaction} is NOT NULL, {@param onFailTransaction} will be called and afterBasicDataServiceExceptionwill be thrown.- Type Parameters:
T- - Type ofBaseIdentitythat will be returnedR- - The Type ofBaseDataResponse- Wrapper aroundAbstractBaseService- Parameters:
action- - transactional action to performonSuccessTransaction- - theFunctionthat is called in case {@param action } return not-null, successBaseDataResponse, can be null, if null - nothing will be performedonFailTransaction- - theFunctionthat is called in case {@param action }return null, failedBaseDataResponse, can be null, if null -BasicDataServiceExceptionwill be thrown withResponseCodefromBasicDataServiceException.getCode()ifBasicDataServiceException.getCode()is NULL, thanResponseCode.INTERNAL_ERRORwill be thrown as a default.- Returns:
- - return
AbstractBaseService - Throws:
BasicDataServiceException- - in case {@param action } throwsBasicDataServiceException
-
transaction
protected <T extends BaseIdentity,R extends BaseDataResponse<T>> R transaction(org.springframework.transaction.support.TransactionCallback<R> action) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
transaction
protected <T extends BaseIdentity,R extends BaseDataResponse<T>> R transaction(org.springframework.transaction.support.TransactionCallback<R> action, Function<T,T> onSuccessTransaction) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
-