// Path: ddp-client/src/main/java/io/advantageous/ddp/DDPMessageEndpoint.java
// public interface DDPMessageEndpoint {
//     void disconnect() throws IOException;
// 
//     void connect(String address) throws IOException, InterruptedException;
// 
//     <T> void registerHandler(Class<T> messageType, DDPMessageHandler.Phase phase, DDPMessageHandler<T> handler);
// 
//     <T> void registerHandler(Class<T> messageType, DDPMessageHandler<T> handler);
// 
//     void await() throws InterruptedException;
// 
//     void send(Object message) throws IOException;
// 
// }


import io.advantageous.ddp.DDPMessageEndpoint;
import io.advantageous.ddp.subscription.message.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.HashMap;
import java.util.Map;
/*
 * Copyright (C) 2014. Geoffrey Chandler.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.advantageous.ddp.subscription;



/**
 * Simple subscription adapter to keep a map in sync with a meteor subscription.
 *
 * @author geoffc@gmail.com
 * @since 1/21/14 at 4:24 PM.
 */
public class MapSubscriptionAdapter extends BaseSubscriptionAdapter {

    private static final Logger LOGGER = LoggerFactory.getLogger(MapSubscriptionAdapter.class);

    private static final boolean DEBUG = LOGGER.isDebugEnabled();

    private static final boolean WARN = LOGGER.isWarnEnabled();

    private final Map<String, Map<String, Object>> dataMap;

    @Inject
// Path: ddp-client/src/main/java/io/advantageous/ddp/DDPMessageEndpoint.java
// public interface DDPMessageEndpoint {
//     void disconnect() throws IOException;
// 
//     void connect(String address) throws IOException, InterruptedException;
// 
//     <T> void registerHandler(Class<T> messageType, DDPMessageHandler.Phase phase, DDPMessageHandler<T> handler);
// 
//     <T> void registerHandler(Class<T> messageType, DDPMessageHandler<T> handler);
// 
//     void await() throws InterruptedException;
// 
//     void send(Object message) throws IOException;
// 
// }


// Path: ddp-client/src/main/java/io/advantageous/ddp/subscription/MapSubscriptionAdapter.java
import io.advantageous.ddp.DDPMessageEndpoint;
import io.advantageous.ddp.subscription.message.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.HashMap;
import java.util.Map;

/*
 * Copyright (C) 2014. Geoffrey Chandler.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.advantageous.ddp.subscription;



/**
 * Simple subscription adapter to keep a map in sync with a meteor subscription.
 *
 * @author geoffc@gmail.com
 * @since 1/21/14 at 4:24 PM.
 */
public class MapSubscriptionAdapter extends BaseSubscriptionAdapter {

    private static final Logger LOGGER = LoggerFactory.getLogger(MapSubscriptionAdapter.class);

    private static final boolean DEBUG = LOGGER.isDebugEnabled();

    private static final boolean WARN = LOGGER.isWarnEnabled();

    private final Map<String, Map<String, Object>> dataMap;

    @Inject
    public MapSubscriptionAdapter(final DDPMessageEndpoint endpoint,