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

com.jetdrone.vertx.mods.stomp.StompSubscriptions Maven / Gradle / Ivy

package com.jetdrone.vertx.mods.stomp;

import org.vertx.java.core.Handler;

import java.util.HashMap;
import java.util.Map;

public class StompSubscriptions {

    private final Map> subscribers = new HashMap<>();

    public void registerSubscribeHandler(String id, Handler replyHandler) {
        subscribers.put(id, replyHandler);
    }

    public void unregisterSubscribeHandler(String id) {
        if (id == null) {
            subscribers.clear();
        } else {
            subscribers.remove(id);
        }
    }

    public Handler getHandler(String id) {
        return subscribers.get(id);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy