ONOS-2488 Finished moving network config stuff out of the incubator area.

Change-Id: I62c511938fdf8f33def99ce43f0d4417b4ba1918
diff --git a/incubator/net/src/main/java/org/onosproject/incubator/net/config/impl/BasicNetworkConfigs.java b/incubator/net/src/main/java/org/onosproject/incubator/net/config/impl/BasicNetworkConfigs.java
deleted file mode 100644
index ce984f6..0000000
--- a/incubator/net/src/main/java/org/onosproject/incubator/net/config/impl/BasicNetworkConfigs.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * 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 org.onosproject.incubator.net.config.impl;
-
-import com.google.common.collect.ImmutableSet;
-
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.onosproject.core.CoreService;
-import org.onosproject.net.config.ConfigFactory;
-import org.onosproject.net.config.NetworkConfigRegistry;
-import org.onosproject.incubator.net.config.basics.BasicDeviceConfig;
-import org.onosproject.incubator.net.config.basics.BasicHostConfig;
-import org.onosproject.incubator.net.config.basics.BasicLinkConfig;
-import org.onosproject.incubator.net.config.basics.InterfaceConfig;
-import org.onosproject.incubator.net.config.basics.OpticalPortConfig;
-import org.onosproject.incubator.net.config.basics.SubjectFactories;
-import org.onosproject.incubator.net.domain.IntentDomainConfig;
-import org.onosproject.incubator.net.domain.IntentDomainId;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.HostId;
-import org.onosproject.net.LinkKey;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Set;
-
-import static org.onosproject.incubator.net.config.basics.SubjectFactories.*;
-
-/**
- * Component for registration of builtin basic network configurations.
- */
-@Component(immediate = true)
-public class BasicNetworkConfigs {
-
-    private final Logger log = LoggerFactory.getLogger(getClass());
-
-    private final Set<ConfigFactory> factories = ImmutableSet.of(
-            new ConfigFactory<DeviceId, BasicDeviceConfig>(DEVICE_SUBJECT_FACTORY,
-                                                           BasicDeviceConfig.class,
-                                                           "basic") {
-                @Override
-                public BasicDeviceConfig createConfig() {
-                    return new BasicDeviceConfig();
-                }
-            },
-            new ConfigFactory<ConnectPoint, InterfaceConfig>(CONNECT_POINT_SUBJECT_FACTORY,
-                                                             InterfaceConfig.class,
-                                                             "interfaces") {
-                @Override
-                public InterfaceConfig createConfig() {
-                    return new InterfaceConfig();
-                }
-            },
-            new ConfigFactory<HostId, BasicHostConfig>(HOST_SUBJECT_FACTORY,
-                                                       BasicHostConfig.class,
-                                                       "basic") {
-                @Override
-                public BasicHostConfig createConfig() {
-                    return new BasicHostConfig();
-                }
-            },
-            new ConfigFactory<LinkKey, BasicLinkConfig>(LINK_SUBJECT_FACTORY,
-                                                        BasicLinkConfig.class,
-                                                        "basic") {
-                @Override
-                public BasicLinkConfig createConfig() {
-                    return new BasicLinkConfig();
-                }
-            },
-            new ConfigFactory<IntentDomainId, IntentDomainConfig>(INTENT_DOMAIN_SUBJECT_FACTORY,
-                                                                  IntentDomainConfig.class,
-                                                                  "basic") {
-                @Override
-                public IntentDomainConfig createConfig() {
-                    return new IntentDomainConfig();
-                }
-            },
-            new ConfigFactory<ConnectPoint, OpticalPortConfig>(CONNECT_POINT_SUBJECT_FACTORY,
-                                                        OpticalPortConfig.class,
-                                                        "basic") {
-                @Override
-                public OpticalPortConfig createConfig() {
-                    return new OpticalPortConfig();
-                }
-            }
-    );
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected CoreService coreService;
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected NetworkConfigRegistry registry;
-
-    @Activate
-    public void activate() {
-        SubjectFactories.setCoreService(coreService);
-        factories.forEach(registry::registerConfigFactory);
-        log.info("Started");
-    }
-
-    @Deactivate
-    public void deactivate() {
-        factories.forEach(registry::unregisterConfigFactory);
-        log.info("Stopped");
-    }
-
-}
diff --git a/incubator/net/src/main/java/org/onosproject/incubator/net/config/impl/ExtraNetworkConfigs.java b/incubator/net/src/main/java/org/onosproject/incubator/net/config/impl/ExtraNetworkConfigs.java
new file mode 100644
index 0000000..e77e1da
--- /dev/null
+++ b/incubator/net/src/main/java/org/onosproject/incubator/net/config/impl/ExtraNetworkConfigs.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * 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 org.onosproject.incubator.net.config.impl;
+
+import com.google.common.collect.ImmutableSet;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.onosproject.incubator.net.domain.IntentDomainConfig;
+import org.onosproject.incubator.net.domain.IntentDomainId;
+import org.onosproject.net.config.ConfigFactory;
+import org.onosproject.net.config.NetworkConfigRegistry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Set;
+
+import static org.onosproject.incubator.net.config.basics.ExtraSubjectFactories.INTENT_DOMAIN_SUBJECT_FACTORY;
+
+/**
+ * Component for registration of builtin basic network configurations.
+ */
+@Component(immediate = true)
+public class ExtraNetworkConfigs {
+
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    private final Set<ConfigFactory> factories = ImmutableSet.of(
+            new ConfigFactory<IntentDomainId, IntentDomainConfig>(INTENT_DOMAIN_SUBJECT_FACTORY,
+                                                                  IntentDomainConfig.class,
+                                                                  "basic") {
+                @Override
+                public IntentDomainConfig createConfig() {
+                    return new IntentDomainConfig();
+                }
+            }
+    );
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected NetworkConfigRegistry registry;
+
+    @Activate
+    public void activate() {
+        factories.forEach(registry::registerConfigFactory);
+        log.info("Started");
+    }
+
+    @Deactivate
+    public void deactivate() {
+        factories.forEach(registry::unregisterConfigFactory);
+        log.info("Stopped");
+    }
+
+}
diff --git a/incubator/net/src/main/java/org/onosproject/incubator/net/config/impl/NetworkConfigLoader.java b/incubator/net/src/main/java/org/onosproject/incubator/net/config/impl/NetworkConfigLoader.java
deleted file mode 100644
index 974c706..0000000
--- a/incubator/net/src/main/java/org/onosproject/incubator/net/config/impl/NetworkConfigLoader.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * 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 org.onosproject.incubator.net.config.impl;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.google.common.collect.Maps;
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.onosproject.net.config.NetworkConfigEvent;
-import org.onosproject.net.config.NetworkConfigListener;
-import org.onosproject.net.config.NetworkConfigService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Component for loading the initial network configuration.
- */
-@Component(immediate = true)
-public class NetworkConfigLoader {
-
-    private static final File CFG_FILE = new File("../config/network-cfg.json");
-
-    private final Logger log = LoggerFactory.getLogger(getClass());
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected NetworkConfigService networkConfigService;
-
-    // FIXME: Add mutual exclusion to make sure this happens only once per startup.
-
-    private Map<InnerConfigPosition, ObjectNode> jsons = Maps.newHashMap();
-
-    private final NetworkConfigListener configListener = new InnerConfigListener();
-
-    ObjectNode root;
-
-    @Activate
-    public void activate() {
-        //TODO Maybe this should be at the bottom to avoid a potential race
-        networkConfigService.addListener(configListener);
-        try {
-            if (CFG_FILE.exists()) {
-                root = (ObjectNode) new ObjectMapper().readTree(CFG_FILE);
-
-                populateConfigurations();
-
-                applyConfigurations();
-
-                log.info("Loaded initial network configuration from {}", CFG_FILE);
-            }
-        } catch (Exception e) {
-            log.warn("Unable to load initial network configuration from {}",
-                    CFG_FILE, e);
-        }
-    }
-
-    @Deactivate
-    public void deactivate() {
-        networkConfigService.removeListener(configListener);
-    }
-    // sweep through pending config jsons and try to add them
-
-    /**
-     * Inner class that allows for handling of newly added NetConfig types.
-     */
-    private final class InnerConfigListener implements NetworkConfigListener {
-
-        @Override
-        public void event(NetworkConfigEvent event) {
-            //TODO should this be done for other types of NetworkConfigEvents?
-            if (event.type() == NetworkConfigEvent.Type.CONFIG_REGISTERED ||
-                    event.type() == NetworkConfigEvent.Type.CONFIG_ADDED) {
-                applyConfigurations();
-            }
-
-        }
-    }
-
-    /**
-     * Inner class that allows for tracking of JSON class configurations.
-     */
-    private final class InnerConfigPosition {
-        private String subjectKey, subject, classKey;
-
-        private String getSubjectKey() {
-            return subjectKey;
-        }
-
-        private String getSubject() {
-            return subject;
-        }
-
-        private String getClassKey() {
-            return classKey;
-        }
-
-        private InnerConfigPosition(String subjectKey, String subject, String classKey) {
-            this.subjectKey = subjectKey;
-            this.subject = subject;
-            this.classKey = classKey;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (obj instanceof InnerConfigPosition) {
-                final InnerConfigPosition that = (InnerConfigPosition) obj;
-                return Objects.equals(this.subjectKey, that.subjectKey) && Objects.equals(this.subject, that.subject)
-                        && Objects.equals(this.classKey, that.classKey);
-            }
-            return false;
-        }
-
-        @Override
-        public int hashCode() {
-            return Objects.hash(subjectKey, subject, classKey);
-        }
-    }
-
-    /**
-     * Save the JSON leaves associated with a specific subject key.
-     *
-     * @param sk   the subject key string.
-     * @param node the node associated with the subject key.
-     */
-    private void saveJson(String sk, ObjectNode node) {
-        node.fieldNames().forEachRemaining(s ->
-                saveSubjectJson(sk, s, (ObjectNode) node.path(s)));
-    }
-
-    /**
-     * Save the JSON leaves of the tree rooted as the node 'node' with subject key 'sk'.
-     *
-     * @param sk   the string of the subject key.
-     * @param s    the subject name.
-     * @param node the node rooting this subtree.
-     */
-    private void saveSubjectJson(String sk,
-                                 String s, ObjectNode node) {
-        node.fieldNames().forEachRemaining(c ->
-                this.jsons.put(new InnerConfigPosition(sk, s, c), (ObjectNode) node.path(c)));
-    }
-
-    /**
-     * Iterate through the JSON and populate a list of the leaf nodes of the structure.
-     */
-    private void populateConfigurations() {
-        root.fieldNames().forEachRemaining(sk ->
-                saveJson(sk, (ObjectNode) root.path(sk)));
-
-    }
-
-    /**
-     * Apply the configurations associated with all of the config classes that are imported and have not yet been
-     * applied.
-     */
-    protected void applyConfigurations() {
-        Iterator<Map.Entry<InnerConfigPosition, ObjectNode>> iter = jsons.entrySet().iterator();
-
-        Map.Entry<InnerConfigPosition, ObjectNode> entry;
-        InnerConfigPosition key;
-        ObjectNode node;
-        String subjectKey;
-        String subject;
-        String classKey;
-
-        while (iter.hasNext()) {
-            entry = iter.next();
-            node = entry.getValue();
-            key = entry.getKey();
-            subjectKey = key.getSubjectKey();
-            subject = key.getSubject();
-            classKey = key.getClassKey();
-            //Check that the config class has been imported
-            if (networkConfigService.getConfigClass(subjectKey, subject) != null) {
-
-                //Apply the configuration
-                networkConfigService.applyConfig(networkConfigService.getSubjectFactory(subjectKey).
-                                createSubject(subject),
-                        networkConfigService.getConfigClass(subjectKey, classKey), node);
-
-                //Now that it has been applied the corresponding JSON entry is no longer needed
-                jsons.remove(key);
-            }
-
-        }
-    }
-
-}
diff --git a/incubator/net/src/main/java/org/onosproject/incubator/net/config/impl/NetworkConfigManager.java b/incubator/net/src/main/java/org/onosproject/incubator/net/config/impl/NetworkConfigManager.java
deleted file mode 100644
index 50cf578..0000000
--- a/incubator/net/src/main/java/org/onosproject/incubator/net/config/impl/NetworkConfigManager.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * 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 org.onosproject.incubator.net.config.impl;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Maps;
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.apache.felix.scr.annotations.Service;
-import org.onosproject.event.AbstractListenerManager;
-import org.onosproject.net.config.Config;
-import org.onosproject.net.config.ConfigFactory;
-import org.onosproject.net.config.NetworkConfigEvent;
-import org.onosproject.net.config.NetworkConfigListener;
-import org.onosproject.net.config.NetworkConfigRegistry;
-import org.onosproject.net.config.NetworkConfigService;
-import org.onosproject.net.config.NetworkConfigStore;
-import org.onosproject.net.config.NetworkConfigStoreDelegate;
-import org.onosproject.net.config.SubjectFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * Implementation of the network configuration subsystem.
- */
-@Component(immediate = true)
-@Service
-public class NetworkConfigManager
-        extends AbstractListenerManager<NetworkConfigEvent, NetworkConfigListener>
-        implements NetworkConfigRegistry, NetworkConfigService {
-
-    private final Logger log = LoggerFactory.getLogger(getClass());
-
-    private static final String NULL_FACTORY_MSG = "Factory cannot be null";
-    private static final String NULL_SCLASS_MSG = "Subject class cannot be null";
-    private static final String NULL_CCLASS_MSG = "Config class cannot be null";
-    private static final String NULL_SUBJECT_MSG = "Subject cannot be null";
-
-    // Inventory of configuration factories
-    private final Map<ConfigKey, ConfigFactory> factories = Maps.newConcurrentMap();
-
-    // Secondary indices to retrieve subject and config classes by keys
-    private final Map<String, SubjectFactory> subjectClasses = Maps.newConcurrentMap();
-    private final Map<Class, SubjectFactory> subjectClassKeys = Maps.newConcurrentMap();
-    private final Map<ConfigIdentifier, Class<? extends Config>> configClasses = Maps.newConcurrentMap();
-
-    private final NetworkConfigStoreDelegate storeDelegate = new InternalStoreDelegate();
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected NetworkConfigStore store;
-
-
-    @Activate
-    public void activate() {
-        eventDispatcher.addSink(NetworkConfigEvent.class, listenerRegistry);
-        store.setDelegate(storeDelegate);
-        log.info("Started");
-    }
-
-    @Deactivate
-    public void deactivate() {
-        eventDispatcher.removeSink(NetworkConfigEvent.class);
-        store.unsetDelegate(storeDelegate);
-        log.info("Stopped");
-    }
-
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public void registerConfigFactory(ConfigFactory configFactory) {
-        checkNotNull(configFactory, NULL_FACTORY_MSG);
-        factories.put(key(configFactory), configFactory);
-        configClasses.put(identifier(configFactory), configFactory.configClass());
-
-        SubjectFactory subjectFactory = configFactory.subjectFactory();
-        subjectClasses.putIfAbsent(subjectFactory.subjectKey(), subjectFactory);
-        subjectClassKeys.putIfAbsent(subjectFactory.subjectClass(), subjectFactory);
-
-        store.addConfigFactory(configFactory);
-    }
-
-    @Override
-    public void unregisterConfigFactory(ConfigFactory configFactory) {
-        checkNotNull(configFactory, NULL_FACTORY_MSG);
-        factories.remove(key(configFactory));
-        configClasses.remove(identifier(configFactory));
-
-        // Note that we are deliberately not removing subject factory key bindings.
-        store.removeConfigFactory(configFactory);
-    }
-
-    @Override
-    public Set<ConfigFactory> getConfigFactories() {
-        return ImmutableSet.copyOf(factories.values());
-    }
-
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public <S, C extends Config<S>> Set<ConfigFactory<S, C>> getConfigFactories(Class<S> subjectClass) {
-        ImmutableSet.Builder<ConfigFactory<S, C>> builder = ImmutableSet.builder();
-        factories.forEach((key, factory) -> {
-            if (factory.subjectFactory().subjectClass().equals(subjectClass)) {
-                builder.add(factory);
-            }
-        });
-        return builder.build();
-    }
-
-    @Override
-    public <S, C extends Config<S>> ConfigFactory<S, C> getConfigFactory(Class<C> configClass) {
-        checkNotNull(configClass, NULL_CCLASS_MSG);
-        return store.getConfigFactory(configClass);
-    }
-
-
-    @Override
-    public Set<Class> getSubjectClasses() {
-        ImmutableSet.Builder<Class> builder = ImmutableSet.builder();
-        factories.forEach((k, v) -> builder.add(k.subjectClass));
-        return builder.build();
-    }
-
-    @Override
-    public SubjectFactory getSubjectFactory(String subjectKey) {
-        return subjectClasses.get(subjectKey);
-    }
-
-    @Override
-    public SubjectFactory getSubjectFactory(Class subjectClass) {
-        return subjectClassKeys.get(subjectClass);
-    }
-
-    @Override
-    public Class<? extends Config> getConfigClass(String subjectKey, String configKey) {
-        return configClasses.get(new ConfigIdentifier(subjectKey, configKey));
-    }
-
-    @Override
-    public <S> Set<S> getSubjects(Class<S> subjectClass) {
-        checkNotNull(subjectClass, NULL_SCLASS_MSG);
-        return store.getSubjects(subjectClass);
-    }
-
-    @Override
-    public <S, C extends Config<S>> Set<S> getSubjects(Class<S> subjectClass, Class<C> configClass) {
-        checkNotNull(subjectClass, NULL_SCLASS_MSG);
-        checkNotNull(configClass, NULL_CCLASS_MSG);
-        return store.getSubjects(subjectClass, configClass);
-    }
-
-    @Override
-    public <S> Set<Config<S>> getConfigs(S subject) {
-        checkNotNull(subject, NULL_SUBJECT_MSG);
-        Set<Class<? extends Config<S>>> configClasses = store.getConfigClasses(subject);
-        ImmutableSet.Builder<Config<S>> cfg = ImmutableSet.builder();
-        configClasses.forEach(cc -> cfg.add(store.getConfig(subject, cc)));
-        return cfg.build();
-    }
-
-    @Override
-    public <S, T extends Config<S>> T getConfig(S subject, Class<T> configClass) {
-        checkNotNull(subject, NULL_SUBJECT_MSG);
-        checkNotNull(configClass, NULL_CCLASS_MSG);
-        return store.getConfig(subject, configClass);
-    }
-
-
-    @Override
-    public <S, C extends Config<S>> C addConfig(S subject, Class<C> configClass) {
-        checkNotNull(subject, NULL_SUBJECT_MSG);
-        checkNotNull(configClass, NULL_CCLASS_MSG);
-        return store.createConfig(subject, configClass);
-    }
-
-    @Override
-    public <S, C extends Config<S>> C applyConfig(S subject, Class<C> configClass, ObjectNode json) {
-        checkNotNull(subject, NULL_SUBJECT_MSG);
-        checkNotNull(configClass, NULL_CCLASS_MSG);
-        return store.applyConfig(subject, configClass, json);
-    }
-
-    @Override
-    public <S, C extends Config<S>> void removeConfig(S subject, Class<C> configClass) {
-        checkNotNull(subject, NULL_SUBJECT_MSG);
-        checkNotNull(configClass, NULL_CCLASS_MSG);
-        store.clearConfig(subject, configClass);
-    }
-
-    // Auxiliary store delegate to receive notification about changes in
-    // the network configuration store state - by the store itself.
-    private class InternalStoreDelegate implements NetworkConfigStoreDelegate {
-        @Override
-        public void notify(NetworkConfigEvent event) {
-            post(event);
-        }
-    }
-
-
-    // Produces a key for uniquely tracking a config factory.
-    private static ConfigKey key(ConfigFactory factory) {
-        return new ConfigKey(factory.subjectFactory().subjectClass(), factory.configClass());
-    }
-
-    // Auxiliary key to track config factories.
-    protected static final class ConfigKey {
-        final Class subjectClass;
-        final Class configClass;
-
-        protected ConfigKey(Class subjectClass, Class configClass) {
-            this.subjectClass = subjectClass;
-            this.configClass = configClass;
-        }
-
-        @Override
-        public int hashCode() {
-            return Objects.hash(subjectClass, configClass);
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (obj instanceof ConfigKey) {
-                final ConfigKey other = (ConfigKey) obj;
-                return Objects.equals(this.subjectClass, other.subjectClass)
-                        && Objects.equals(this.configClass, other.configClass);
-            }
-            return false;
-        }
-    }
-
-    private static ConfigIdentifier identifier(ConfigFactory factory) {
-        return new ConfigIdentifier(factory.subjectFactory().subjectKey(), factory.configKey());
-    }
-
-    protected static final class ConfigIdentifier {
-        final String subjectKey;
-        final String configKey;
-
-        protected ConfigIdentifier(String subjectKey, String configKey) {
-            this.subjectKey = subjectKey;
-            this.configKey = configKey;
-        }
-
-        @Override
-        public int hashCode() {
-            return Objects.hash(subjectKey, configKey);
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (obj instanceof ConfigIdentifier) {
-                final ConfigIdentifier other = (ConfigIdentifier) obj;
-                return Objects.equals(this.subjectKey, other.subjectKey)
-                        && Objects.equals(this.configKey, other.configKey);
-            }
-            return false;
-        }
-    }
-}