@Override
    public void beforeRequest(Request<?> request) {
        Arn requestArn = getRequestArn(request);

        if (requestArn != null) {
            resolveHostForOutpostArnRequest(request, requestArn);
        } else if (isNonArnOutpostRequest(request)) {
            resolveHostForOutpostNonArnRequest(request);
        } else {
            resolveHostForNonOutpostNonArnRequest(request);
        }
    }
{@link RequestHandler2} that modifies the endpoint to handle virtual addressing (account id hoisting),
Dual-Stack, and FIPS.
aws-java-sdk-s3control/src/main/java/com/amazonaws/services/s3control/internal/handlers/EndpointHandler.java