io.iron.ironmq.QueuePushModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ironmq Show documentation
Show all versions of ironmq Show documentation
An easy-to-use highly available message queuing service. Built for distributed
cloud applications with critical messaging needs. Provides on-demand message
queuing with HTTPS transport, one-time FIFO delivery, message persistence,
and cloud-optimized performance.
package io.iron.ironmq;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
public class QueuePushModel {
private ArrayList subscribers;
private Integer retries;
@SerializedName("retries_delay") private Integer retriesDelay;
@SerializedName("error_queue") private String errorQueue;
public QueuePushModel(ArrayList subscribers, Integer retries, Integer retriesDelay, String errorQueue) {
this.subscribers = subscribers;
this.retries = retries;
this.retriesDelay = retriesDelay;
this.errorQueue = errorQueue;
}
public QueuePushModel(ArrayList subscribers) {
this(subscribers, null, null, null);
}
public QueuePushModel() {
this(null, null, null, null);
}
public ArrayList getSubscribers() {
return subscribers;
}
public void setSubscribers(ArrayList subscribers) {
this.subscribers = subscribers;
}
public Integer getRetries() {
return retries;
}
public void setRetries(Integer retries) {
this.retries = retries;
}
public Integer getRetriesDelay() {
return retriesDelay;
}
public void setRetriesDelay(Integer retriesDelay) {
this.retriesDelay = retriesDelay;
}
public String getErrorQueue() {
return errorQueue;
}
public void setErrorQueue(String errorQueue) {
this.errorQueue = errorQueue;
}
public void addSubscriber(Subscriber subscriber) {
synchronized (this) {
if (subscribers == null) {
subscribers = new ArrayList();
}
}
subscribers.add(subscriber);
}
public void addSubscribers(ArrayList subscribers) {
synchronized (this) {
if (subscribers == null) {
subscribers = new ArrayList();
}
}
subscribers.addAll(subscribers);
}
public void removeSubscribers() {
if (subscribers != null) {
subscribers.clear();
}
}
}