Cleanup
This commit is contained in:
@@ -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) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user