@Override public boolean resetLimit(String key) { return expiringKeyMap.remove(key) != null; }
@Override public boolean remove(Object value) { return ExpiringMap.this.remove(value) != null; }
@Override public boolean remove(Object value) { return ExpiringMap.this.remove(value) != null; }
@Override public boolean remove(Object value) { return ExpiringMap.this.remove(value) != null; }
void unlockLocalCache() { localCache.remove(lockKey); logger.debug("free local lock {}", lockKey); }
@Override public void deleteApplication(String applicationId) throws TException { checkIdExists(applicationId); mainTable.remove(applicationId); applicationsByOrg.remove(applicationId); recents.remove(applicationId); }
@Override public void deleteApplication(String applicationId) throws TException { checkIdExists(applicationId); mainTable.remove(applicationId); applicationsByOrg.remove(applicationId); recents.remove(applicationId); }
private void tryInvalidCacheIfConnectingCache() { Object threadLocalValue = RedisCacheConnector.threadLocal.get(); if (threadLocalValue == null) return; localCache.remove(valueKey); if (redisCacheAnn.redisFor() == RedisFor.StoreValue) redis.del(valueKey); }
@Override public void put(String key, byte[] value, long ttl) { Objects.requireNonNull(key); value = clone(value); if (value == null) { map.remove(key); } else if (ttl == 0) { map.put(key, value); } else { map.put(key, value, ttl, TimeUnit.SECONDS); } }
Object getLocalCache() { CachedValueWrapper cachedValue = localCache.get(valueKey); if (cachedValue != null) { long expectedExpiration = getExpectedExpirationSeconds(); logger.debug("got local {} = {} with expiration {} seconds", valueKey, cachedValue.getValue(), expectedExpiration); if (expectedExpiration >= 0) this.value = cachedValue.getValue(); else localCache.remove(valueKey); } else { logger.debug("got local {} = null", valueKey); } return this.value; }
@Override public boolean compareAndSet(String key, byte[] expected, byte[] value, long ttl) { Objects.requireNonNull(key); // clone is not needed if the comparison fails // but we are optimistic and prefer to do the clone outside the lock value = clone(value); // we don't use ExpiringMap.replace because it deals with null differently writeLock.lock(); try { byte[] current = map.get(key); boolean equal = Arrays.equals(expected, current); if (equal) { if (value == null) { map.remove(key); } else { map.put(key, value); doSetTTL(key, ttl); } } return equal; } finally { writeLock.unlock(); } }
private void scanEntries() { for (String key : cache.keySet()) { CachedValueWrapper wrapper = cache.get(key); if (wrapper.getRedisCacheAnn().redisFor() == StoreValue) continue; long expiration = RedisCacheUtils.redisExpirationSeconds(key, appContext); long cacheExpiration = cache.getExpiration(key); if (expiration == cacheExpiration) continue; CachedValueWrapper removed = cache.remove(key); if (removed == null) continue; Logger logger = wrapper.getLogger(); logger.debug("invalidate cache {} because of redis refresh seconds changed to {} ", key, expiration); } }
@Override public void deleteMessage(String applicationId, String messageId) throws TException { checkThat(applicationId, messageId) .throwing(InvalidArgumentException.class) .are(nonEmptyString()); if (!messages.containsKey(messageId)) { return; } Message message = messages.remove(messageId); String appId = message.applicationId; Set<String> appMessages = messagesByApplication.getOrDefault(appId, Sets.create()); appMessages.remove(messageId); messagesByApplication.put(appId, appMessages); }
@Override public void deleteMessage(String applicationId, String messageId) throws TException { checkThat(applicationId, messageId) .throwing(InvalidArgumentException.class) .are(nonEmptyString()); if (!messages.containsKey(messageId)) { return; } Message message = messages.remove(messageId); String appId = message.applicationId; Set<String> appMessages = messagesByApplication.getOrDefault(appId, Sets.create()); appMessages.remove(messageId); messagesByApplication.put(appId, appMessages); }
@Override public void deleteToken(String tokenId) throws TException { checkThat(tokenId) .usingMessage("missing tokenId") .throwing(InvalidArgumentException.class) .is(nonEmptyString()); synchronized (tokens) { AuthenticationToken token = tokens.remove(tokenId); if (token == null) { return; } deleteTokenFromOwner(token); } }
@Override public void deleteToken(String tokenId) throws TException { checkThat(tokenId) .usingMessage("missing tokenId") .throwing(InvalidArgumentException.class) .is(nonEmptyString()); synchronized (tokens) { AuthenticationToken token = tokens.remove(tokenId); if (token == null) { return; } deleteTokenFromOwner(token); } }
public AccessToken refreshAccessToken(AccessToken old) { if(old instanceof MappedAccessToken) { tokenMappings.remove(((MappedAccessToken) old).getRawToken()); } if (null == config.getTokenUrl()) { throw new IllegalStateException("The tokenUrl must be configured"); } HttpRequest request = httpClient.request(config.getTokenUrl()).addFormParam("grant_type", "refresh_token") .addFormParam("refresh_token", old.getRefreshToken()).setMethod(HTTP.Method.POST); AccessToken newAt= fetchAccessToken(request); if(old instanceof MappedAccessToken){ MappedAccessToken mapped=new MappedAccessToken(((MappedAccessToken)old).getRawToken(), newAt); tokenMappings.put(mapped.getRawToken(), mapped); newAt=mapped; } return newAt; }
requestCache.remove(token);
.filter(e -> this.ensureJoinedViaQueue) .handler(e -> { Response response = this.expectedPlayers.remove(e.getUniqueId()); if (response == null || !response.isAllowed()) { e.disallow(AsyncPlayerPreLoginEvent.Result.KICK_WHITELIST, Text.colorize("&cSorry! The server is unable to process your login at this time. (queue error)"));