io.moquette.broker.MemoryQueueRepository Maven / Gradle / Ivy
package io.moquette.broker;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
public class MemoryQueueRepository implements IQueueRepository {
private Map> queues = new HashMap<>();
@Override
public Queue createQueue(String cli, boolean clean) {
final ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue<>();
queues.put(cli, queue);
return queue;
}
@Override
public Map> listAllQueues() {
return Collections.unmodifiableMap(queues);
}
}