Class DownloadServiceGrpc.DownloadServiceBlockingStub
java.lang.Object
io.grpc.stub.AbstractStub<DownloadServiceGrpc.DownloadServiceBlockingStub>
io.grpc.stub.AbstractBlockingStub<DownloadServiceGrpc.DownloadServiceBlockingStub>
com.soulfiremc.grpc.generated.DownloadServiceGrpc.DownloadServiceBlockingStub
- Enclosing class:
DownloadServiceGrpc
public static final class DownloadServiceGrpc.DownloadServiceBlockingStub
extends io.grpc.stub.AbstractBlockingStub<DownloadServiceGrpc.DownloadServiceBlockingStub>
A stub to allow clients to do limited synchronous rpc calls to service DownloadService.
Service for downloading content from remote URLs through the SoulFire server. This service acts as a proxy, allowing clients to fetch remote resources using the server's network connection and optionally through a configured proxy. Use cases include: - Downloading resources that may be blocked from the client's network - Fetching content through a specific proxy for anonymity or geo-unlocking - Centralizing external API calls through the server The service uses a Reactor Netty HTTP client with: - 5-second response timeout - Automatic compression support - Default Accept, Accept-Language, and User-Agent headers Authorization: - Requires a valid JWT token - Caller must have DOWNLOAD_URL permission for the specified instance Error handling: - Returns gRPC INTERNAL status on network errors, timeouts, or server failures - The error description contains details about the failure
-
Nested Class Summary
Nested classes/interfaces inherited from class io.grpc.stub.AbstractStub
io.grpc.stub.AbstractStub.StubFactory<T> -
Method Summary
Modifier and TypeMethodDescriptionbuild(io.grpc.Channel channel, io.grpc.CallOptions callOptions) download(DownloadRequest request) Downloads content from the specified URI and returns the response.Methods inherited from class io.grpc.stub.AbstractBlockingStub
newStub, newStubMethods inherited from class io.grpc.stub.AbstractStub
getCallOptions, getChannel, withCallCredentials, withChannel, withCompression, withDeadline, withDeadlineAfter, withDeadlineAfter, withExecutor, withInterceptors, withMaxInboundMessageSize, withMaxOutboundMessageSize, withOnReadyThreshold, withOption, withWaitForReady
-
Method Details
-
build
protected DownloadServiceGrpc.DownloadServiceBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) - Specified by:
buildin classio.grpc.stub.AbstractStub<DownloadServiceGrpc.DownloadServiceBlockingStub>
-
download
Downloads content from the specified URI and returns the response. Makes an HTTP GET request to the URI specified in the request, optionally routing through a proxy. Custom headers can be provided to customize the request. Parameters: request - Contains the target URI, instance ID for permissions, optional headers, and optional proxy configuration Returns: The downloaded content as bytes, along with response headers and HTTP status code Errors: PERMISSION_DENIED - Caller lacks DOWNLOAD_URL permission for the instance INTERNAL - Network error, connection timeout, invalid URI, or other server error
-