"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const default_subscription_registry_1 = require("./default-subscription-registry");
const types_1 = require("@deepstream/types");
class DefaultSubscriptionRegistryFactory extends types_1.DeepstreamPlugin {
    constructor(pluginOptions, services, config) {
        super();
        this.pluginOptions = pluginOptions;
        this.services = services;
        this.config = config;
        this.description = 'Subscription Registry';
        this.subscriptionRegistries = new Map();
    }
    getSubscriptionRegistry(topic, clusterTopic) {
        let subscriptionRegistry = this.subscriptionRegistries.get(topic);
        if (!subscriptionRegistry) {
            subscriptionRegistry = new default_subscription_registry_1.DefaultSubscriptionRegistry(this.pluginOptions, this.services, this.config, topic, clusterTopic);
            this.subscriptionRegistries.set(topic, subscriptionRegistry);
        }
        return subscriptionRegistry;
    }
    getSubscriptionRegistries() {
        return this.subscriptionRegistries;
    }
}
exports.DefaultSubscriptionRegistryFactory = DefaultSubscriptionRegistryFactory;
//# sourceMappingURL=default-subscription-registry-factory.js.map