com.amazonaws.services.sqs.executors.DeduplicatedRunnable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of amazon-sqs-java-temporary-queues-client Show documentation
Show all versions of amazon-sqs-java-temporary-queues-client Show documentation
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;
}
}