Skip to content

explicit inheritance of com.amazonaws.AmazonWebServiceClient's methods fo #3

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from
Closed

explicit inheritance of com.amazonaws.AmazonWebServiceClient's methods fo #3

wants to merge 1 commit into from

Conversation

xoba
Copy link

@xoba xoba commented Nov 8, 2011

explicit inheritance of com.amazonaws.AmazonWebServiceClient's methods for all aws service interfaces, like com.amazonaws.services.s3.AmazonS3.

in particular, this exposes the method "addRequestHandler," which is convenient for "requester pays buckets" where
you use a com.amazonaws.handlers.RequestHandler to add the "x-amz-request-payer: requester" header. without this new feature,
one is forced to use class com.amazonaws.services.s3.AmazonS3Client, instead of interface com.amazonaws.services.s3.AmazonS3;
the latter is sort of preferred from basic object-oriented programming principles.

for instance: here's how i now can access a request-pays bucket:

    AmazonS3 s3 = ................;

    s3.addRequestHandler(new AbstractRequestHandler() {
        @Override
        public void beforeRequest(Request<?> request) {
            request.addHeader("x-amz-request-payer", "requester");
            System.out.println("added request payer: " + request);
        }
    });

    for (S3ObjectSummary s : s3.listObjects("commoncrawl-crawl-002").getObjectSummaries()) {
        System.out.println(s.getKey());
    }

…s for all aws service interfaces, like com.amazonaws.services.s3.AmazonS3.

in particular, this exposes the method "addRequestHandler," which is convenient for "requester pays buckets" where
you use a com.amazonaws.handlers.RequestHandler to add the "x-amz-request-payer: requester" header. without this new feature,
one is forced to use class com.amazonaws.services.s3.AmazonS3Client, instead of interface com.amazonaws.services.s3.AmazonS3;
the latter is sort of preferred from basic object-oriented programming principles.
@xoba
Copy link
Author

xoba commented Nov 13, 2011

after thinking about this a few more days, i think i'm actually satisfied calling the addRequestHandler method on the implementation classes like com.amazonaws.services.s3.AmazonS3Client directly... thus, i'm sort of "cancelling" my pull request.

@xoba xoba closed this Nov 13, 2011
@debora-ito debora-ito added response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days. and removed needs-response labels Feb 25, 2020
jamesceddy added a commit to jamesceddy/aws-sdk-java that referenced this pull request Mar 15, 2020
Suppose we have 10 parts, if we fail on part aws#2 we fire a "TRANFER_FAILED_EVENT" back to the client. We should assume that
clients will react to this failure, possibly with custom logic to retry. Supposing that part aws#3 succeeds, the client will then get
other transfer events past the "TRANSFER_FAILED_EVENT". I assume here that "TRANSFER_FAILED_EVENT" is a terminal event and that
a client should not expect to receive further events for that transfer, successful or not. However, the meaning of TRANSFER_FAILED_EVENT
is not clearly defined in the javadocs.

relates to: aws#2263
jamesceddy added a commit to jamesceddy/aws-sdk-java that referenced this pull request Mar 17, 2020
Suppose we have 10 parts, if we fail on part aws#2 we fire a "TRANFER_FAILED_EVENT" back to the client. We should assume that
clients will react to this failure, possibly with custom logic to retry. Supposing that part aws#3 succeeds, the client will then get
other transfer events past the "TRANSFER_FAILED_EVENT". I assume here that "TRANSFER_FAILED_EVENT" is a terminal event and that
a client should not expect to receive further events for that transfer, successful or not. However, the meaning of TRANSFER_FAILED_EVENT
is not clearly defined in the javadocs.

fixes: aws#2267
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants