RuntimeGeneratedMappingServiceImpl is now started by the config-manager.
ModuleInfoBackedContext is filled by BundleTracker in config-manager.
This fix allows use of yang identities in netconf and restconf.
Change-Id: Id59d9d2ce08bfc9216d90cb5673e2d02aafd9151
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>mockito-configuration</artifactId>
</dependency>
+
+ <!--Dependencies regardign RuntimeGeneratedMappingService-->
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>binding-generator-impl</artifactId>
+ </dependency>
+ <!--End-->
+
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>config-util</artifactId>
this.service = service;
CodecRegistry codecRegistry = service.getCodecRegistry();
logger.debug("Codec registry acquired {}", codecRegistry);
- activator.initConfigManager(ctx, codecRegistry);
+// activator.initConfigManager(ctx, codecRegistry);
return service;
}
package org.opendaylight.controller.config.manager.impl.osgi;
import java.lang.management.ManagementFactory;
+import java.util.Collection;
import javax.management.InstanceAlreadyExistsException;
import javax.management.MBeanServer;
import org.opendaylight.controller.config.manager.impl.ConfigRegistryImpl;
import org.opendaylight.controller.config.manager.impl.jmx.ConfigRegistryJMXRegistrator;
+import org.opendaylight.controller.config.manager.impl.osgi.mapping.ModuleInfoBundleTracker;
+import org.opendaylight.controller.config.manager.impl.osgi.mapping.RuntimeGeneratedMappingServiceActivator;
import org.opendaylight.controller.config.spi.ModuleFactory;
-import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService;
+import org.opendaylight.yangtools.concepts.Registration;
+import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
import org.opendaylight.yangtools.yang.data.impl.codec.CodecRegistry;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.slf4j.LoggerFactory;
public class ConfigManagerActivator implements BundleActivator {
- private static final Logger logger = LoggerFactory
- .getLogger(ConfigManagerActivator.class);
+ private static final Logger logger = LoggerFactory.getLogger(ConfigManagerActivator.class);
- private ExtenderBundleTracker extenderBundleTracker;
+ private ExtensibleBundleTracker<Collection<Registration<YangModuleInfo>>> bundleTracker;
private ConfigRegistryImpl configRegistry;
private ConfigRegistryJMXRegistrator configRegistryJMXRegistrator;
private ServiceRegistration configRegistryServiceRegistration;
- private ServiceTracker<BindingIndependentMappingService, BindingIndependentMappingService> tracker;
+ private final MBeanServer configMBeanServer = ManagementFactory.getPlatformMBeanServer();
+
+ private RuntimeGeneratedMappingServiceActivator mappingServiceActivator;
@Override
public void start(BundleContext context) throws Exception {
- BindingIndependentMappingServiceTracker mappingServiceTracker = new BindingIndependentMappingServiceTracker(
- context, this);
- tracker = new ServiceTracker<BindingIndependentMappingService, BindingIndependentMappingService>(
- context, BindingIndependentMappingService.class, mappingServiceTracker);
-
- logger.debug("Waiting for codec registry");
-
- tracker.open();
- }
- void initConfigManager(BundleContext context, CodecRegistry codecRegistry) {
- BundleContextBackedModuleFactoriesResolver bundleContextBackedModuleFactoriesResolver =
- new BundleContextBackedModuleFactoriesResolver(context);
- MBeanServer configMBeanServer = ManagementFactory.getPlatformMBeanServer();
+ // track bundles containing YangModuleInfo
+ ModuleInfoBundleTracker moduleInfoBundleTracker = new ModuleInfoBundleTracker();
+ mappingServiceActivator = new RuntimeGeneratedMappingServiceActivator(moduleInfoBundleTracker);
+ CodecRegistry codecRegistry = mappingServiceActivator.startRuntimeMappingService(context).getCodecRegistry();
+ // start config registry
+ BundleContextBackedModuleFactoriesResolver bundleContextBackedModuleFactoriesResolver = new BundleContextBackedModuleFactoriesResolver(
+ context);
+ configRegistry = new ConfigRegistryImpl(bundleContextBackedModuleFactoriesResolver, configMBeanServer,
+ codecRegistry);
- // TODO push codecRegistry/IdentityCodec to dependencyResolver
+ // track bundles containing factories
+ BlankTransactionServiceTracker blankTransactionServiceTracker = new BlankTransactionServiceTracker(
+ configRegistry);
+ ModuleFactoryBundleTracker moduleFactoryBundleTracker = new ModuleFactoryBundleTracker(
+ blankTransactionServiceTracker);
- configRegistry = new ConfigRegistryImpl(
- bundleContextBackedModuleFactoriesResolver, configMBeanServer, codecRegistry);
+ // start extensible tracker
+ bundleTracker = new ExtensibleBundleTracker<>(context, moduleInfoBundleTracker, moduleFactoryBundleTracker);
+ bundleTracker.open();
// register config registry to OSGi
configRegistryServiceRegistration = context.registerService(ConfigRegistryImpl.class, configRegistry, null);
throw new RuntimeException("Config Registry was already registered to JMX", e);
}
- // track bundles containing factories
- BlankTransactionServiceTracker blankTransactionServiceTracker = new BlankTransactionServiceTracker(configRegistry);
- extenderBundleTracker = new ExtenderBundleTracker(context, blankTransactionServiceTracker);
- extenderBundleTracker.open();
-
- ServiceTracker<?, ?> serviceTracker = new ServiceTracker(context, ModuleFactory.class, blankTransactionServiceTracker);
+ ServiceTracker<ModuleFactory, Object> serviceTracker = new ServiceTracker<>(context, ModuleFactory.class,
+ blankTransactionServiceTracker);
serviceTracker.open();
}
@Override
public void stop(BundleContext context) throws Exception {
- try {
- tracker.close();
- } catch (Exception e) {
- logger.warn("Exception while closing tracker", e);
- }
try {
configRegistry.close();
} catch (Exception e) {
logger.warn("Exception while closing config registry", e);
}
try {
- extenderBundleTracker.close();
+ bundleTracker.close();
} catch (Exception e) {
logger.warn("Exception while closing extender", e);
}
} catch (Exception e) {
logger.warn("Exception while unregistering config registry", e);
}
+ try {
+ mappingServiceActivator.close();
+ } catch (Exception e) {
+ logger.warn("Exception while closing mapping service", e);
+ }
}
}
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.manager.impl.osgi;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleEvent;
+import org.osgi.util.tracker.BundleTracker;
+import org.osgi.util.tracker.BundleTrackerCustomizer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * Extensible bundle tracker. Takes several BundleTrackerCustomizers and propagates bundle events to all of them.
+ * Primary customizer
+ *
+ * @param <T>
+ */
+public final class ExtensibleBundleTracker<T> extends BundleTracker<T> {
+
+ private final BundleTrackerCustomizer<T> primaryTracker;
+ private final BundleTrackerCustomizer<?>[] additionalTrackers;
+
+ private static final Logger logger = LoggerFactory.getLogger(ExtensibleBundleTracker.class);
+
+ public ExtensibleBundleTracker(BundleContext context, BundleTrackerCustomizer<T> primaryBundleTrackerCustomizer,
+ BundleTrackerCustomizer<?>... additionalBundleTrackerCustomizers) {
+ this(context, Bundle.ACTIVE, primaryBundleTrackerCustomizer, additionalBundleTrackerCustomizers);
+ }
+
+ public ExtensibleBundleTracker(BundleContext context, int bundleState,
+ BundleTrackerCustomizer<T> primaryBundleTrackerCustomizer,
+ BundleTrackerCustomizer<?>... additionalBundleTrackerCustomizers) {
+ super(context, bundleState, null);
+ this.primaryTracker = primaryBundleTrackerCustomizer;
+ this.additionalTrackers = additionalBundleTrackerCustomizers;
+ logger.trace("Registered as extender with context {} and bundle state {}", context, bundleState);
+ }
+
+ @Override
+ public T addingBundle(final Bundle bundle, final BundleEvent event) {
+ T primaryTrackerRetVal = primaryTracker.addingBundle(bundle, event);
+
+ forEachAdditionalBundle(new BundleStrategy() {
+ @Override
+ public void execute(BundleTrackerCustomizer<?> tracker) {
+ tracker.addingBundle(bundle, event);
+ }
+ });
+
+ return primaryTrackerRetVal;
+ }
+
+ @Override
+ public void modifiedBundle(final Bundle bundle, final BundleEvent event, final T object) {
+ primaryTracker.modifiedBundle(bundle, event, object);
+
+ forEachAdditionalBundle(new BundleStrategy() {
+ @Override
+ public void execute(BundleTrackerCustomizer<?> tracker) {
+ tracker.modifiedBundle(bundle, event, null);
+ }
+ });
+
+ }
+
+ @Override
+ public void removedBundle(final Bundle bundle, final BundleEvent event, final T object) {
+ primaryTracker.removedBundle(bundle, event, object);
+
+ forEachAdditionalBundle(new BundleStrategy() {
+ @Override
+ public void execute(BundleTrackerCustomizer<?> tracker) {
+ tracker.removedBundle(bundle, event, null);
+ }
+ });
+ }
+
+ private void forEachAdditionalBundle(BundleStrategy lambda) {
+ for (BundleTrackerCustomizer<?> trac : additionalTrackers) {
+ lambda.execute(trac);
+ }
+ }
+
+ private static interface BundleStrategy {
+ void execute(BundleTrackerCustomizer<?> tracker);
+ }
+
+}
import org.apache.commons.io.IOUtils;
import org.opendaylight.controller.config.spi.ModuleFactory;
import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
import org.osgi.framework.ServiceRegistration;
-import org.osgi.util.tracker.BundleTracker;
+import org.osgi.util.tracker.BundleTrackerCustomizer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* the services are unregistered automatically.
* Code based on http://www.toedter.com/blog/?p=236
*/
-public class ExtenderBundleTracker extends BundleTracker<Object> {
+public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer<Object> {
private final BlankTransactionServiceTracker blankTransactionServiceTracker;
- private static final Logger logger = LoggerFactory.getLogger(ExtenderBundleTracker.class);
+ private static final Logger logger = LoggerFactory.getLogger(ModuleFactoryBundleTracker.class);
- public ExtenderBundleTracker(BundleContext context, BlankTransactionServiceTracker blankTransactionServiceTracker) {
- super(context, Bundle.ACTIVE, null);
+ public ModuleFactoryBundleTracker(BlankTransactionServiceTracker blankTransactionServiceTracker) {
this.blankTransactionServiceTracker = blankTransactionServiceTracker;
- logger.trace("Registered as extender with context {}", context);
}
@Override
return bundle;
}
+ @Override
+ public void modifiedBundle(Bundle bundle, BundleEvent event, Object object) {
+ // NOOP
+ }
+
@Override
public void removedBundle(Bundle bundle, BundleEvent event, Object object) {
- super.removedBundle(bundle,event,object);
// workaround for service tracker not getting removed service event
blankTransactionServiceTracker.blankTransaction();
}
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.manager.impl.osgi.mapping;
+
+import org.apache.commons.io.IOUtils;
+import org.opendaylight.yangtools.concepts.Registration;
+import org.opendaylight.yangtools.sal.binding.generator.impl.GeneratedClassLoadingStrategy;
+import org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext;
+import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider;
+import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleEvent;
+import org.osgi.util.tracker.BundleTrackerCustomizer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import static java.lang.String.format;
+
+/**
+ * Tracks bundles and attempts to retrieve YangModuleInfo.
+ */
+public final class ModuleInfoBundleTracker implements BundleTrackerCustomizer<Collection<Registration<YangModuleInfo>>> {
+
+ private static final Logger logger = LoggerFactory.getLogger(ModuleInfoBundleTracker.class);
+ public static final String GET_MODULE_INFO_METHOD = "getModuleInfo";
+
+ public static final String MODULE_INFO_PROVIDER_PATH_PREFIX = "META-INF/services/";
+
+ private ModuleInfoBackedContext moduleInfoLoadingStrategy = ModuleInfoBackedContext.create();
+
+ public GeneratedClassLoadingStrategy getModuleInfoLoadingStrategy() {
+ return moduleInfoLoadingStrategy;
+ }
+
+ @Override
+ public Collection<Registration<YangModuleInfo>> addingBundle(Bundle bundle, BundleEvent event) {
+ URL resource = bundle.getEntry(MODULE_INFO_PROVIDER_PATH_PREFIX + YangModelBindingProvider.class.getName());
+
+ if(resource==null) {
+ return null;
+ }
+
+ List<Registration<YangModuleInfo>> registrations = new LinkedList<>();
+
+ try (InputStream inputStream = resource.openStream()) {
+ List<String> lines = IOUtils.readLines(inputStream);
+ for (String moduleInfoName : lines) {
+ YangModuleInfo moduleInfo = retrieveModuleInfo(moduleInfoName, bundle);
+ registrations.add(moduleInfoLoadingStrategy.registerModuleInfo(moduleInfo));
+ }
+
+
+ } catch (Exception e) {
+ logger.error("Error while reading {}", resource, e);
+ throw new RuntimeException(e);
+ }
+
+ return registrations;
+ }
+
+ @Override
+ public void modifiedBundle(Bundle bundle, BundleEvent event, Collection<Registration<YangModuleInfo>> object) {
+ // NOOP
+ }
+
+ @Override
+ public void removedBundle(Bundle bundle, BundleEvent event, Collection<Registration<YangModuleInfo>> regs) {
+ if(regs == null) {
+ return;
+ }
+
+ for (Registration<YangModuleInfo> reg : regs) {
+ try {
+ reg.close();
+ } catch (Exception e) {
+ throw new RuntimeException("Unable to unregister YangModuleInfo " + reg.getInstance(), e);
+ }
+ }
+ }
+
+ private static YangModuleInfo retrieveModuleInfo(String moduleInfoClass, Bundle bundle) {
+ String errorMessage;
+ Class<?> clazz = loadClass(moduleInfoClass, bundle);
+
+ if (YangModelBindingProvider.class.isAssignableFrom(clazz) == false) {
+ errorMessage = logMessage("Class {} does not implement {} in bundle {}", clazz, YangModelBindingProvider.class, bundle);
+ throw new IllegalStateException(errorMessage);
+ }
+
+ try {
+ Object instance = clazz.newInstance();
+ Object result = clazz.getMethod(GET_MODULE_INFO_METHOD).invoke(instance);
+
+ if (YangModuleInfo.class.isAssignableFrom(result.getClass()) == false) {
+ errorMessage = logMessage("Error invoking method not found {} in bundle {}, reason {}",
+ GET_MODULE_INFO_METHOD, bundle, "Not assignable from " + YangModuleInfo.class);
+ } else {
+ return (YangModuleInfo) result;
+ }
+
+ } catch (InstantiationException e) {
+ errorMessage = logMessage("Could not instantiate {} in bundle {}, reason {}", moduleInfoClass, bundle, e);
+ } catch (IllegalAccessException e) {
+ errorMessage = logMessage("Illegal access during instatiation of class {} in bundle {}, reason {}",
+ moduleInfoClass, bundle, e);
+ } catch (NoSuchMethodException e) {
+ errorMessage = logMessage("Method not found {} in bundle {}, reason {}", GET_MODULE_INFO_METHOD, bundle, e);
+ } catch (InvocationTargetException e) {
+ errorMessage = logMessage("Error invoking method {} in bundle {}, reason {}", GET_MODULE_INFO_METHOD,
+ bundle, e);
+ }
+
+ throw new IllegalStateException(errorMessage);
+ }
+
+ private static Class<?> loadClass(String moduleInfoClass, Bundle bundle) {
+ try {
+ return bundle.loadClass(moduleInfoClass);
+ } catch (ClassNotFoundException e) {
+ String errorMessage = logMessage("Could not find class {} in bunde {}, reason {}", moduleInfoClass, bundle, e);
+ throw new IllegalStateException(errorMessage);
+ }
+ }
+
+ public static String logMessage(String slfMessage, Object... params) {
+ logger.info(slfMessage, params);
+ String formatMessage = slfMessage.replaceAll("\\{\\}", "%s");
+ return format(formatMessage, params);
+ }
+}
/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.sal.binding.osgi;
+package org.opendaylight.controller.config.manager.impl.osgi.mapping;
-import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
+import javassist.ClassPool;
import org.opendaylight.yangtools.sal.binding.generator.impl.RuntimeGeneratedMappingServiceImpl;
import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService;
import org.opendaylight.yangtools.yang.model.api.SchemaServiceListener;
-import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import java.util.Hashtable;
-public class Activator implements BundleActivator {
+public class RuntimeGeneratedMappingServiceActivator implements AutoCloseable {
+
+ private static final ClassPool CLASS_POOL = ClassPool.getDefault();
- private ServiceRegistration<?> reg;
private ServiceRegistration<SchemaServiceListener> listenerReg;
private ServiceRegistration<BindingIndependentMappingService> mappingReg;
+ private ModuleInfoBundleTracker moduleInfoBundleTracker;
- @Override
- public void start(BundleContext context) throws Exception {
- RuntimeGeneratedMappingServiceImpl service = new RuntimeGeneratedMappingServiceImpl();
- service.setPool(SingletonHolder.CLASS_POOL);
+ public RuntimeGeneratedMappingServiceActivator(ModuleInfoBundleTracker moduleInfoBundleTracker) {
+ this.moduleInfoBundleTracker = moduleInfoBundleTracker;
+ }
+
+ public RuntimeGeneratedMappingServiceImpl startRuntimeMappingService(BundleContext context) {
+ RuntimeGeneratedMappingServiceImpl service = new RuntimeGeneratedMappingServiceImpl(moduleInfoBundleTracker.getModuleInfoLoadingStrategy());
+ service.setPool(CLASS_POOL);
service.init();
startRuntimeMappingService(service, context);
+ return service;
}
private void startRuntimeMappingService(RuntimeGeneratedMappingServiceImpl service, BundleContext context) {
Hashtable<String, String> properties = new Hashtable<String, String>();
listenerReg = context.registerService(SchemaServiceListener.class, service, properties);
mappingReg = context.registerService(BindingIndependentMappingService.class, service, properties);
-
+
}
@Override
- public void stop(BundleContext context) throws Exception {
- if(listenerReg != null) {
- listenerReg.unregister();
- }
- if(mappingReg != null) {
- mappingReg.unregister();
- }
+ public void close() throws Exception {
+ mappingReg.unregister();
+ listenerReg.unregister();
}
}
</Private-Package>
<Export-Package>
org.opendaylight.controller.config.threadpool.util,
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.threadpool.impl.rev130405.*,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.threadpool.impl.*,
</Export-Package>
</instructions>
</configuration>
config:java-name-prefix IdentityTest;
}
- identity test-identity1 {
-
- }
-
- identity test-identity2 {
- base test-identity1;
- }
-
augment "/config:modules/config:module/config:configuration" {
case impl-identity-test {
when "/config:modules/config:module/config:type = 'impl-identity-test'";
leaf afi {
type identityref {
- base test-identity1;
+ base tt:test-identity1;
}
}
container identities-container {
leaf afi {
type identityref {
- base test-identity1;
+ base tt:test-identity1;
}
}
}
list identities {
leaf afi {
type identityref {
- base test-identity1;
+ base tt:test-identity1;
}
}
leaf safi {
type identityref {
- base test-identity1;
+ base tt:test-identity1;
}
}
container identities-inner {
leaf afi {
type identityref {
- base test-identity1;
+ base tt:test-identity1;
}
}
}
}
}
+
+
+ identity test-identity1 {
+
+ }
+
+ identity test-identity2 {
+ base test-identity1;
+ }
}
import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;
import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.test.impl.rev130403.TestIdentity1;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.test.impl.rev130403.TestIdentity2;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.test.types.rev131127.TestIdentity1;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.test.types.rev131127.TestIdentity2;
import org.opendaylight.yangtools.yang.data.impl.codec.CodecRegistry;
import org.opendaylight.yangtools.yang.data.impl.codec.IdentityCodec;
<configuration>
<instructions>
<Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- <Bundle-Activator>org.opendaylight.controller.sal.binding.osgi.Activator</Bundle-Activator>
<Export-package>
org.opendaylight.controller.sal.binding.spi.*,
</Export-package>
public class SingletonHolder {
- public static final ClassPool CLASS_POOL = new ClassPool();
+ public static final ClassPool CLASS_POOL = ClassPool.getDefault();
public static final org.opendaylight.controller.sal.binding.codegen.impl.RuntimeCodeGenerator RPC_GENERATOR_IMPL = new org.opendaylight.controller.sal.binding.codegen.impl.RuntimeCodeGenerator(
CLASS_POOL);
public static final RuntimeCodeGenerator RPC_GENERATOR = RPC_GENERATOR_IMPL;
import org.opendaylight.controller.netconf.util.xml.XmlElement;
import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants;
import org.opendaylight.controller.netconf.util.xml.XmlUtil;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.test.impl.rev130403.TestIdentity1;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.test.impl.rev130403.TestIdentity2;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.test.types.rev131127.TestIdentity1;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.test.types.rev131127.TestIdentity2;
import org.opendaylight.yangtools.yang.data.impl.codec.CodecRegistry;
import org.opendaylight.yangtools.yang.data.impl.codec.IdentityCodec;
import org.opendaylight.yangtools.yang.model.api.Module;
</type>
<name>id-test</name>
<identities>
- <afi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:test:impl">prefix:test-identity1</afi>
- <safi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:test:impl">prefix:test-identity2</safi>
+ <afi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:test:types">prefix:test-identity1</afi>
+ <safi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:test:types">prefix:test-identity2</safi>
</identities>
<identities>
- <afi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:test:impl">prefix:test-identity2</afi>
- <safi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:test:impl">prefix:test-identity1</safi>
+ <afi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:test:types">prefix:test-identity2</afi>
+ <safi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:test:types">prefix:test-identity1</safi>
</identities>
<identities-container>
- <afi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:test:impl">prefix:test-identity2</afi>
+ <afi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:test:types">prefix:test-identity2</afi>
</identities-container>
- <afi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:test:impl">prefix:test-identity1</afi>
+ <afi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:test:types">prefix:test-identity1</afi>
</module>
</modules>