mirror of
https://github.com/funkemunky/AntiVPN.git
synced 2026-05-31 17:31:55 +00:00
43 lines
1008 B
Java
43 lines
1008 B
Java
package dev.brighten.antivpn.database;
|
|
|
|
import dev.brighten.antivpn.utils.VPNResponse;
|
|
|
|
import java.util.List;
|
|
import java.util.Optional;
|
|
import java.util.UUID;
|
|
import java.util.function.Consumer;
|
|
|
|
public interface VPNDatabase {
|
|
Optional<VPNResponse> getStoredResponse(String ip);
|
|
|
|
void cacheResponse(VPNResponse toCache);
|
|
|
|
boolean isWhitelisted(UUID uuid);
|
|
|
|
boolean isWhitelisted(String ip);
|
|
|
|
void setWhitelisted(UUID uuid, boolean whitelisted);
|
|
|
|
void setWhitelisted(String ip, boolean whitelisted);
|
|
|
|
List<UUID> getAllWhitelisted();
|
|
|
|
List<String> getAllWhitelistedIps();
|
|
|
|
void getStoredResponseAsync(String ip, Consumer<Optional<VPNResponse>> result);
|
|
|
|
void isWhitelistedAsync(UUID uuid, Consumer<Boolean> result);
|
|
|
|
void isWhitelistedAsync(String ip, Consumer<Boolean> result);
|
|
|
|
void alertsState(UUID uuid, Consumer<Boolean> result);
|
|
|
|
void updateAlertsState(UUID uuid, boolean state);
|
|
|
|
void clearResponses();
|
|
|
|
void init();
|
|
|
|
void shutdown();
|
|
}
|