Class CacheUtil

java.lang.Object
com.skava.accounts.util.CacheUtil
All Implemented Interfaces:
Serializable

public class CacheUtil extends Object implements 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 Details

    • CacheUtil

      public CacheUtil()
  • Method Details

    • getCollectionFromCacheOrDB

      public static CollectionsEntity getCollectionFromCacheOrDB(long collectionId, long businessId, String locale, AccountCommonServices accountCommonService, CollectionsRepository collectionRepository)
      Parameters:
      collectionId - the collectionId
      businessId - the businessId
      locale - the locale
      accountCommonService - the accountCommonService
      collectionRepository - teh collectionRepository
      Returns:
      an object of type CollectionsEntity
    • getCollectionFromCacheOrDB

      public static CollectionsEntity getCollectionFromCacheOrDB(long collectionId, AccountCommonServices accountCommonService, CollectionsRepository collectionRepository)
      Parameters:
      collectionId - the collectionId
      accountCommonService - the accountCommonService
      collectionRepository - 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 collectionId
      businessId - the businessId
      collectionRepository - the collectionRepository
      accountCommonServices - 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 collectionId
      accountCommonService - the accountCommonService
      collectionRepository - teh collectionRepository
      Returns:
      an object of type CollectionsEntity
    • getAccountTypeByIdAndCollectionIdFromCacheOrDb

      public static AccountTypesEntity getAccountTypeByIdAndCollectionIdFromCacheOrDb(long id, Long collectionId, AccountCommonServices accountCommonService)
      Parameters:
      id - the accountTypeIdId
      collectionId - the collectionId
      accountCommonService - 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 addressId
      accountId - the accountId
      accountCommonService -
      messageSource - the accountCommonService
      locale - an object of type String
      Returns:
      an object of type AddressesDO