// Path: core/src/main/java/org/aimlang/core/channels/ChannelType.java
// public enum  ChannelType {
//     CONSOLE, VK, FACEBOOK, REST, WEBSOCKET
// }


import org.aimlang.core.channels.ChannelType;
import java.util.HashMap;
import java.util.Map;
package org.aimlang.core.chat;



/**
 * InMemoryChatContextStorage
 *
 * @author batiaev
 * @since 24/05/17
 */
public class InMemoryChatContextStorage implements ChatContextStorage {
    private Map<String, Map<ChannelType, ChatContext>> contexts;

    public InMemoryChatContextStorage() {
        contexts = new HashMap<>();
    }

    @Override
    public ChatContext getContext(String userId, ChannelType channelType) {
        var userContexts = contexts.get(userId);
        if (userContexts == null || userContexts.isEmpty()) {
// Path: core/src/main/java/org/aimlang/core/channels/ChannelType.java
// public enum  ChannelType {
//     CONSOLE, VK, FACEBOOK, REST, WEBSOCKET
// }


// Path: core/src/main/java/org/aimlang/core/chat/InMemoryChatContextStorage.java
import org.aimlang.core.channels.ChannelType;
import java.util.HashMap;
import java.util.Map;

package org.aimlang.core.chat;



/**
 * InMemoryChatContextStorage
 *
 * @author batiaev
 * @since 24/05/17
 */
public class InMemoryChatContextStorage implements ChatContextStorage {
    private Map<String, Map<ChannelType, ChatContext>> contexts;

    public InMemoryChatContextStorage() {
        contexts = new HashMap<>();
    }

    @Override
    public ChatContext getContext(String userId, ChannelType channelType) {
        var userContexts = contexts.get(userId);
        if (userContexts == null || userContexts.isEmpty()) {
            var context = new ChatContext(userId);