Package com.skava.accounts.util
Class CacheUtil
java.lang.Object
com.skava.accounts.util.CacheUtil
- All Implemented Interfaces:
Serializable
This class has all the cache related functionalities like save to cache, delete from cache
and get cache.
- Author:
- Infosys Equinox
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AccountTypesEntity
getAccountTypeByIdAndCollectionIdFromCacheOrDb
(long id, Long collectionId, AccountCommonServices accountCommonService) static AccountTypesEntity
getAccountTypeNameFromCacheOrDB
(long collectionId, long typeId, AccountCommonServices accountCommonService) static AddressesDO
getAddressByIdAndAccountIdFromCacheOrDb
(long id, long accountId, AccountCommonServices accountCommonService, org.springframework.context.MessageSource messageSource, String locale) static AttributeEntity
getAttributeFromCacheOrDB
(long collectionId, String attributeId, AccountCommonServices accountCommonService) static Iterable<CollectionAttributesEntity>
getCollectionAttributeFromCacheOrDB
(AccountCommonServices accountCommonService, CollectionAttributesRepository collectionAttributeRepository) static CollectionsDO
getCollectionDOFromCacheOrDB
(long collectionId, AccountCommonServices accountCommonService, CollectionsRepository collectionRepository, CollectionAttributesRepository collectionAttributeRepository) static CollectionsEntity
getCollectionFromCacheOrDB
(long collectionId, long businessId, String locale, AccountCommonServices accountCommonService, CollectionsRepository collectionRepository) static CollectionsEntity
getCollectionFromCacheOrDB
(long collectionId, AccountCommonServices accountCommonService, CollectionsRepository collectionRepository) static boolean
isValidCollection
(long collectionId, long businessId, CollectionsRepository collectionRepository, AccountCommonServices accountCommonServices) isValidCollection
-
Constructor Details
-
CacheUtil
public CacheUtil()
-
-
Method Details
-
getCollectionFromCacheOrDB
public static CollectionsEntity getCollectionFromCacheOrDB(long collectionId, long businessId, String locale, AccountCommonServices accountCommonService, CollectionsRepository collectionRepository) - Parameters:
collectionId
- the collectionIdbusinessId
- the businessIdlocale
- the localeaccountCommonService
- the accountCommonServicecollectionRepository
- teh collectionRepository- Returns:
- an object of type
CollectionsEntity
-
getCollectionFromCacheOrDB
public static CollectionsEntity getCollectionFromCacheOrDB(long collectionId, AccountCommonServices accountCommonService, CollectionsRepository collectionRepository) - Parameters:
collectionId
- the collectionIdaccountCommonService
- the accountCommonServicecollectionRepository
- teh collectionRepository- Returns:
- an object of type
CollectionsEntity
-
isValidCollection
public static boolean isValidCollection(long collectionId, long businessId, CollectionsRepository collectionRepository, AccountCommonServices accountCommonServices) isValidCollection- Parameters:
collectionId
- the collectionIdbusinessId
- the businessIdcollectionRepository
- the collectionRepositoryaccountCommonServices
- the accountCommonServices- Returns:
- a boolean value
-
getCollectionAttributeFromCacheOrDB
public static Iterable<CollectionAttributesEntity> getCollectionAttributeFromCacheOrDB(AccountCommonServices accountCommonService, CollectionAttributesRepository collectionAttributeRepository) -
getAttributeFromCacheOrDB
public static AttributeEntity getAttributeFromCacheOrDB(long collectionId, String attributeId, AccountCommonServices accountCommonService) -
getAccountTypeNameFromCacheOrDB
public static AccountTypesEntity getAccountTypeNameFromCacheOrDB(long collectionId, long typeId, AccountCommonServices accountCommonService) -
getCollectionDOFromCacheOrDB
public static CollectionsDO getCollectionDOFromCacheOrDB(long collectionId, AccountCommonServices accountCommonService, CollectionsRepository collectionRepository, CollectionAttributesRepository collectionAttributeRepository) - Parameters:
collectionId
- the collectionIdaccountCommonService
- the accountCommonServicecollectionRepository
- teh collectionRepository- Returns:
- an object of type
CollectionsEntity
-
getAccountTypeByIdAndCollectionIdFromCacheOrDb
public static AccountTypesEntity getAccountTypeByIdAndCollectionIdFromCacheOrDb(long id, Long collectionId, AccountCommonServices accountCommonService) - Parameters:
id
- the accountTypeIdIdcollectionId
- the collectionIdaccountCommonService
- the accountCommonService- Returns:
- an object of type
AccountTypesEntity
-
getAddressByIdAndAccountIdFromCacheOrDb
public static AddressesDO getAddressByIdAndAccountIdFromCacheOrDb(long id, long accountId, AccountCommonServices accountCommonService, org.springframework.context.MessageSource messageSource, String locale) - Parameters:
id
- the addressIdaccountId
- the accountIdaccountCommonService
-messageSource
- the accountCommonServicelocale
- an object of typeString
- Returns:
- an object of type
AddressesDO
-