This commit is contained in:
Gabriele C
2017-11-02 11:24:17 +01:00
parent 6505538240
commit 273c318e96
22 changed files with 105 additions and 118 deletions
@@ -262,4 +262,18 @@ public class CacheDataSource implements DataSource {
.map(PlayerAuth::getRealName)
.collect(Collectors.toList());
}
@Override
public void invalidateCache(String playerName) {
cachedAuths.invalidate(playerName);
}
@Override
public void refreshCache(String playerName) {
if (cachedAuths.getIfPresent(playerName) == null) {
return;
}
cachedAuths.refresh(playerName);
}
}
@@ -231,4 +231,20 @@ public interface DataSource extends Reloadable {
@Override
void reload();
/**
* Invalidate any cached data related to the specified player name.
*
* @param playerName the player name
*/
default void invalidateCache(String playerName) {
}
/**
* Refresh any cached data (if present) related to the specified player name.
*
* @param playerName the player name
*/
default void refreshCache(String playerName) {
}
}