MagmaguyRspClient

public final class MagmaguyRspClient implements AutoCloseable

Reusable HTTP client for the magmaguy.com resource-pack hosting API.

This client is stateless with respect to session: callers (e.g. AutoHost) supply the per-call uuid/sha1 arguments and own the lifecycle of any keep-alive scheduling. The client only handles HTTP request/response plumbing.

An in-flight cancellation mechanism is provided via abortInFlight. Every shared or per-upload client is tracked so concurrent keep-alive, relay, and pack uploads are all torn down promptly during plugin disable.

Constructors

Link copied to clipboard
public void MagmaguyRspClient(Logger logger, int defaultSocketTimeoutSeconds, int uploadSocketTimeoutSeconds)

Types

Link copied to clipboard
public final class BedrockEndpoint extends Record
Direct backend HTTP endpoint announced by a Bukkit backend.
Link copied to clipboard
public final class BedrockRelayEntry extends Record
One entry in a network's relay index.
Link copied to clipboard
public final class ProbeResult extends Record
Result of a probe call.
Link copied to clipboard
public final class RelayDeleteResult extends Record
Link copied to clipboard
Link copied to clipboard
public final class Sha1Result extends Record
Result of a sha1Check call.
Link copied to clipboard
public final class UploadResult extends Record

Properties

Link copied to clipboard
public final static String BASE_URL
Link copied to clipboard
public final static String DISABLE_REMOTE_RELAY_PROPERTY

Functions

Link copied to clipboard
public void abortInFlight()
Abort any in-flight blocking request by closing the underlying HTTP client.
Link copied to clipboard
public Optional<MagmaguyRspClient.BedrockEndpoint> announceBedrockEndpoint(String networkKey, String backendId, String publicHostOrNull, int mcPort, int httpPort)
Announce the backend's actual RSPM HTTP port.
Link copied to clipboard
public void close()
Link copied to clipboard
public MagmaguyRspClient.RelayDeleteResult deleteBedrockRelay(String networkKey, String backendId, String kindOrNull)
Drop a backend's relay entry (or both kinds if kindOrNull == null).
Link copied to clipboard
public MagmaguyRspClient.RelayDeleteResult deleteBedrockRelayOnShutdown(String networkKey, String backendId)
Independent two-second delete path that remains usable after abortInFlight().
Link copied to clipboard
public Optional<String> detectPublicIp()
Best-effort public IPv4 detection.
Link copied to clipboard
public MagmaguyRspClient.RelayDownloadResult downloadBedrockRelay(String networkKeyHash, String backendId, String kind, File dest)
Download a relay entry to dest.
Link copied to clipboard
public void downloadDataCompliance(String uuid, File destination)
POST /rsp/data_compliance — downloads the data-compliance zip into the given destination file.
Link copied to clipboard
public Optional<String> initialize(String existingUuidOrNull)
POST /rsp/initialize.
Link copied to clipboard
public static boolean isRemoteRelayDisabled()
Explicitly disables only the distributed Bedrock endpoint registry and relay calls.
Link copied to clipboard
List fresh direct-backend endpoint announcements for this network.
Link copied to clipboard
public List<MagmaguyRspClient.BedrockRelayEntry> listBedrockRelay(String networkKey)
List all live relay entries for the given network.
Link copied to clipboard
Ask the hoster to fetch the given URL from its public network vantage and report back whether the URL is reachable.
Link copied to clipboard
public MagmaguyRspClient.Sha1Result sha1Check(String uuid, String sha1)
POST /rsp/sha1.
Link copied to clipboard
public boolean stillAlive(String uuid)
POST /rsp/still_alive.
Link copied to clipboard
public MagmaguyRspClient.UploadResult upload(String uuid, File pack)
POST /rsp/upload.
public MagmaguyRspClient.UploadResult upload(String uuid, File pack, String expectedSha1)
Uploads a pack while asking the hoster to verify that the received bytes match the SHA1 that triggered publication.
Link copied to clipboard
public Optional<MagmaguyRspClient.BedrockRelayEntry> uploadBedrockRelay(String networkKey, String backendId, String kind, File file, String sha1HexOrNull)
Upload a Bedrock pack (kind="zip") or Geyser mappings file (kind="mappings") to the relay under this network.