</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>mdsal-netconf-connector</artifactId>
+ <artifactId>netconf-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>netconf-impl</artifactId>
+ <artifactId>netconf-mapping-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>netconf-mapping-api</artifactId>
+ <artifactId>mdsal-netconf-connector</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<version>${project.version}</version>
<type>test-jar</type>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>netconf-impl</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netconf-netty-util</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>netconf-impl</artifactId>
+ <artifactId>netconf-server</artifactId>
</dependency>
</dependencies>
</project>
</dependency>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
- <artifactId>netconf-impl</artifactId>
+ <artifactId>netconf-server</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
import java.util.Map;
import org.opendaylight.controller.config.threadpool.ScheduledThreadPool;
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
-import org.opendaylight.netconf.impl.osgi.NetconfMonitoringServiceImpl;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+import org.opendaylight.netconf.server.osgi.NetconfMonitoringServiceImpl;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import io.netty.channel.EventLoopGroup;
import java.util.Map;
import org.opendaylight.netconf.api.NetconfServerDispatcher;
-import org.opendaylight.netconf.impl.NetconfServerDispatcherImpl;
-import org.opendaylight.netconf.impl.ServerChannelInitializer;
+import org.opendaylight.netconf.server.NetconfServerDispatcherImpl;
+import org.opendaylight.netconf.server.ServerChannelInitializer;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
*/
package org.opendaylight.netconf.impl.mdsal;
-import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
+import org.opendaylight.netconf.server.osgi.AggregatedNetconfOperationServiceFactory;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import io.netty.util.Timer;
import java.util.Map;
import org.opendaylight.controller.config.threadpool.ScheduledThreadPool;
-import org.opendaylight.netconf.impl.NetconfServerSessionNegotiatorFactory;
-import org.opendaylight.netconf.impl.ServerChannelInitializer;
-import org.opendaylight.netconf.impl.SessionIdProvider;
-import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+import org.opendaylight.netconf.server.NetconfServerSessionNegotiatorFactory;
+import org.opendaylight.netconf.server.ServerChannelInitializer;
+import org.opendaylight.netconf.server.SessionIdProvider;
+import org.opendaylight.netconf.server.osgi.AggregatedNetconfOperationServiceFactory;
import org.osgi.framework.FrameworkUtil;
import org.osgi.service.component.ComponentFactory;
import org.osgi.service.component.ComponentInstance;
<groupId>${project.groupId}</groupId>
<artifactId>netconf-client</artifactId>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>netconf-server</artifactId>
+ </dependency>
<dependency>
<groupId>com.guicedee.services</groupId>
<artifactId>javax.inject</artifactId>
<groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
<artifactId>rfc6991</artifactId>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>netconf-impl</artifactId>
- </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netconf-mapping-api</artifactId>
import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStoreFactory;
import org.opendaylight.netconf.api.capability.Capability;
import org.opendaylight.netconf.api.monitoring.CapabilityListener;
-import org.opendaylight.netconf.impl.SessionIdProvider;
import org.opendaylight.netconf.mapping.api.NetconfOperation;
import org.opendaylight.netconf.mapping.api.NetconfOperationService;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
import org.opendaylight.netconf.mdsal.connector.ops.Unlock;
import org.opendaylight.netconf.mdsal.connector.ops.get.Get;
import org.opendaylight.netconf.mdsal.connector.ops.get.GetConfig;
+import org.opendaylight.netconf.server.SessionIdProvider;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfState;
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.netconf.api.capability.Capability;
import org.opendaylight.netconf.api.capability.YangModuleCapability;
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
-import org.opendaylight.netconf.impl.DefaultSessionIdProvider;
-import org.opendaylight.netconf.impl.NetconfServerDispatcherImpl;
-import org.opendaylight.netconf.impl.NetconfServerSessionNegotiatorFactory;
-import org.opendaylight.netconf.impl.ServerChannelInitializer;
-import org.opendaylight.netconf.impl.SessionIdProvider;
-import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+import org.opendaylight.netconf.server.DefaultSessionIdProvider;
+import org.opendaylight.netconf.server.NetconfServerDispatcherImpl;
+import org.opendaylight.netconf.server.NetconfServerSessionNegotiatorFactory;
+import org.opendaylight.netconf.server.ServerChannelInitializer;
+import org.opendaylight.netconf.server.SessionIdProvider;
+import org.opendaylight.netconf.server.osgi.AggregatedNetconfOperationServiceFactory;
import org.opendaylight.netconf.shaded.sshd.common.keyprovider.KeyPairProvider;
import org.opendaylight.netconf.shaded.sshd.common.util.threads.ThreadUtils;
import org.opendaylight.netconf.ssh.SshProxyServer;
import java.util.Set;
import org.opendaylight.netconf.api.capability.Capability;
import org.opendaylight.netconf.api.monitoring.CapabilityListener;
-import org.opendaylight.netconf.impl.SessionIdProvider;
import org.opendaylight.netconf.mapping.api.NetconfOperation;
import org.opendaylight.netconf.mapping.api.NetconfOperationService;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+import org.opendaylight.netconf.server.SessionIdProvider;
import org.opendaylight.netconf.test.tool.rpc.DataList;
import org.opendaylight.netconf.test.tool.rpc.SimulatedCommit;
import org.opendaylight.netconf.test.tool.rpc.SimulatedCreateSubscription;
import java.util.Map;
import java.util.Set;
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
-import org.opendaylight.netconf.impl.NetconfServerSessionNegotiatorFactory;
-import org.opendaylight.netconf.impl.SessionIdProvider;
import org.opendaylight.netconf.mapping.api.NetconfOperationService;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+import org.opendaylight.netconf.server.NetconfServerSessionNegotiatorFactory;
+import org.opendaylight.netconf.server.SessionIdProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Optional;
import java.util.Set;
import org.opendaylight.netconf.api.capability.Capability;
-import org.opendaylight.netconf.impl.SessionIdProvider;
import org.opendaylight.netconf.mapping.api.NetconfOperation;
import org.opendaylight.netconf.mapping.api.NetconfOperationService;
+import org.opendaylight.netconf.server.SessionIdProvider;
import org.opendaylight.netconf.test.tool.rpc.DataList;
import org.opendaylight.netconf.test.tool.rpc.SimulatedCommit;
import org.opendaylight.netconf.test.tool.rpc.SimulatedCreateSubscription;
import java.util.Set;
import org.opendaylight.netconf.api.capability.Capability;
-import org.opendaylight.netconf.impl.SessionIdProvider;
import org.opendaylight.netconf.mapping.api.NetconfOperationService;
+import org.opendaylight.netconf.server.SessionIdProvider;
/**
* Creator which enables testtool users to inject own. implementation of {@link NetconfOperationService}
import java.util.Set;
import org.opendaylight.netconf.api.capability.Capability;
import org.opendaylight.netconf.api.monitoring.CapabilityListener;
-import org.opendaylight.netconf.impl.SessionIdProvider;
import org.opendaylight.netconf.mapping.api.NetconfOperationService;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+import org.opendaylight.netconf.server.SessionIdProvider;
import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
import org.opendaylight.netconf.api.xml.XmlUtil;
-import org.opendaylight.netconf.impl.NetconfServerSession;
-import org.opendaylight.netconf.impl.mapping.operations.DefaultNetconfOperation;
+import org.opendaylight.netconf.server.NetconfServerSession;
+import org.opendaylight.netconf.server.mapping.operations.DefaultNetconfOperation;
import org.opendaylight.netconf.util.mapping.AbstractLastNetconfOperation;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
public class SimulatedCreateSubscription extends AbstractLastNetconfOperation implements DefaultNetconfOperation {
-
private final Map<Notification, NetconfMessage> notifications;
+
private NetconfServerSession session;
private ScheduledExecutorService scheduledExecutorService;
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>netconf-impl</artifactId>
+ <artifactId>netconf-server</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<relativePath>../../parent</relativePath>
</parent>
- <artifactId>netconf-impl</artifactId>
+ <artifactId>netconf-server</artifactId>
<name>${project.artifactId}</name>
<packaging>bundle</packaging>
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Export-Package>org.opendaylight.netconf.impl.*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar-no-fork</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
</project>
* 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.impl;
+package org.opendaylight.netconf.server;
import java.util.concurrent.atomic.AtomicLong;
import javax.inject.Inject;
* 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.impl;
+package org.opendaylight.netconf.server;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
public class NetconfServerDispatcherImpl extends AbstractNetconfDispatcher<NetconfServerSession,
NetconfServerSessionListener> implements NetconfServerDispatcher {
-
private final ServerChannelInitializer initializer;
- public NetconfServerDispatcherImpl(ServerChannelInitializer serverChannelInitializer, EventLoopGroup bossGroup,
- EventLoopGroup workerGroup) {
+ public NetconfServerDispatcherImpl(final ServerChannelInitializer serverChannelInitializer,
+ final EventLoopGroup bossGroup, final EventLoopGroup workerGroup) {
super(bossGroup, workerGroup);
- this.initializer = serverChannelInitializer;
+ initializer = serverChannelInitializer;
}
@Override
- public ChannelFuture createServer(InetSocketAddress address) {
+ public ChannelFuture createServer(final InetSocketAddress address) {
return super.createServer(address, initializer::initialize);
}
@Override
- public ChannelFuture createLocalServer(LocalAddress address) {
+ public ChannelFuture createLocalServer(final LocalAddress address) {
return super.createServer(address, LocalServerChannel.class, initializer::initialize);
}
}
* 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.impl;
+package org.opendaylight.netconf.server;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.base.Verify.verify;
public final class NetconfServerSession extends AbstractNetconfSession<NetconfServerSession,
NetconfServerSessionListener> implements NetconfManagementSession {
-
private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSession.class);
private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
-
- private static final String DATE_TIME_PATTERN_STRING;
+ private static final Pattern DATE_TIME_PATTERN;
static {
verify(DateAndTime.PATTERN_CONSTANTS.size() == 1);
- DATE_TIME_PATTERN_STRING = DateAndTime.PATTERN_CONSTANTS.get(0);
+ DATE_TIME_PATTERN = Pattern.compile(DateAndTime.PATTERN_CONSTANTS.get(0));
}
- private static final Pattern DATE_TIME_PATTERN = Pattern.compile(DATE_TIME_PATTERN_STRING);
-
private final NetconfHelloMessageAdditionalHeader header;
private final NetconfServerSessionListener sessionListener;
* 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.impl;
+package org.opendaylight.netconf.server;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import org.opendaylight.netconf.api.monitoring.SessionListener;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
import org.opendaylight.netconf.api.xml.XmlUtil;
-import org.opendaylight.netconf.impl.osgi.NetconfOperationRouter;
import org.opendaylight.netconf.notifications.NetconfNotification;
+import org.opendaylight.netconf.server.osgi.NetconfOperationRouter;
import org.opendaylight.netconf.util.messages.SubtreeFilter;
import org.opendaylight.yangtools.yang.common.ErrorSeverity;
import org.opendaylight.yangtools.yang.common.ErrorTag;
import org.w3c.dom.Node;
public class NetconfServerSessionListener implements NetconfSessionListener<NetconfServerSession> {
-
private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSessionListener.class);
+
private final SessionListener monitoringSessionListener;
private final NetconfOperationRouter operationRouter;
private final AutoCloseable onSessionDownCloseable;
final NetconfMonitoringService monitoringService,
final AutoCloseable onSessionDownCloseable) {
this.operationRouter = operationRouter;
- this.monitoringSessionListener = monitoringService.getSessionListener();
+ monitoringSessionListener = monitoringService.getSessionListener();
this.onSessionDownCloseable = onSessionDownCloseable;
}
* 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.impl;
+package org.opendaylight.netconf.server;
import io.netty.channel.Channel;
import io.netty.channel.local.LocalAddress;
* 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.impl;
+package org.opendaylight.netconf.server;
import com.google.common.base.Preconditions;
import com.google.common.collect.Collections2;
import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.impl.osgi.NetconfOperationRouter;
-import org.opendaylight.netconf.impl.osgi.NetconfOperationRouterImpl;
import org.opendaylight.netconf.mapping.api.NetconfOperationService;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
import org.opendaylight.netconf.nettyutil.AbstractNetconfSessionNegotiator;
import org.opendaylight.netconf.nettyutil.NetconfSessionNegotiatorFactory;
+import org.opendaylight.netconf.server.osgi.NetconfOperationRouter;
+import org.opendaylight.netconf.server.osgi.NetconfOperationRouterImpl;
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.netconf.monitoring.rev101004.netconf.state.Capabilities;
* 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.impl;
+package org.opendaylight.netconf.server;
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
* 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.impl;
+package org.opendaylight.netconf.server;
import com.google.common.base.Preconditions;
import io.netty.channel.Channel;
private static final Logger LOG = LoggerFactory.getLogger(SendErrorExceptionUtil.class);
private SendErrorExceptionUtil() {
-
+ // Hidden on purpose
}
- public static void sendErrorMessage(final NetconfSession session,
- final DocumentedException sendErrorException) {
+ public static void sendErrorMessage(final NetconfSession session, final DocumentedException sendErrorException) {
LOG.trace("Sending error", sendErrorException);
final Document errorDocument = createDocument(sendErrorException);
ChannelFuture channelFuture = session.sendMessage(new NetconfMessage(errorDocument));
* 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.impl;
+package org.opendaylight.netconf.server;
import static java.util.Objects.requireNonNull;
import io.netty.channel.Channel;
import io.netty.util.concurrent.Promise;
-import org.opendaylight.netconf.impl.util.DeserializerExceptionHandler;
import org.opendaylight.netconf.nettyutil.AbstractChannelInitializer;
+import org.opendaylight.netconf.server.util.DeserializerExceptionHandler;
public final class ServerChannelInitializer extends AbstractChannelInitializer<NetconfServerSession> {
private static final String DESERIALIZER_EX_HANDLER_KEY = "deserializerExHandler";
* 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.impl;
+package org.opendaylight.netconf.server;
public interface SessionIdProvider {
* 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.impl.mapping.operations;
+package org.opendaylight.netconf.server.mapping.operations;
import static java.util.Objects.requireNonNull;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.impl.NetconfServerSession;
+import org.opendaylight.netconf.server.NetconfServerSession;
import org.opendaylight.netconf.util.mapping.AbstractSingletonNetconfOperation;
import org.opendaylight.yangtools.yang.common.ErrorSeverity;
import org.opendaylight.yangtools.yang.common.ErrorTag;
@Override
public void setNetconfSession(final NetconfServerSession netconfServerSession) {
- this.session = netconfServerSession;
+ session = netconfServerSession;
}
}
* 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.impl.mapping.operations;
+package org.opendaylight.netconf.server.mapping.operations;
-import org.opendaylight.netconf.impl.NetconfServerSession;
+import org.opendaylight.netconf.server.NetconfServerSession;
public interface DefaultNetconfOperation {
void setNetconfSession(NetconfServerSession netconfServerSession);
* 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.impl.mapping.operations;
+package org.opendaylight.netconf.server.mapping.operations;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.NetconfMessage;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
import org.opendaylight.netconf.api.xml.XmlUtil;
-import org.opendaylight.netconf.impl.NetconfServerSession;
import org.opendaylight.netconf.mapping.api.NetconfOperationChainedExecution;
+import org.opendaylight.netconf.server.NetconfServerSession;
import org.opendaylight.netconf.util.mapping.AbstractSingletonNetconfOperation;
import org.opendaylight.yangtools.yang.common.ErrorSeverity;
import org.opendaylight.yangtools.yang.common.ErrorTag;
* 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.impl.mapping.operations;
+package org.opendaylight.netconf.server.mapping.operations;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
import org.opendaylight.netconf.api.xml.XmlUtil;
-import org.opendaylight.netconf.impl.NetconfServerSession;
+import org.opendaylight.netconf.server.NetconfServerSession;
import org.opendaylight.netconf.util.mapping.AbstractSingletonNetconfOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory
.getLogger(DefaultStopExi.class);
- public DefaultStopExi(String netconfSessionIdForReporting) {
+ public DefaultStopExi(final String netconfSessionIdForReporting) {
super(netconfSessionIdForReporting);
}
@Override
- protected Element handleWithNoSubsequentOperations(Document document,
- XmlElement operationElement) {
+ protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
LOG.debug("Received stop-exi message {} ", XmlUtil.toString(operationElement));
netconfSession.stopExiCommunication();
}
@Override
- public void setNetconfSession(NetconfServerSession netconfServerSession) {
- this.netconfSession = netconfServerSession;
+ public void setNetconfSession(final NetconfServerSession netconfServerSession) {
+ netconfSession = netconfServerSession;
}
}
* 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.impl.osgi;
+package org.opendaylight.netconf.server.osgi;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableSet;
* 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.impl.osgi;
+package org.opendaylight.netconf.server.osgi;
import static com.google.common.base.Preconditions.checkState;
import static org.opendaylight.netconf.api.xml.XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_CAPABILITY_CANDIDATE_1_0;
* 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.impl.osgi;
+package org.opendaylight.netconf.server.osgi;
import java.util.Optional;
import org.opendaylight.controller.config.threadpool.ScheduledThreadPool;
import org.opendaylight.yangtools.concepts.Registration;
public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, AutoCloseable {
-
private final NetconfCapabilityMonitoringService capabilityMonitoring;
private final NetconfSessionMonitoringService sessionMonitoring;
* 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.impl.osgi;
+package org.opendaylight.netconf.server.osgi;
import org.opendaylight.netconf.api.DocumentedException;
-import org.opendaylight.netconf.impl.NetconfServerSession;
+import org.opendaylight.netconf.server.NetconfServerSession;
import org.w3c.dom.Document;
public interface NetconfOperationRouter extends AutoCloseable {
- Document onNetconfMessage(Document message, NetconfServerSession session)
- throws DocumentedException;
-
-
+ Document onNetconfMessage(Document message, NetconfServerSession session) throws DocumentedException;
}
* 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.impl.osgi;
+package org.opendaylight.netconf.server.osgi;
import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
import org.opendaylight.netconf.api.xml.XmlUtil;
-import org.opendaylight.netconf.impl.NetconfServerSession;
-import org.opendaylight.netconf.impl.mapping.operations.DefaultCloseSession;
-import org.opendaylight.netconf.impl.mapping.operations.DefaultNetconfOperation;
-import org.opendaylight.netconf.impl.mapping.operations.DefaultStartExi;
-import org.opendaylight.netconf.impl.mapping.operations.DefaultStopExi;
import org.opendaylight.netconf.mapping.api.HandlingPriority;
import org.opendaylight.netconf.mapping.api.NetconfOperation;
import org.opendaylight.netconf.mapping.api.NetconfOperationChainedExecution;
import org.opendaylight.netconf.mapping.api.NetconfOperationService;
import org.opendaylight.netconf.mapping.api.SessionAwareNetconfOperation;
+import org.opendaylight.netconf.server.NetconfServerSession;
+import org.opendaylight.netconf.server.mapping.operations.DefaultCloseSession;
+import org.opendaylight.netconf.server.mapping.operations.DefaultNetconfOperation;
+import org.opendaylight.netconf.server.mapping.operations.DefaultStartExi;
+import org.opendaylight.netconf.server.mapping.operations.DefaultStopExi;
import org.opendaylight.yangtools.yang.common.ErrorSeverity;
import org.opendaylight.yangtools.yang.common.ErrorTag;
import org.opendaylight.yangtools.yang.common.ErrorType;
import org.w3c.dom.Document;
public class NetconfOperationRouterImpl implements NetconfOperationRouter {
-
private static final Logger LOG = LoggerFactory.getLogger(NetconfOperationRouterImpl.class);
+
private final NetconfOperationService netconfOperationServiceSnapshot;
private final Collection<NetconfOperation> allNetconfOperations;
* 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.impl.osgi;
+package org.opendaylight.netconf.server.osgi;
import com.google.common.base.Preconditions;
import com.google.common.collect.Collections2;
* 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.impl.util;
+package org.opendaylight.netconf.server.util;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import java.util.Map;
import org.opendaylight.netconf.api.DocumentedException;
-import org.opendaylight.netconf.impl.SendErrorExceptionUtil;
+import org.opendaylight.netconf.server.SendErrorExceptionUtil;
import org.opendaylight.yangtools.yang.common.ErrorSeverity;
import org.opendaylight.yangtools.yang.common.ErrorTag;
import org.opendaylight.yangtools.yang.common.ErrorType;
* 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.impl;
+package org.opendaylight.netconf.server;
import static org.junit.Assert.assertEquals;
* 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.impl;
+package org.opendaylight.netconf.server;
import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;
import org.opendaylight.netconf.client.TestingNetconfClient;
import org.opendaylight.netconf.client.conf.NetconfClientConfiguration;
import org.opendaylight.netconf.client.conf.NetconfClientConfigurationBuilder;
-import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
import org.opendaylight.netconf.mapping.api.HandlingPriority;
import org.opendaylight.netconf.mapping.api.NetconfOperation;
import org.opendaylight.netconf.mapping.api.NetconfOperationChainedExecution;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
import org.opendaylight.netconf.nettyutil.NeverReconnectStrategy;
import org.opendaylight.netconf.nettyutil.handler.exi.NetconfStartExiMessage;
+import org.opendaylight.netconf.server.osgi.AggregatedNetconfOperationServiceFactory;
import org.opendaylight.netconf.util.messages.NetconfMessageUtil;
import org.opendaylight.netconf.util.test.XmlFileLoader;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.CapabilitiesBuilder;
* 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.impl;
+package org.opendaylight.netconf.server;
import static org.junit.Assert.assertNotNull;
String startExiString = XmlFileLoader.xmlFileToString("netconfMessages/startExi.xml");
assertNotNull(startExiString);
- NetconfMessage startExiMessage = XmlFileLoader.xmlFileToNetconfMessage(("netconfMessages/startExi.xml"));
+ NetconfMessage startExiMessage = XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/startExi.xml");
assertNotNull(startExiMessage);
/*
* 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.impl;
+package org.opendaylight.netconf.server;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
import static org.junit.Assert.assertArrayEquals;
* 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.impl;
+package org.opendaylight.netconf.server;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
+import org.opendaylight.netconf.server.osgi.AggregatedNetconfOperationServiceFactory;
public class NetconfDispatcherImplTest {
private EventLoopGroup nettyGroup;
* 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.impl;
+package org.opendaylight.netconf.server;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import org.opendaylight.netconf.api.monitoring.SessionEvent;
import org.opendaylight.netconf.api.monitoring.SessionListener;
import org.opendaylight.netconf.api.xml.XmlUtil;
-import org.opendaylight.netconf.impl.osgi.NetconfOperationRouter;
import org.opendaylight.netconf.notifications.NetconfNotification;
+import org.opendaylight.netconf.server.osgi.NetconfOperationRouter;
import org.w3c.dom.Document;
@RunWith(MockitoJUnitRunner.StrictStubs.class)
public class NetconfServerSessionListenerTest {
-
@Mock
private NetconfOperationRouter router;
@Mock
* 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.impl;
+package org.opendaylight.netconf.server;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
assertNotNull(NetconfServerSessionNegotiator.getHostName(socketAddress));
assertEquals(socketAddress.getHostName(),
- NetconfServerSessionNegotiator.getHostName(socketAddress)
- .getValue());
+ NetconfServerSessionNegotiator.getHostName(socketAddress).getValue());
socketAddress = new InetSocketAddress("TestPortInet", 20);
assertEquals(socketAddress.getHostName(),
- NetconfServerSessionNegotiator.getHostName(socketAddress)
- .getValue());
+ NetconfServerSessionNegotiator.getHostName(socketAddress).getValue());
assertEquals(String.valueOf(socketAddress.getPort()),
- NetconfServerSessionNegotiator.getHostName(socketAddress)
- .getKey());
+ NetconfServerSessionNegotiator.getHostName(socketAddress).getKey());
LocalAddress localAddress = new LocalAddress("TestPortLocal");
assertEquals(String.valueOf(localAddress.id()),
- NetconfServerSessionNegotiator.getHostName(localAddress)
- .getValue());
-
- SshdSocketAddress embeddedAddress = new SshdSocketAddress(
- "TestSshdName", 10);
+ NetconfServerSessionNegotiator.getHostName(localAddress).getValue());
+ SshdSocketAddress embeddedAddress = new SshdSocketAddress("TestSshdName", 10);
}
}
* 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.impl;
+package org.opendaylight.netconf.server;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
* 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.impl;
+package org.opendaylight.netconf.server;
import static java.util.Objects.requireNonNull;
import static org.junit.Assert.assertEquals;
* 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.impl.mapping.operations;
+package org.opendaylight.netconf.server.mapping.operations;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlUtil;
-import org.opendaylight.netconf.impl.NetconfServerSession;
-import org.opendaylight.netconf.impl.NetconfServerSessionListener;
+import org.opendaylight.netconf.server.NetconfServerSession;
+import org.opendaylight.netconf.server.NetconfServerSessionListener;
import org.w3c.dom.Document;
public class DefaultCloseSessionTest {
close.setNetconfSession(session);
close.handleWithNoSubsequentOperations(doc, elem);
// Fake close response to trigger delayed close
- session.sendMessage(new NetconfMessage(XmlUtil.readXmlToDocument("<rpc-reply message-id=\"101\"\n"
- + "xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n"
- + "<ok/>\n"
- + "</rpc-reply>")));
+ session.sendMessage(new NetconfMessage(XmlUtil.readXmlToDocument("""
+ <rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <ok/>
+ </rpc-reply>""")));
verify(channel).close();
verify(listener).onSessionTerminated(any(NetconfServerSession.class), any(NetconfTerminationReason.class));
}
* 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.impl.mapping.operations;
+package org.opendaylight.netconf.server.mapping.operations;
import static org.junit.Assert.assertNotNull;
import static org.mockito.ArgumentMatchers.any;
import org.junit.Test;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlUtil;
-import org.opendaylight.netconf.impl.NetconfServerSession;
+import org.opendaylight.netconf.server.NetconfServerSession;
import org.w3c.dom.Document;
public class DefaultStopExiTest {
* 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.impl.osgi;
+package org.opendaylight.netconf.server.osgi;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.doNothing;
* 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.impl.osgi;
+package org.opendaylight.netconf.server.osgi;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
* 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.impl.osgi;
+package org.opendaylight.netconf.server.osgi;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@RunWith(MockitoJUnitRunner.StrictStubs.class)
public class NetconfOperationRouterImplTest {
-
- private static final String TEST_RPC = "<rpc message-id=\"101\" "
- + "xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"><test/></rpc>\n";
+ private static final String TEST_RPC =
+ "<rpc message-id=\"101\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"><test/></rpc>\n";
private static final String MAX_PRIORITY_REPLY = "<high/>";
private static final String DEFAULT_PRIORITY_REPLY = "<default/>";
operationRouter.close();
verify(operationService).close();
}
-
}
* 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.impl.osgi;
+package org.opendaylight.netconf.server.osgi;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@RunWith(MockitoJUnitRunner.StrictStubs.class)
public class NetconfSessionMonitoringServiceTest {
-
private static final Session SESSION_1 = new SessionBuilder()
.setSessionId(Uint32.valueOf(1))
.setSourceHost(new Host(new IpAddress(new Ipv4Address("0.0.0.0"))))
* 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.impl.util;
+package org.opendaylight.netconf.server.util;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import org.junit.Test;
public class DeserializerExceptionHandlerTest {
-
private DeserializerExceptionHandler handler;
private ChannelFuture channelFuture;
private ChannelHandlerContext context;
<modules>
<module>netconf-api</module>
<module>netconf-client</module>
- <module>netconf-impl</module>
+ <module>netconf-server</module>
<module>netconf-util</module>
<module>restconf-api</module>
</modules>