package org.opendaylight.controller.sal.restconf.binding.impl;
import java.net.URL;
-
import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
import org.opendaylight.yangtools.restconf.client.api.UnsupportedProtocolException;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService;
import org.opendaylight.yangtools.yang.model.api.SchemaContextHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private final RestconfClientContext restconfClientContext;
private final RestconfClientContextFactory restconfClientContextFactory = null;
- public DataBrokerServiceImpl(URL baseUrl, BindingIndependentMappingService mappingService, SchemaContextHolder schemaContextHolder) throws UnsupportedProtocolException {
- this.restconfClientContext = restconfClientContextFactory.getRestconfClientContext(baseUrl, mappingService, schemaContextHolder);
+ public DataBrokerServiceImpl(URL baseUrl, SchemaContextHolder schemaContextHolder) throws UnsupportedProtocolException {
+ this.restconfClientContext = restconfClientContextFactory.getRestconfClientContext(baseUrl, schemaContextHolder);
}
@Override
*/
package org.opendaylight.controller.sal.restconf.broker.client;
+import com.google.common.base.Preconditions;
import java.net.URL;
-
-import javassist.ClassPool;
-
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer;
import org.opendaylight.controller.sal.restconf.broker.SalRemoteServiceBroker;
import org.opendaylight.yangtools.restconf.client.api.RestconfClientContext;
import org.opendaylight.yangtools.restconf.client.api.UnsupportedProtocolException;
import org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext;
-import org.opendaylight.yangtools.sal.binding.generator.impl.RuntimeGeneratedMappingServiceImpl;
import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Preconditions;
-
-class SalRemoteClientImpl implements SalRemoteClient {
+class SalRemoteClientImpl implements SalRemoteClient, SchemaContextHolder {
private static final Logger logger = LoggerFactory.getLogger(SalRemoteClientImpl.class);
private final RestconfClientContext restconfClientContext;
private final SalRemoteServiceBroker salRemoteBroker;
- private final RuntimeGeneratedMappingServiceImpl mappingService;
+
+ private SchemaContext schemaContext;
public SalRemoteClientImpl(final URL url) {
Preconditions.checkNotNull(url);
- this.mappingService = new RuntimeGeneratedMappingServiceImpl(ClassPool.getDefault());
final ModuleInfoBackedContext moduleInfo = ModuleInfoBackedContext.create();
moduleInfo.addModuleInfos(BindingReflections.loadModuleInfos());
- this.mappingService.onGlobalContextUpdated(moduleInfo.tryToCreateSchemaContext().get());
-
+ schemaContext = moduleInfo.tryToCreateSchemaContext().get();
try {
- this.restconfClientContext = new RestconfClientFactory().getRestconfClientContext(url, this.mappingService,
- this.mappingService);
+ this.restconfClientContext = new RestconfClientFactory().getRestconfClientContext(url,this);
this.salRemoteBroker = new SalRemoteServiceBroker("remote-broker", restconfClientContext);
this.salRemoteBroker.start();
}, null);
}
+ @Override
+ public SchemaContext getSchemaContext() {
+ return schemaContext;
+ }
+
@Override
public void close() throws Exception {
this.restconfClientContext.close();
+++ /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.sal.binding.impl.test;
-
-public class DataBrokerImplTest {
-
- public static void main(String[] args){
-
- }
-}
+++ /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.sal.binding.impl.test;
-
-public class NotificationServiceImplTest {
-
- public static void main(String[] args){
-
- }
-}