// Path: westty-api/src/main/java/org/deephacks/westty/cluster/ClusterListener.java
// public interface ClusterListener<K, V> {
//     /**
//      * Invoked when an entry is added.
//      *
//      * @param event entry event
//      */
//     void entryAdded(EntryEvent<K, V> event);
// 
//     /**
//      * Invoked when an entry is removed.
//      *
//      * @param event entry event
//      */
//     void entryRemoved(EntryEvent<K, V> event);
// 
//     /**
//      * Invoked when an entry is updated.
//      *
//      * @param event entry event
//      */
//     void entryUpdated(EntryEvent<K, V> event);
// 
//     /**
//      * Invoked when an entry is evicted.
//      *
//      * @param event entry event
//      */
//     void entryEvicted(EntryEvent<K, V> event);
// 
// }
// 
// Path: westty-api/src/main/java/org/deephacks/westty/cluster/DistributedMultiMap.java
// public interface DistributedMultiMap<K, V> {
// 
//     boolean remove(Object key, Object value);
// 
//     boolean put(K key, V value);
// 
//     void addEntryListener(ClusterListener<K, V> listener, boolean includeValue);
// 
//     Set<Map.Entry<K, V>> entrySet();
// 
//     Collection<V> get(K key);
// }
// 
// Path: westty-api/src/main/java/org/deephacks/westty/cluster/EntryEvent.java
// public interface EntryEvent<K, V> {
//     /**
//      * Returns the key of the entry event
//      *
//      * @return the key
//      */
//     public K getKey();
// 
//     /**
//      * Returns the old value of the entry event
//      *
//      * @return
//      */
//     public V getOldValue();
// 
//     /**
//      * Returns the value of the entry event
//      *
//      * @return
//      */
//     public V getValue();
// 
//     /**
//      * Returns the member fired this event.
//      *
//      * @return the member fired this event.
//      */
//     public Server getMember();
// 
//     /**
//      * Return the event type
//      *
//      * @return event type
//      */
//     public EntryEventType getEventType();
// 
//     /**
//      * Returns the name of the map for this event.
//      *
//      * @return name of the map.
//      */
//     public String getName();
// 
//     public static enum EntryEventType {
//         ADDED(1), REMOVED(2), UPDATED(3), EVICTED(4);
// 
//         private int type;
// 
//         private EntryEventType(final int type) {
//             this.type = type;
//         }
// 
//         public int getType() {
//             return type;
//         }
// 
//         public static EntryEventType getByType(final int eventType) {
//             for (EntryEventType entryEventType : values()) {
//                 if (entryEventType.type == eventType) {
//                     return entryEventType;
//                 }
//             }
//             return null;
//         }
//     }
// 
// }


import org.deephacks.westty.cluster.ClusterListener;
import org.deephacks.westty.cluster.DistributedMultiMap;
import org.deephacks.westty.cluster.EntryEvent;
import org.vertx.java.core.AsyncResult;
import org.vertx.java.core.AsyncResultHandler;
import org.vertx.java.core.eventbus.impl.ServerIDs;
import org.vertx.java.core.eventbus.impl.SubsMap;
import org.vertx.java.core.eventbus.impl.hazelcast.HazelcastServerID;
import org.vertx.java.core.impl.BlockingAction;
import org.vertx.java.core.impl.VertxInternal;
import org.vertx.java.core.net.impl.ServerID;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
package org.deephacks.westty.internal.sockjs;



/**
 * Modified version of HazelcastSubsMap by <a href="http://tfox.org">Tim Fox</a>.
 *
 * Purpose is to decouple hazelcast implementation from Vertx.
 */
public class WesttySubsMap implements SubsMap, ClusterListener<String, HazelcastServerID> {
    private final VertxInternal vertx;
// Path: westty-api/src/main/java/org/deephacks/westty/cluster/ClusterListener.java
// public interface ClusterListener<K, V> {
//     /**
//      * Invoked when an entry is added.
//      *
//      * @param event entry event
//      */
//     void entryAdded(EntryEvent<K, V> event);
// 
//     /**
//      * Invoked when an entry is removed.
//      *
//      * @param event entry event
//      */
//     void entryRemoved(EntryEvent<K, V> event);
// 
//     /**
//      * Invoked when an entry is updated.
//      *
//      * @param event entry event
//      */
//     void entryUpdated(EntryEvent<K, V> event);
// 
//     /**
//      * Invoked when an entry is evicted.
//      *
//      * @param event entry event
//      */
//     void entryEvicted(EntryEvent<K, V> event);
// 
// }
// 
// Path: westty-api/src/main/java/org/deephacks/westty/cluster/DistributedMultiMap.java
// public interface DistributedMultiMap<K, V> {
// 
//     boolean remove(Object key, Object value);
// 
//     boolean put(K key, V value);
// 
//     void addEntryListener(ClusterListener<K, V> listener, boolean includeValue);
// 
//     Set<Map.Entry<K, V>> entrySet();
// 
//     Collection<V> get(K key);
// }
// 
// Path: westty-api/src/main/java/org/deephacks/westty/cluster/EntryEvent.java
// public interface EntryEvent<K, V> {
//     /**
//      * Returns the key of the entry event
//      *
//      * @return the key
//      */
//     public K getKey();
// 
//     /**
//      * Returns the old value of the entry event
//      *
//      * @return
//      */
//     public V getOldValue();
// 
//     /**
//      * Returns the value of the entry event
//      *
//      * @return
//      */
//     public V getValue();
// 
//     /**
//      * Returns the member fired this event.
//      *
//      * @return the member fired this event.
//      */
//     public Server getMember();
// 
//     /**
//      * Return the event type
//      *
//      * @return event type
//      */
//     public EntryEventType getEventType();
// 
//     /**
//      * Returns the name of the map for this event.
//      *
//      * @return name of the map.
//      */
//     public String getName();
// 
//     public static enum EntryEventType {
//         ADDED(1), REMOVED(2), UPDATED(3), EVICTED(4);
// 
//         private int type;
// 
//         private EntryEventType(final int type) {
//             this.type = type;
//         }
// 
//         public int getType() {
//             return type;
//         }
// 
//         public static EntryEventType getByType(final int eventType) {
//             for (EntryEventType entryEventType : values()) {
//                 if (entryEventType.type == eventType) {
//                     return entryEventType;
//                 }
//             }
//             return null;
//         }
//     }
// 
// }


// Path: westty-sockjs/src/main/java/org/deephacks/westty/internal/sockjs/WesttySubsMap.java
import org.deephacks.westty.cluster.ClusterListener;
import org.deephacks.westty.cluster.DistributedMultiMap;
import org.deephacks.westty.cluster.EntryEvent;
import org.vertx.java.core.AsyncResult;
import org.vertx.java.core.AsyncResultHandler;
import org.vertx.java.core.eventbus.impl.ServerIDs;
import org.vertx.java.core.eventbus.impl.SubsMap;
import org.vertx.java.core.eventbus.impl.hazelcast.HazelcastServerID;
import org.vertx.java.core.impl.BlockingAction;
import org.vertx.java.core.impl.VertxInternal;
import org.vertx.java.core.net.impl.ServerID;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

package org.deephacks.westty.internal.sockjs;



/**
 * Modified version of HazelcastSubsMap by <a href="http://tfox.org">Tim Fox</a>.
 *
 * Purpose is to decouple hazelcast implementation from Vertx.
 */
public class WesttySubsMap implements SubsMap, ClusterListener<String, HazelcastServerID> {
    private final VertxInternal vertx;
    private final DistributedMultiMap<String, HazelcastServerID> map;