Class RedissonCachedSellerListingsService
java.lang.Object
org.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,String,org.oxerr.viagogo.model.request.inventory.CreateSellerListingRequest,ViagogoListing,ViagogoEvent,ViagogoCachedListing>
org.oxerr.viagogo.client.cached.redisson.inventory.RedissonCachedSellerListingsService
- All Implemented Interfaces:
org.oxerr.ticket.inventory.support.cached.CachedListingService<String,
,String, org.oxerr.viagogo.model.request.inventory.CreateSellerListingRequest, ViagogoListing, ViagogoEvent> CachedSellerListingsService
public class RedissonCachedSellerListingsService
extends org.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,String,org.oxerr.viagogo.model.request.inventory.CreateSellerListingRequest,ViagogoListing,ViagogoEvent,ViagogoCachedListing>
implements CachedSellerListingsService
-
Field Summary
Fields inherited from class org.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport
executor, keyPrefix, redisson
-
Constructor Summary
ConstructorDescriptionRedissonCachedSellerListingsService
(org.oxerr.viagogo.client.inventory.SellerListingService sellerListingsService, org.redisson.api.RedissonClient redissonClient, String keyPrefix, Executor executor) Constructs with defaultListingConfiguration
and defaultRetryConfiguration
.RedissonCachedSellerListingsService
(org.oxerr.viagogo.client.inventory.SellerListingService sellerListingsService, 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.RedissonCachedSellerListingsService
(org.oxerr.viagogo.client.inventory.SellerListingService sellerListingsService, org.redisson.api.RedissonClient redissonClient, String keyPrefix, Executor executor, org.oxerr.ticket.inventory.support.cached.redisson.ListingConfiguration listingConfiguration, int pageSize, RetryConfiguration retryConfiguration) Constructs with specifiedListingConfiguration
and specifiedRetryConfiguration
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
check()
Check all listings and delete which not in cache.protected void
createListing
(ViagogoEvent event, ViagogoListing listing) protected void
deleteListing
(ViagogoEvent event, String listingId) protected int
getPriority
(ViagogoEvent event, ViagogoListing listing, ViagogoCachedListing cachedListing) protected boolean
shouldCreate
(ViagogoEvent event, ViagogoListing listing, ViagogoCachedListing cachedListing) protected boolean
shouldDelete
(ViagogoEvent event, Set<String> inventoryListingIds, String listingId, ViagogoCachedListing cachedListing) protected boolean
shouldUpdate
(ViagogoEvent event, ViagogoListing listing, ViagogoCachedListing cachedListing) protected ViagogoCachedListing
toCached
(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, updateListings
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
-
RedissonCachedSellerListingsService
@Deprecated(since="5.0.0", forRemoval=true) public RedissonCachedSellerListingsService(org.oxerr.viagogo.client.inventory.SellerListingService sellerListingsService, 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. -
RedissonCachedSellerListingsService
public RedissonCachedSellerListingsService(org.oxerr.viagogo.client.inventory.SellerListingService sellerListingsService, org.redisson.api.RedissonClient redissonClient, String keyPrefix, Executor executor) Constructs with defaultListingConfiguration
and defaultRetryConfiguration
.- Parameters:
sellerListingsService
- the seller listings service.redissonClient
- the redisson client.keyPrefix
- the key prefix for the cache.executor
- the executor.- Since:
- 5.0.0
-
RedissonCachedSellerListingsService
public RedissonCachedSellerListingsService(org.oxerr.viagogo.client.inventory.SellerListingService sellerListingsService, org.redisson.api.RedissonClient redissonClient, String keyPrefix, Executor executor, org.oxerr.ticket.inventory.support.cached.redisson.ListingConfiguration listingConfiguration, int pageSize, RetryConfiguration retryConfiguration) Constructs with specifiedListingConfiguration
and specifiedRetryConfiguration
.- Parameters:
sellerListingsService
- the seller listings 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:
shouldCreate
in classorg.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,
String, org.oxerr.viagogo.model.request.inventory.CreateSellerListingRequest, ViagogoListing, ViagogoEvent, ViagogoCachedListing>
-
shouldUpdate
protected boolean shouldUpdate(@Nonnull ViagogoEvent event, @Nonnull ViagogoListing listing, @Nullable ViagogoCachedListing cachedListing) - Overrides:
shouldUpdate
in classorg.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,
String, org.oxerr.viagogo.model.request.inventory.CreateSellerListingRequest, ViagogoListing, ViagogoEvent, ViagogoCachedListing>
-
getPriority
protected int getPriority(@Nonnull ViagogoEvent event, @Nullable ViagogoListing listing, @Nullable ViagogoCachedListing cachedListing) - Overrides:
getPriority
in classorg.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,
String, org.oxerr.viagogo.model.request.inventory.CreateSellerListingRequest, ViagogoListing, ViagogoEvent, ViagogoCachedListing>
-
shouldDelete
protected boolean shouldDelete(@Nonnull ViagogoEvent event, @Nonnull Set<String> inventoryListingIds, @Nonnull String listingId, @Nonnull ViagogoCachedListing cachedListing) - Overrides:
shouldDelete
in classorg.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,
String, org.oxerr.viagogo.model.request.inventory.CreateSellerListingRequest, ViagogoListing, ViagogoEvent, ViagogoCachedListing>
-
createListing
- Specified by:
createListing
in classorg.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,
String, org.oxerr.viagogo.model.request.inventory.CreateSellerListingRequest, ViagogoListing, ViagogoEvent, ViagogoCachedListing> - Throws:
IOException
-
deleteListing
- Specified by:
deleteListing
in classorg.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,
String, org.oxerr.viagogo.model.request.inventory.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:
toCached
in classorg.oxerr.ticket.inventory.support.cached.redisson.RedissonCachedListingServiceSupport<String,
String, org.oxerr.viagogo.model.request.inventory.CreateSellerListingRequest, ViagogoListing, ViagogoEvent, ViagogoCachedListing>
-
check
public void check()Description copied from interface:CachedSellerListingsService
Check all listings and delete which not in cache.- Specified by:
check
in interfaceCachedSellerListingsService
-