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

com.amazonaws.services.sqs.executors.DeduplicatedRunnable Maven / Gradle / Ivy

Go to download

An Amazon SQS client that supports creating lightweight, automatically-deleted temporary queues, for use in common messaging patterns such as Request/Response. See http://aws.amazon.com/sqs.

The newest version!
package com.amazonaws.services.sqs.executors;

public class DeduplicatedRunnable implements SerializableRunnable, Deduplicated {

    private static final long serialVersionUID = -2531422031653089835L;

    private final SerializableRunnable task;
    private final String deduplicationId;

    public DeduplicatedRunnable(SerializableRunnable task) {
        this(task, null);
    }

    public DeduplicatedRunnable(SerializableRunnable task, String deduplicationId) {
        this.task = task;
        this.deduplicationId = deduplicationId;
    }

    public static DeduplicatedRunnable deduplicated(SerializableRunnable task) {
        return new DeduplicatedRunnable(task);
    }

    public static DeduplicatedRunnable deduplicated(SerializableRunnable task, String deduplicationId) {
        return new DeduplicatedRunnable(task, deduplicationId);
    }

    @Override
    public void run() {
        task.run();
    }

    @Override
    public String deduplicationID() {
        return deduplicationId;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy