All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.kinesis.clientlibrary.utils.RequestUtil Maven / Gradle / Ivy

Go to download

The Amazon Kinesis Client Library for Java enables Java developers to easily consume and process data from Amazon Kinesis.

There is a newer version: 1.15.2
Show newest version
package com.amazonaws.services.kinesis.clientlibrary.utils;

import com.amazonaws.AmazonWebServiceResult;

/**
 * Helper class to parse metadata from AWS requests.
 */
public class RequestUtil {
    private static final String DEFAULT_REQUEST_ID = "NONE";

    /**
     * Get the requestId associated with a request.
     *
     * @param result
     * @return the requestId for a request, or "NONE" if one is not available.
     */
    public static String requestId(AmazonWebServiceResult result) {
        if (result == null || result.getSdkResponseMetadata() == null || result.getSdkResponseMetadata().getRequestId() == null) {
            return DEFAULT_REQUEST_ID;
        }

        return result.getSdkResponseMetadata().getRequestId();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy