*/
package org.opendaylight.transportpce.test.common;
+import com.google.common.collect.ClassToInstanceMap;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import java.util.ServiceLoader;
import java.util.concurrent.Executors;
import javassist.ClassPool;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.mdsal.binding.generator.util.BindingRuntimeContext;
import org.opendaylight.mdsal.binding.generator.util.JavassistUtils;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaServiceExtension;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.util.ListenerRegistry;
import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider;
this.dataBroker = createDataBroker();
this.notificationService = createNotificationService();
this.notificationPublishService = createNotificationPublishService();
- for (ListenerRegistration<SchemaContextListener> listener : mockedSchemaContext.listeners) {
- listener.getInstance().onGlobalContextUpdated(mockedSchemaContext.schemaContext);
+ for (ListenerRegistration<SchemaContextListener> listener : this.mockedSchemaContext.listeners) {
+ listener.getInstance().onGlobalContextUpdated(this.mockedSchemaContext.schemaContext);
}
}
@Override
public SchemaContext getSchemaContext() {
- return mockedSchemaContext.schemaContext;
+ return this.mockedSchemaContext.schemaContext;
}
@Override
public BindingNormalizedNodeCodecRegistry getBindingToNormalizedNodeCodec() {
- return mockedSchemaContext.bindingStreamCodecs;
+ return this.mockedSchemaContext.bindingStreamCodecs;
}
@Override
public NotificationService getNotificationService() {
- return notificationService;
+ return this.notificationService;
}
@Override
public NotificationPublishService getNotificationPublishService() {
- return notificationPublishService;
+ return this.notificationPublishService;
}
private DOMDataBroker createDOMDataBroker() {
- return new SerializedDOMDataBroker(datastores,
+ return new SerializedDOMDataBroker(this.datastores,
MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor()));
}
this.listeners = ListenerRegistry.create();
this.bindingStreamCodecs = createBindingRegistry();
GeneratedClassLoadingStrategy loading = GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy();
- this.bindingToNormalized = new BindingToNormalizedNodeCodec(loading, bindingStreamCodecs);
+ this.bindingToNormalized = new BindingToNormalizedNodeCodec(loading, this.bindingStreamCodecs);
registerSchemaContextListener(this.bindingToNormalized);
}
@Override
public SchemaContext getSchemaContext() {
- return schemaContext;
+ return this.schemaContext;
}
/**
* @return SchemaContext a schema context
*/
private SchemaContext getSchemaContext(List<YangModuleInfo> moduleInfos) {
- moduleInfoBackedCntxt.addModuleInfos(moduleInfos);
+ this.moduleInfoBackedCntxt.addModuleInfos(moduleInfos);
Optional<SchemaContext> tryToCreateSchemaContext =
- moduleInfoBackedCntxt.tryToCreateSchemaContext().toJavaUtil();
+ this.moduleInfoBackedCntxt.tryToCreateSchemaContext().toJavaUtil();
if (!tryToCreateSchemaContext.isPresent()) {
LOG.error("Could not create the initial schema context. Schema context is empty");
throw new IllegalStateException();
@Override
public SchemaContext getGlobalContext() {
- return schemaContext;
+ return this.schemaContext;
}
@Override
public SchemaContext getSessionContext() {
- return schemaContext;
+ return this.schemaContext;
}
@Override
public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(
SchemaContextListener listener) {
- return listeners.register(listener);
+ return this.listeners.register(listener);
}
/**
* @return BindingNormalizedNodeCodecRegistry the resulting binding registry
*/
private BindingNormalizedNodeCodecRegistry createBindingRegistry() {
- BindingRuntimeContext bindingContext = BindingRuntimeContext.create(moduleInfoBackedCntxt, schemaContext);
+ BindingRuntimeContext bindingContext = BindingRuntimeContext.create(this.moduleInfoBackedCntxt, this.schemaContext);
BindingNormalizedNodeCodecRegistry bindingNormalizedNodeCodecRegistry =
new BindingNormalizedNodeCodecRegistry(
StreamWriterGenerator.create(JavassistUtils.forClassPool(ClassPool.getDefault())));
bindingNormalizedNodeCodecRegistry.onBindingRuntimeContextUpdated(bindingContext);
return bindingNormalizedNodeCodecRegistry;
}
+
+ /* (non-Javadoc)
+ * @see org.opendaylight.mdsal.dom.api.DOMExtensibleService#getExtensions()
+ */
+ @Override
+ public @NonNull ClassToInstanceMap<DOMSchemaServiceExtension> getExtensions() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
}