import java.util.Collections;
import java.util.Set;
import java.util.concurrent.atomic.AtomicReference;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.netconf.api.capability.Capability;
import org.opendaylight.netconf.api.monitoring.CapabilityListener;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
return currentContext.get();
}
- public CurrentSchemaContext(final SchemaService schemaService,
+ public CurrentSchemaContext(final DOMSchemaService schemaService,
final SchemaSourceProvider<YangTextSchemaSource> rootSchemaSourceProvider) {
this.rootSchemaSourceProvider = rootSchemaSourceProvider;
schemaContextListenerListenerRegistration = schemaService.registerSchemaContextListener(this);
* 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.netconf.mdsal.connector;
import com.google.common.base.Preconditions;
import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.mdsal.dom.api.DOMYangTextSourceProvider;
import org.opendaylight.netconf.api.capability.BasicCapability;
import org.opendaylight.netconf.api.capability.Capability;
import org.opendaylight.netconf.api.capability.YangModuleCapability;
private final NetconfOperationServiceFactoryListener netconfOperationServiceFactoryListener;
public MdsalNetconfOperationServiceFactory(
- final SchemaService schemaService,
- final SchemaSourceProvider<YangTextSchemaSource> rootSchemaSourceProviderDependency,
+ final DOMSchemaService schemaService,
final NetconfOperationServiceFactoryListener netconfOperationServiceFactoryListener,
final DOMDataBroker dataBroker,
final DOMRpcService rpcService) {
this.dataBroker = dataBroker;
this.rpcService = rpcService;
- this.rootSchemaSourceProviderDependency = rootSchemaSourceProviderDependency;
+ this.rootSchemaSourceProviderDependency = (DOMYangTextSourceProvider) schemaService.getSupportedExtensions()
+ .get(DOMYangTextSourceProvider.class);
this.currentSchemaContext = new CurrentSchemaContext(Preconditions.checkNotNull(schemaService),
rootSchemaSourceProviderDependency);
this.netconfOperationServiceFactoryListener = netconfOperationServiceFactoryListener;
<reference id="domDataBroker" interface="org.opendaylight.controller.md.sal.dom.api.DOMDataBroker"/>
<reference id="domRpcService" interface="org.opendaylight.controller.md.sal.dom.api.DOMRpcService"/>
<reference id="schemaService"
- interface="org.opendaylight.controller.sal.core.api.model.SchemaService"/>
- <reference id="rootSchemaSourceProviderDependency"
- interface="org.opendaylight.controller.sal.core.api.model.YangTextSourceProvider"/>
+ interface="org.opendaylight.mdsal.dom.api.DOMSchemaService"/>
<reference id="netconfOperationServiceFactoryListener"
interface="org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener"
odl:type="mapper-aggregator-registry"/>
class="org.opendaylight.netconf.mdsal.connector.MdsalNetconfOperationServiceFactory"
destroy-method="close">
<argument ref="schemaService"/>
- <argument ref="rootSchemaSourceProviderDependency"/>
<argument ref="netconfOperationServiceFactoryListener"/>
<argument ref="domDataBroker"/>
<argument ref="domRpcService"/>
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreFactory;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.controller.sal.core.spi.data.DOMStore;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.netconf.api.xml.XmlUtil;
import org.opendaylight.netconf.mapping.api.NetconfOperation;
import org.opendaylight.netconf.mapping.api.NetconfOperationChainedExecution;
XMLUnit.setIgnoreAttributeOrder(true);
final SchemaContext schemaContext = getSchemaContext();
- final SchemaService schemaService = new SchemaServiceStub(schemaContext);
+ final DOMSchemaService schemaService = new SchemaServiceStub(schemaContext);
final DOMStore operStore = InMemoryDOMDataStoreFactory.create("DOM-OPER", schemaService);
final DOMStore configStore = InMemoryDOMDataStoreFactory.create("DOM-CFG", schemaService);
currentSchemaContext = new CurrentSchemaContext(schemaService, sourceIdentifier -> {
final YangTextSchemaSource yangTextSchemaSource =
YangTextSchemaSource.delegateForByteSource(sourceIdentifier, ByteSource.wrap("module test".getBytes()));
- return Futures.immediateCheckedFuture(yangTextSchemaSource);
+ return Futures.immediateFuture(yangTextSchemaSource);
});
final EnumMap<LogicalDatastoreType, DOMStore> datastores = new EnumMap<>(LogicalDatastoreType.class);
import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
import org.opendaylight.controller.md.sal.dom.spi.DefaultDOMRpcResult;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.DocumentedException.ErrorSeverity;
import org.opendaylight.netconf.api.DocumentedException.ErrorTag;
private CurrentSchemaContext currentSchemaContext = null;
@Mock
- private SchemaService schemaService;
+ private DOMSchemaService schemaService;
@Mock
private SchemaContextListener listener;
@Mock
initMocks(this);
doNothing().when(registration).close();
doReturn(listener).when(registration).getInstance();
- doNothing().when(schemaService).addModule(any(Module.class));
- doNothing().when(schemaService).removeModule(any(Module.class));
doReturn(schemaContext).when(schemaService).getGlobalContext();
doReturn(schemaContext).when(schemaService).getSessionContext();
doAnswer(invocationOnMock -> {
* 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.netconf.mdsal.connector.ops;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
-final class SchemaServiceStub implements SchemaService {
+final class SchemaServiceStub implements DOMSchemaService {
private final SchemaContext schemaContext;
SchemaServiceStub(SchemaContext schemaContext) {
this.schemaContext = schemaContext;
}
- @Override
- public void addModule(final Module module) {
- }
-
- @Override
- public void removeModule(final Module module) {
-
- }
-
@Override
public SchemaContext getSessionContext() {
return schemaContext;
public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(
final SchemaContextListener listener) {
listener.onGlobalContextUpdated(getGlobalContext());
- return new ListenerRegistration<SchemaContextListener>() {
- @Override
- public void close() {
- }
-
+ return new AbstractListenerRegistration<SchemaContextListener>(listener) {
@Override
- public SchemaContextListener getInstance() {
- return listener;
+ protected void removeRegistration() {
+ // No-op
}
};
}
* 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.netconf.mdsal.yang.library;
import com.google.common.util.concurrent.FutureCallback;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.mdsal.common.api.CommitInfo;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesState;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesStateBuilder;
private static final InstanceIdentifier<ModulesState> MODULES_STATE_INSTANCE_IDENTIFIER =
InstanceIdentifier.create(ModulesState.class);
- private final SchemaService schemaService;
+ private final DOMSchemaService schemaService;
private final AtomicInteger moduleSetId;
private final DataBroker dataBroker;
- public SchemaServiceToMdsalWriter(final SchemaService schemaService,
+ public SchemaServiceToMdsalWriter(final DOMSchemaService schemaService,
final DataBroker dataBroker) {
this.schemaService = schemaService;
this.dataBroker = dataBroker;
interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
odl:type="default"/>
<reference id="schemaService"
- interface="org.opendaylight.controller.sal.core.api.model.SchemaService" />
+ interface="org.opendaylight.mdsal.dom.api.DOMSchemaService" />
<bean id="schemaServiceToMdsalWriter"
class="org.opendaylight.netconf.mdsal.yang.library.SchemaServiceToMdsalWriter"
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.mdsal.common.api.CommitInfo;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesState;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesStateBuilder;
InstanceIdentifier.create(ModulesState.class);
@Mock
- private SchemaService schemaService;
+ private DOMSchemaService schemaService;
@Mock
private DataBroker dataBroker;
@Mock
import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreFactory;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.controller.sal.core.spi.data.DOMStore;
import org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator;
import org.opendaylight.mdsal.binding.dom.codec.gen.impl.StreamWriterGenerator;
import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
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.netconf.console.utils.NetconfConsoleConstants;
import org.opendaylight.netconf.console.utils.NetconfConsoleUtils;
import org.opendaylight.netconf.console.utils.NetconfIidFactory;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
+import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
"/schemas/network-topology@2013-10-21.yang", "/schemas/ietf-inet-types@2013-07-15.yang",
"/schemas/yang-ext.yang", "/schemas/netconf-node-topology.yang");
schemaContext.getModules();
- final SchemaService schemaService = createSchemaService();
+ final DOMSchemaService schemaService = createSchemaService();
final DOMStore operStore = InMemoryDOMDataStoreFactory.create("DOM-OPER", schemaService);
final DOMStore configStore = InMemoryDOMDataStoreFactory.create("DOM-CFG", schemaService);
assertEquals(ImmutableList.of(CONN_STATUS.name()), mapNode.get(NetconfConsoleConstants.STATUS));
}
- private SchemaService createSchemaService() {
- return new SchemaService() {
-
- @Override
- public void addModule(final Module module) {
- }
-
- @Override
- public void removeModule(final Module module) {
-
- }
+ private DOMSchemaService createSchemaService() {
+ return new DOMSchemaService() {
@Override
public SchemaContext getSessionContext() {
public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(
final SchemaContextListener listener) {
listener.onGlobalContextUpdated(getGlobalContext());
- return new ListenerRegistration<SchemaContextListener>() {
- @Override
- public void close() {
-
- }
+ return new AbstractListenerRegistration<SchemaContextListener>(listener) {
@Override
- public SchemaContextListener getInstance() {
- return listener;
+ protected void removeRegistration() {
+ // No-op
}
};
}
import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreFactory;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.controller.sal.core.spi.data.DOMStore;
import org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator;
import org.opendaylight.mdsal.binding.dom.codec.gen.impl.StreamWriterGenerator;
import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
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.netconf.sal.connect.netconf.listener.NetconfDeviceCapabilities;
import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
+import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafNodeBuilder;
-import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
"/schemas/yang-ext.yang", "/schemas/netconf-node-topology.yang",
"/schemas/network-topology-augment-test@2016-08-08.yang");
schemaContext.getModules();
- final SchemaService schemaService = createSchemaService();
+ final DOMSchemaService schemaService = createSchemaService();
final DOMStore operStore = InMemoryDOMDataStoreFactory.create("DOM-OPER", schemaService);
final DOMStore configStore = InMemoryDOMDataStoreFactory.create("DOM-CFG", schemaService);
dataTestId, testNode.get().getValue());
}
- private SchemaService createSchemaService() {
- return new SchemaService() {
-
- @Override
- public void addModule(final Module module) {
- }
-
- @Override
- public void removeModule(final Module module) {
-
- }
+ private DOMSchemaService createSchemaService() {
+ return new DOMSchemaService() {
@Override
public SchemaContext getSessionContext() {
public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(
final SchemaContextListener listener) {
listener.onGlobalContextUpdated(getGlobalContext());
- return new ListenerRegistration<SchemaContextListener>() {
- @Override
- public void close() {
-
- }
-
+ return new AbstractListenerRegistration<SchemaContextListener>(listener) {
@Override
- public SchemaContextListener getInstance() {
- return listener;
+ protected void removeRegistration() {
+ // No-op
}
};
}
import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreFactory;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.controller.sal.core.spi.data.DOMStore;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.netconf.api.capability.Capability;
import org.opendaylight.netconf.api.monitoring.CapabilityListener;
import org.opendaylight.netconf.impl.SessionIdProvider;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.Yang;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Schemas;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.schemas.Schema;
+import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder;
-import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
private final long currentSessionId;
private final SchemaContext schemaContext;
private final Set<Capability> caps;
- private final SchemaService schemaService;
+ private final DOMSchemaService schemaService;
private final DOMDataBroker dataBroker;
private final SchemaSourceProvider<YangTextSchemaSource> sourceProvider;
new YangInstanceIdentifier.NodeIdentifier(NetconfState.QNAME)).withChild(schemasContainer).build();
}
- private static DOMDataBroker createDataStore(final SchemaService schemaService, final long sessionId) {
+ private static DOMDataBroker createDataStore(final DOMSchemaService schemaService, final long sessionId) {
LOG.debug("Session {}: Creating data stores for simulated device", sessionId);
final DOMStore operStore = InMemoryDOMDataStoreFactory
.create("DOM-OPER", schemaService);
return new SerializedDOMDataBroker(datastores, MoreExecutors.listeningDecorator(listenableFutureExecutor));
}
- private SchemaService createSchemaService() {
- return new SchemaService() {
-
- @Override
- public void addModule(final Module module) {
- }
-
- @Override
- public void removeModule(final Module module) {
-
- }
+ private DOMSchemaService createSchemaService() {
+ return new DOMSchemaService() {
@Override
public SchemaContext getSessionContext() {
public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(
final SchemaContextListener listener) {
listener.onGlobalContextUpdated(getGlobalContext());
- return new ListenerRegistration<SchemaContextListener>() {
- @Override
- public void close() {
-
- }
+ return new AbstractListenerRegistration<SchemaContextListener>(listener) {
@Override
- public SchemaContextListener getInstance() {
- return listener;
+ protected void removeRegistration() {
+ // No-op
}
};
}
import org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizer;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.mdsal.dom.api.DOMYangTextSourceProvider;
import org.opendaylight.netconf.sal.rest.api.Draft02;
private volatile SchemaContext globalSchema;
private volatile DataNormalizer dataNormalizer;
- private ControllerContext(SchemaService schemaService, DOMMountPointService mountService,
+ private ControllerContext(DOMSchemaService schemaService, DOMMountPointService mountService,
DOMYangTextSourceProvider yangTextSourceProvider) {
this.mountService = mountService;
this.yangTextSourceProvider = yangTextSourceProvider;
listenerRegistration = schemaService.registerSchemaContextListener(this);
}
- public static ControllerContext newInstance(SchemaService schemaService, DOMMountPointService mountService,
+ public static ControllerContext newInstance(DOMSchemaService schemaService, DOMMountPointService mountService,
DOMSchemaService domSchemaService) {
final DOMYangTextSourceProvider yangTextSourceProvider =
(DOMYangTextSourceProvider) domSchemaService.getSupportedExtensions().get(DOMYangTextSourceProvider.class);
</cm:default-properties>
</cm:property-placeholder>
- <reference id="schemaService" interface="org.opendaylight.controller.sal.core.api.model.SchemaService"/>
+ <reference id="schemaService" interface="org.opendaylight.mdsal.dom.api.DOMSchemaService"/>
<reference id="domRpcService" interface="org.opendaylight.controller.md.sal.dom.api.DOMRpcService"/>
<reference id="domMountPointService" interface="org.opendaylight.controller.md.sal.dom.api.DOMMountPointService"/>
<reference id="domNotificationService" interface="org.opendaylight.controller.md.sal.dom.api.DOMNotificationService"/>
import javax.xml.transform.dom.DOMSource;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.controller.sal.rest.impl.test.providers.TestJsonBodyWriter;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
doReturn(Optional.fromNullable(mountInstance)).when(mockMountService)
.getMountPoint(any(YangInstanceIdentifier.class));
- SchemaService mockSchemaService = mock(SchemaService.class);
+ DOMSchemaService mockSchemaService = mock(DOMSchemaService.class);
doReturn(schemaContext).when(mockSchemaService).getGlobalContext();
DOMSchemaService mockDomSchemaService = mock(DOMSchemaService.class);
import java.util.Objects;
import java.util.Optional;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
/**
* This class gathers all YANG-defined {@link org.opendaylight.yangtools.yang.model.api.Module}s and
*/
public class ApiDocGeneratorDraftO2 extends BaseYangSwaggerGeneratorDraft02 {
- public ApiDocGeneratorDraftO2(SchemaService schemaService) {
+ public ApiDocGeneratorDraftO2(DOMSchemaService schemaService) {
super(Optional.of(Objects.requireNonNull(schemaService)));
}
}
import java.util.Objects;
import java.util.Optional;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
/**
* This class gathers all YANG-defined {@link org.opendaylight.yangtools.yang.model.api.Module}s and
*/
public class ApiDocGeneratorRFC8040 extends BaseYangSwaggerGeneratorRFC8040 {
- public ApiDocGeneratorRFC8040(SchemaService schemaService) {
+ public ApiDocGeneratorRFC8040(DOMSchemaService schemaService) {
super(Optional.of(Objects.requireNonNull(schemaService)));
}
}
import java.util.SortedSet;
import java.util.TreeSet;
import javax.ws.rs.core.UriInfo;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.netconf.sal.rest.doc.model.builder.OperationBuilder;
import org.opendaylight.netconf.sal.rest.doc.model.builder.OperationBuilder.Delete;
import org.opendaylight.netconf.sal.rest.doc.model.builder.OperationBuilder.Get;
// private Map<String, ApiDeclaration> MODULE_DOC_CACHE = new HashMap<>()
private final ObjectMapper mapper = new ObjectMapper();
- private final SchemaService schemaService;
+ private final DOMSchemaService schemaService;
- protected BaseYangSwaggerGenerator(Optional<SchemaService> schemaService) {
+ protected BaseYangSwaggerGenerator(Optional<DOMSchemaService> schemaService) {
this.schemaService = schemaService.orElse(null);
this.mapper.configure(SerializationFeature.INDENT_OUTPUT, true);
}
- public SchemaService getSchemaService() {
+ public DOMSchemaService getSchemaService() {
return schemaService;
}
package org.opendaylight.netconf.sal.rest.doc.impl;
import java.util.Optional;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
/**
* Base class for a bierman draft02 implementation.
public abstract class BaseYangSwaggerGeneratorDraft02 extends BaseYangSwaggerGenerator {
protected static final String RESTCONF_CONTEXT_ROOT = "restconf";
- protected BaseYangSwaggerGeneratorDraft02(Optional<SchemaService> schemaService) {
+ protected BaseYangSwaggerGeneratorDraft02(Optional<DOMSchemaService> schemaService) {
super(schemaService);
}
package org.opendaylight.netconf.sal.rest.doc.impl;
import java.util.Optional;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
/**
* Base class for an RFC 8040 implementation.
private static final String BASE_PATH = "rests";
- protected BaseYangSwaggerGeneratorRFC8040(Optional<SchemaService> schemaService) {
+ protected BaseYangSwaggerGeneratorRFC8040(Optional<DOMSchemaService> schemaService) {
super(schemaService);
}
import java.util.Objects;
import java.util.Optional;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.netconf.sal.rest.doc.mountpoints.MountPointSwagger;
/**
private final MountPointSwagger mountPointSwagger;
- public MountPointSwaggerGeneratorDraft02(SchemaService schemaService, DOMMountPointService mountService) {
+ public MountPointSwaggerGeneratorDraft02(DOMSchemaService schemaService, DOMMountPointService mountService) {
super(Optional.of(Objects.requireNonNull(schemaService)));
mountPointSwagger = new MountPointSwagger(schemaService, mountService, this);
mountPointSwagger.init();
import java.util.Objects;
import java.util.Optional;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.netconf.sal.rest.doc.mountpoints.MountPointSwagger;
/**
public class MountPointSwaggerGeneratorRFC8040 extends BaseYangSwaggerGeneratorRFC8040 implements AutoCloseable {
private final MountPointSwagger mountPointSwagger;
- public MountPointSwaggerGeneratorRFC8040(SchemaService schemaService, DOMMountPointService mountService) {
+ public MountPointSwaggerGeneratorRFC8040(DOMSchemaService schemaService, DOMMountPointService mountService) {
super(Optional.of(Objects.requireNonNull(schemaService)));
mountPointSwagger = new MountPointSwagger(schemaService, mountService, this);
mountPointSwagger.init();
import javax.ws.rs.core.UriInfo;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.netconf.sal.rest.doc.impl.BaseYangSwaggerGenerator;
import org.opendaylight.netconf.sal.rest.doc.swagger.Api;
import org.opendaylight.netconf.sal.rest.doc.swagger.ApiDeclaration;
private static final String DATASTORES_REVISION = "-";
private static final String DATASTORES_LABEL = "Datastores";
- private final SchemaService globalSchema;
+ private final DOMSchemaService globalSchema;
private final DOMMountPointService mountService;
private final BaseYangSwaggerGenerator swaggerGenerator;
private final Map<YangInstanceIdentifier, Long> instanceIdToLongId =
private ListenerRegistration<MountProvisionListener> registration;
- public MountPointSwagger(SchemaService globalSchema, DOMMountPointService mountService,
+ public MountPointSwagger(DOMSchemaService globalSchema, DOMMountPointService mountService,
BaseYangSwaggerGenerator swaggerGenerator) {
this.globalSchema = Objects.requireNonNull(globalSchema);
this.mountService = Objects.requireNonNull(mountService);
xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
odl:use-default-for-reference-types="true">
- <reference id="schemaService" interface="org.opendaylight.controller.sal.core.api.model.SchemaService"/>
+ <reference id="schemaService" interface="org.opendaylight.mdsal.dom.api.DOMSchemaService"/>
<reference id="domMountPointService" interface="org.opendaylight.controller.md.sal.dom.api.DOMMountPointService"/>
<reference id="webServer" interface="org.opendaylight.aaa.web.WebServer"/>
<reference id="webContextSecurer" interface="org.opendaylight.aaa.web.WebContextSecurer"/>
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
import org.mockito.ArgumentCaptor;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
return this.schemaContext;
}
- public SchemaService createMockSchemaService(SchemaContext mockContext) {
+ public DOMSchemaService createMockSchemaService(SchemaContext mockContext) {
if (mockContext == null) {
mockContext = createMockSchemaContext();
}
- final SchemaService mockSchemaService = mock(SchemaService.class);
+ final DOMSchemaService mockSchemaService = mock(DOMSchemaService.class);
when(mockSchemaService.getGlobalContext()).thenReturn(mockContext);
return mockSchemaService;
}
import org.junit.Test;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.netconf.sal.rest.doc.impl.MountPointSwaggerGeneratorDraft02;
import org.opendaylight.netconf.sal.rest.doc.mountpoints.MountPointSwagger;
import org.opendaylight.netconf.sal.rest.doc.swagger.Api;
// in our test.
// OK for testing - real thing would have seperate instances.
final SchemaContext context = this.helper.createMockSchemaContext();
- final SchemaService schemaService = this.helper.createMockSchemaService(context);
+ final DOMSchemaService schemaService = this.helper.createMockSchemaService(context);
final DOMMountPoint mountPoint = mock(DOMMountPoint.class);
when(mountPoint.getSchemaContext()).thenReturn(context);