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

io.iron.ironmq.QueuePushModel Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 3.0.5
Show newest version
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();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy