public class TextFilterer extends Object implements AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
TextFilterer.FailedHttpRequestException |
static interface |
TextFilterer.HashIgnorer |
(package private) class |
TextFilterer.Impl |
Modifier and Type | Field and Description |
---|---|
private String |
apiKey |
private URL |
chatEndpoint |
private ExecutorService |
executor |
private TextFilterer.HashIgnorer |
ignorer |
private URL |
joinEndpoint |
private URL |
leaveEndpoint |
private static Logger |
LOGGER |
private static AtomicInteger |
NEXT_WORKER_ID |
private int |
ruleId |
private String |
serverId |
private static ThreadFactory |
THREAD_FACTORY |
Constructor and Description |
---|
TextFilterer() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
private void |
consumeFully(InputStream inputStream) |
private HttpURLConnection |
createConnection(JsonObject payload,
URL endpoint) |
TextStream |
createFilterer(com.mojang.authlib.GameProfile gameProfile) |
private CompletableFuture<Optional<String>> |
filterMessage(com.mojang.authlib.GameProfile gameProfile,
String message,
TextFilterer.HashIgnorer ignorer,
Executor executor) |
private void |
sendJoinOrLeaveRequest(com.mojang.authlib.GameProfile gameProfile,
URL endpoint,
Executor executor) |
private JsonObject |
sendJsonRequest(JsonObject payload,
URL endpoint) |
private void |
sendRequest(JsonObject payload,
URL endpoint) |
private static final Logger LOGGER
private static final AtomicInteger NEXT_WORKER_ID
private static final ThreadFactory THREAD_FACTORY
private final URL chatEndpoint
private final URL joinEndpoint
private final URL leaveEndpoint
private final String apiKey
private final int ruleId
private final String serverId
private final TextFilterer.HashIgnorer ignorer
private final ExecutorService executor
private void sendJoinOrLeaveRequest(com.mojang.authlib.GameProfile gameProfile, URL endpoint, Executor executor)
private CompletableFuture<Optional<String>> filterMessage(com.mojang.authlib.GameProfile gameProfile, String message, TextFilterer.HashIgnorer ignorer, Executor executor)
public void close()
close
in interface AutoCloseable
private void consumeFully(InputStream inputStream) throws IOException
IOException
private JsonObject sendJsonRequest(JsonObject payload, URL endpoint) throws IOException
IOException
private void sendRequest(JsonObject payload, URL endpoint) throws IOException
IOException
private HttpURLConnection createConnection(JsonObject payload, URL endpoint) throws IOException
IOException
public TextStream createFilterer(com.mojang.authlib.GameProfile gameProfile)