Class RedissonCachedSellerListingService
java.lang.Object
org.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,String,CreateSellerListingRequest,ViagogoListing,ViagogoEvent,ViagogoCachedListing>
org.oxerr.viagogo.client.cached.redisson.inventory.RedissonCachedSellerListingService
- All Implemented Interfaces:
org.oxerr.ticket.inventory.support.cached.CachedListingService<String,,String, CreateSellerListingRequest, ViagogoListing, ViagogoEvent> CachedSellerListingService,CachedSellerListingsService
- Direct Known Subclasses:
RedissonCachedSellerListingsService
public class RedissonCachedSellerListingService
extends org.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,String,CreateSellerListingRequest,ViagogoListing,ViagogoEvent,ViagogoCachedListing>
implements CachedSellerListingsService, CachedSellerListingService
-
Field Summary
Fields inherited from class org.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport
executor, keyPrefix, redisson -
Constructor Summary
ConstructorsConstructorDescriptionRedissonCachedSellerListingService(SellerListingService sellerListingService, org.redisson.api.RedissonClient redissonClient, String keyPrefix, Executor executor) Constructs with defaultListingConfigurationand defaultRetryConfiguration.RedissonCachedSellerListingService(SellerListingService sellerListingService, org.redisson.api.RedissonClient redissonClient, String keyPrefix, Executor executor, boolean create) Deprecated, for removal: This API element is subject to removal in a future version.RedissonCachedSellerListingService(SellerListingService sellerListingService, org.redisson.api.RedissonClient redissonClient, String keyPrefix, Executor executor, org.oxerr.ticket.inventory.support.cached.redisson.ListingConfiguration listingConfiguration, int pageSize, RetryConfiguration retryConfiguration) Constructs with specifiedListingConfigurationand specifiedRetryConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheck()Check all listings and delete which not in cache.protected voidcreateListing(ViagogoEvent event, ViagogoListing listing) protected voiddeleteListing(ViagogoEvent event, String listingId) protected intgetPriority(ViagogoEvent event, ViagogoListing listing, ViagogoCachedListing cachedListing) protected booleanshouldCreate(ViagogoEvent event, ViagogoListing listing, ViagogoCachedListing cachedListing) protected booleanshouldDelete(ViagogoEvent event, Set<String> inventoryListingIds, String listingId, ViagogoCachedListing cachedListing) protected booleanshouldUpdate(ViagogoEvent event, ViagogoListing listing, ViagogoCachedListing cachedListing) protected ViagogoCachedListingtoCached(ViagogoEvent event, ViagogoListing listing, org.oxerr.ticket.inventory.support.cached.redisson.Status status) Methods inherited from class org.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport
callAsync, callAsync, createListing, deleteListing, getCache, getCache, getCacheName, getCacheName, getCacheNamePattern, getCacheNamesStream, getCacheNamesStream, getCacheSize, getEventCache, getListedCount, getListedRequest, getListedRequest, getListedRequest, getListedRequest, getRequest, getRequest, getRequest, getRequest, isListed, isListed, toSupplier, updateListing, updateListing, updateListingsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.oxerr.ticket.inventory.support.cached.CachedListingService
getCacheNamesStream, getCacheNamesStream, getCacheSize, getListedCount, getListedRequest, getListedRequest, getListedRequest, getListedRequest, getRequest, getRequest, getRequest, getRequest, isListed, isListed, updateListings
-
Constructor Details
-
RedissonCachedSellerListingService
@Deprecated(since="5.0.0", forRemoval=true) public RedissonCachedSellerListingService(SellerListingService sellerListingService, org.redisson.api.RedissonClient redissonClient, String keyPrefix, Executor executor, boolean create) Deprecated, for removal: This API element is subject to removal in a future version. -
RedissonCachedSellerListingService
public RedissonCachedSellerListingService(SellerListingService sellerListingService, org.redisson.api.RedissonClient redissonClient, String keyPrefix, Executor executor) Constructs with defaultListingConfigurationand defaultRetryConfiguration.- Parameters:
sellerListingService- the seller listing service.redissonClient- the redisson client.keyPrefix- the key prefix for the cache.executor- the executor.- Since:
- 5.0.0
-
RedissonCachedSellerListingService
public RedissonCachedSellerListingService(SellerListingService sellerListingService, org.redisson.api.RedissonClient redissonClient, String keyPrefix, Executor executor, org.oxerr.ticket.inventory.support.cached.redisson.ListingConfiguration listingConfiguration, int pageSize, RetryConfiguration retryConfiguration) Constructs with specifiedListingConfigurationand specifiedRetryConfiguration.- Parameters:
sellerListingService- the seller listing service.redissonClient- the redisson client.keyPrefix- the key prefix for the cache.executor- the executor.listingConfiguration- the listing configuration.pageSize- the page size when do check.retryConfiguration- the retry configuration.- Since:
- 5.0.0
-
-
Method Details
-
shouldCreate
protected boolean shouldCreate(@Nonnull ViagogoEvent event, @Nonnull ViagogoListing listing, @Nullable ViagogoCachedListing cachedListing) - Overrides:
shouldCreatein classorg.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,String, CreateSellerListingRequest, ViagogoListing, ViagogoEvent, ViagogoCachedListing>
-
shouldUpdate
protected boolean shouldUpdate(@Nonnull ViagogoEvent event, @Nonnull ViagogoListing listing, @Nullable ViagogoCachedListing cachedListing) - Overrides:
shouldUpdatein classorg.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,String, CreateSellerListingRequest, ViagogoListing, ViagogoEvent, ViagogoCachedListing>
-
getPriority
protected int getPriority(@Nonnull ViagogoEvent event, @Nullable ViagogoListing listing, @Nullable ViagogoCachedListing cachedListing) - Overrides:
getPriorityin classorg.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,String, CreateSellerListingRequest, ViagogoListing, ViagogoEvent, ViagogoCachedListing>
-
shouldDelete
protected boolean shouldDelete(@Nonnull ViagogoEvent event, @Nonnull Set<String> inventoryListingIds, @Nonnull String listingId, @Nonnull ViagogoCachedListing cachedListing) - Overrides:
shouldDeletein classorg.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,String, CreateSellerListingRequest, ViagogoListing, ViagogoEvent, ViagogoCachedListing>
-
createListing
- Specified by:
createListingin classorg.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,String, CreateSellerListingRequest, ViagogoListing, ViagogoEvent, ViagogoCachedListing> - Throws:
IOException
-
deleteListing
- Specified by:
deleteListingin classorg.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,String, CreateSellerListingRequest, ViagogoListing, ViagogoEvent, ViagogoCachedListing> - Throws:
IOException
-
toCached
protected ViagogoCachedListing toCached(ViagogoEvent event, ViagogoListing listing, org.oxerr.ticket.inventory.support.cached.redisson.Status status) - Specified by:
toCachedin classorg.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,String, CreateSellerListingRequest, ViagogoListing, ViagogoEvent, ViagogoCachedListing>
-
check
public void check()Description copied from interface:CachedSellerListingServiceCheck all listings and delete which not in cache.- Specified by:
checkin interfaceCachedSellerListingService
-