</dependencyManagement>
<dependencies>
+ <dependency>
+ <groupId>org.opendaylight.aaa</groupId>
+ <artifactId>features-aaa-shiro</artifactId>
+ <version>${aaa.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>features-protocol-framework</artifactId>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcpkix-jdk15on</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcprov-jdk15on</artifactId>
+ </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netconf-client</artifactId>
<feature version='${project.version}'>odl-netconf-mapping-api</feature>
<feature version='${project.version}'>odl-netconf-util</feature>
<bundle>mvn:org.opendaylight.netconf/netconf-netty-util/{{VERSION}}</bundle>
- <bundle>mvn:org.bouncycastle/bcpkix-jdk15on/${bouncycastle.version}</bundle>
- <bundle>mvn:org.bouncycastle/bcprov-jdk15on/${bouncycastle.version}</bundle>
+ <bundle>mvn:org.bouncycastle/bcpkix-jdk15on/{{VERSION}}</bundle>
+ <bundle>mvn:org.bouncycastle/bcprov-jdk15on/{{VERSION}}</bundle>
<bundle>mvn:org.apache.sshd/sshd-core/{{VERSION}}</bundle>
<bundle>mvn:openexi/nagasena/{{VERSION}}</bundle>
<bundle>mvn:io.netty/netty-codec/{{VERSION}}</bundle>
<controller.mdsal.version>1.3.0-SNAPSHOT</controller.mdsal.version>
<features.test.version>1.6.0-SNAPSHOT</features.test.version>
<jersey-servlet.version>1.17</jersey-servlet.version>
-
<mdsal.version>2.0.0-SNAPSHOT</mdsal.version>
<mdsal.model.version>0.8.0-SNAPSHOT</mdsal.model.version>
<restconf.version>1.3.0-SNAPSHOT</restconf.version>
- <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
<surefire.version>2.15</surefire.version>
+ <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
<features.file>features.xml</features.file>
<config.configfile.directory>etc/opendaylight/karaf</config.configfile.directory>
</dependency>
<dependency>
<groupId>org.opendaylight.aaa</groupId>
- <artifactId>features-aaa</artifactId>
+ <artifactId>features-aaa-shiro</artifactId>
<version>${aaa.version}</version>
<classifier>features</classifier>
<type>xml</type>
</dependency>
-
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-remote</artifactId>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
- <version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
- <version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
- <version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<repository>mvn:org.opendaylight.controller/features-mdsal/{{VERSION}}/xml/features</repository>
<repository>mvn:org.opendaylight.yangtools/features-yangtools/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.aaa/features-aaa/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.aaa/features-aaa-shiro/{{VERSION}}/xml/features</repository>
<feature name='odl-restconf-all' version='${project.version}' description='OpenDaylight :: Restconf :: All'>
<feature version='${project.version}'>odl-restconf</feature>
<feature version='${project.version}'>odl-mdsal-apidocs</feature>
</feature>
<feature name='odl-restconf' version='${project.version}' description="OpenDaylight :: Restconf">
- <feature version='${aaa.version}'>odl-aaa-authn</feature>
+ <!-- Enables AAA through the odl-shiro-act bundle Activator -->
+ <bundle>mvn:org.opendaylight.aaa/aaa-shiro-act/{{VERSION}}</bundle>
<feature version='${project.version}'>odl-restconf-noauth</feature>
</feature>
<feature name='odl-restconf-noauth' version='${project.version}' description="OpenDaylight :: Restconf">
+ <feature version='${aaa.version}'>odl-aaa-shiro</feature>
<feature version='${controller.mdsal.version}'>odl-mdsal-broker</feature>
<feature>war</feature>
<!-- presently we need sal-remote to be listed BEFORE sal-rest-connector because sal-rest-connector
+/*
+ * Copyright (c) 2015 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.yang.netconf.mdsal.monitoring;
import java.util.Collections;
+/*
+ * Copyright (c) 2015 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
+ */
+
/*
* Generated file
*
+/*
+ * Copyright (c) 2015 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.yang.netconf.mdsal.notification;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
+/*
+ * Copyright (c) 2015 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
+ */
+
/*
* Generated file
*
+/*
+ * Copyright (c) 2015 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.yang.messagebus.netconf;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+/*
+ * Copyright (c) 2015 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
+ */
+
/*
* Generated file
*
of the session that made the change will be reported.";
choice server-or-user {
mandatory true;
- //FIXME: After Bug 4414 is resolved, use shorthand version of case statement
- case server {
- leaf server {
- type empty;
- description
+ leaf server {
+ type empty;
+ description
"If present, the change was caused
- by the server.";
- }
+ by the server.";
}
+
case by-user {
uses common-session-parms;
}
+/*
+ * Copyright (c) 2014 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.yang.config.netconf.client.dispatcher;
import javax.management.InstanceAlreadyExistsException;
+/*
+ * Copyright (c) 2015 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.yang.config.netconf.northbound.impl;
import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
+/*
+ * Copyright (c) 2015 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
+ */
+
/*
* Generated file
*
+/*
+ * Copyright (c) 2015 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.yang.config.netconf.northbound.impl;
import org.opendaylight.controller.config.api.JmxAttributeValidationException;
+/*
+ * Copyright (c) 2015 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
+ */
+
/*
* Generated file
*
+/*
+ * Copyright (c) 2015 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.yang.config.netconf.northbound.impl;
import org.opendaylight.netconf.impl.osgi.NetconfMonitoringServiceImpl;
+/*
+ * Copyright (c) 2015 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
+ */
+
/*
* Generated file
*
new ServiceTracker<>(context, NetconfNotificationCollector.class, new ServiceTrackerCustomizer<NetconfNotificationCollector, NetconfNotificationCollector>() {
@Override
public NetconfNotificationCollector addingService(ServiceReference<NetconfNotificationCollector> reference) {
- Preconditions.checkState(listenerReg != null, "Notification collector service was already added");
+ Preconditions.checkState(listenerReg == null, "Notification collector service was already added");
listenerReg = context.getService(reference).registerBaseNotificationPublisher();
monitoringService.setNotificationPublisher(listenerReg);
return null;
import org.openexi.proc.common.EXIOptions;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Start-exi netconf message.
public static final String LEXICAL_VALUES_KEY = "lexical-values";
public static final String PIS_KEY = "pis";
public static final String PREFIXES_KEY = "prefixes";
-
+ private static final Logger LOG = LoggerFactory.getLogger(NetconfStartExiMessage.class);
private NetconfStartExiMessage(final Document doc) {
super(doc);
}
final Element alignmentElement = doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0,
ALIGNMENT_KEY);
- String alignmentString = EXIParameters.EXI_PARAMETER_BIT_PACKED;
+ String alignmentString;
switch (exiOptions.getAlignmentType()) {
case byteAligned: {
alignmentString = EXIParameters.EXI_PARAMETER_BYTE_ALIGNED;
break;
}
- case bitPacked: {
- alignmentString = EXIParameters.EXI_PARAMETER_BIT_PACKED;
- break;
- }
case compress: {
alignmentString = EXIParameters.EXI_PARAMETER_COMPRESSED;
break;
alignmentString = EXIParameters.EXI_PARAMETER_PRE_COMPRESSION;
break;
}
+ default:
+ LOG.warn("Unexpected value in EXI alignment type: {} , using default value", exiOptions.getAlignmentType());
+ case bitPacked: {
+ alignmentString = EXIParameters.EXI_PARAMETER_BIT_PACKED;
+ break;
+ }
}
alignmentElement.setTextContent(alignmentString);
+/*
+ * Copyright (c) 2015 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.yang.netconf.northbound.notification.impl;
import org.opendaylight.netconf.notifications.impl.NetconfNotificationManager;
+/*
+ * Copyright (c) 2015 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
+ */
+
/*
* Generated file
*
+/*
+ * Copyright (c) 2014 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.yang.netconf.northbound.ssh;
import io.netty.channel.ChannelFuture;
+/*
+ * Copyright (c) 2014 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
+ */
+
/*
* Generated file
*
+/*
+ * Copyright (c) 2014 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.yang.netconf.northbound.tcp;
import io.netty.channel.ChannelFuture;
+/*
+ * Copyright (c) 2014 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
+ */
+
/*
* Generated file
*
+/*
+ * Copyright (c) 2015 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.yang.clustered.netconf.topology;
import org.opendaylight.netconf.topology.impl.ClusteredNetconfTopology;
+/*
+ * Copyright (c) 2015 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
+ */
+
/*
* Generated file
*
+/*
+ * Copyright (c) 2015 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.yang.netconf.topology.shared.schema.repository;
import org.opendaylight.netconf.topology.SchemaRepositoryProvider;
+/*
+ * Copyright (c) 2015 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
+ */
+
/*
* Generated file
*
import com.google.common.base.Predicate;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Iterables;
+
import java.io.Closeable;
import java.io.Flushable;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
+import java.util.Objects;
+
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.schema.AnyXmlNode;
import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode;
}
public OrderedNormalizedNodeWriter write(final NormalizedNode<?, ?> node) throws IOException {
- if (root == schemaContext) {
+ if (Objects.equals(root, schemaContext)) {
return write(node, schemaContext.getDataChildByName(node.getNodeType()));
}
@Override
public void onSuccess(final DOMRpcResult result) {
- LOG.debug("{}: Keepalive RPC successful with response: {}", id, result.getResult());
- scheduleKeepalive();
+ if (result != null && result.getResult() != null) {
+ LOG.debug("{}: Keepalive RPC successful with response: {}", id, result.getResult());
+ scheduleKeepalive();
+ } else {
+ LOG.warn("{} Keepalive RPC returned null with response: {}. Reconnecting netconf session", id, result);
+ reconnect();
+ }
}
@Override
final DOMRpcResult result = new DefaultDOMRpcResult(Builders.containerBuilder().withNodeIdentifier(
new YangInstanceIdentifier.NodeIdentifier(NetconfMessageTransformUtil.NETCONF_RUNNING_QNAME)).build());
- final DOMRpcResult resultFail = new DefaultDOMRpcResult(mock(RpcError.class));
+ RpcError error = mock(RpcError.class);
+ doReturn("Failure").when(error).toString();
+
+ final DOMRpcResult resultFailWithResultAndError = new DefaultDOMRpcResult(mock(NormalizedNode.class), error);
doReturn(Futures.immediateCheckedFuture(result))
- .doReturn(Futures.immediateCheckedFuture(resultFail))
+ .doReturn(Futures.immediateCheckedFuture(resultFailWithResultAndError))
.doReturn(Futures.immediateFailedCheckedFuture(new IllegalStateException("illegal-state")))
.when(deviceRpc).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
// Reconnect with same keepalive responses
doReturn(Futures.immediateCheckedFuture(result))
- .doReturn(Futures.immediateCheckedFuture(resultFail))
+ .doReturn(Futures.immediateCheckedFuture(resultFailWithResultAndError))
.doReturn(Futures.immediateFailedCheckedFuture(new IllegalStateException("illegal-state")))
.when(deviceRpc).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
verify(listener, timeout(15000).times(2)).disconnect();
// 6 attempts now total
verify(deviceRpc, times(3 * 2)).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
+
+ final DOMRpcResult resultFailwithError = new DefaultDOMRpcResult(error);
+
+ doReturn(Futures.immediateCheckedFuture(resultFailwithError))
+ .when(deviceRpc).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
+
+ keepaliveSalFacade.onDeviceConnected(null, null, deviceRpc);
+
+ // 1 failed that results in disconnect, 3 total with previous fail
+ verify(listener, timeout(15000).times(3)).disconnect();
}
@Test
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
+import java.util.ArrayList;
import net.sourceforge.argparse4j.ArgumentParsers;
import net.sourceforge.argparse4j.annotation.Arg;
import net.sourceforge.argparse4j.inf.ArgumentParser;
@Arg(dest = "throttle")
public int throttle;
+ @Arg(dest = "auth")
+ public ArrayList<String> auth;
+
static ArgumentParser getParser() {
final ArgumentParser parser = ArgumentParsers.newArgumentParser("netconf stress client");
"with mutltiple threads this gets divided among all threads")
.dest("throttle");
+ parser.addArgument("--auth")
+ .nargs(2)
+ .help("Username and password for HTTP basic authentication in order username password.")
+ .dest("auth");
+
return parser;
}
Preconditions.checkArgument(editContent.exists(), "Edit content file missing");
Preconditions.checkArgument(editContent.isDirectory() == false, "Edit content file is a dir");
Preconditions.checkArgument(editContent.canRead(), "Edit content file is unreadable");
+
+ Preconditions.checkArgument(destination.startsWith("/"), "Destination should start with a '/'");
+
// TODO validate
}
import com.ning.http.client.AsyncHttpClient;
import com.ning.http.client.AsyncHttpClientConfig;
+import com.ning.http.client.Realm;
import com.ning.http.client.Request;
import java.util.ArrayList;
import java.util.concurrent.Callable;
.build());
this.payloads = new ArrayList<>();
for (DestToPayload payload : payloads) {
- this.payloads.add(asyncHttpClient.preparePost(payload.getDestination())
+ AsyncHttpClient.BoundRequestBuilder requestBuilder = asyncHttpClient.preparePost(payload.getDestination())
.addHeader("content-type", "application/json")
.addHeader("Accept", "application/xml")
.setBody(payload.getPayload())
- .setRequestTimeout(Integer.MAX_VALUE)
- .build());
+ .setRequestTimeout(Integer.MAX_VALUE);
+
+ if(params.auth != null) {
+ requestBuilder.setRealm(new Realm.RealmBuilder()
+ .setScheme(Realm.AuthScheme.BASIC)
+ .setPrincipal(params.auth.get(0))
+ .setPassword(params.auth.get(1))
+ .setUsePreemptiveAuth(true)
+ .build());
+ }
+
+ this.payloads.add(requestBuilder.build());
}
executionStrategy = getExecutionStrategy();
}
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-remote</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-data-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-data-impl</artifactId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>javax.annotation-api</artifactId>
+ <version>1.2</version>
+ </dependency>
<!-- Testing Dependencies -->
<dependency>
<build>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <classpathDependencyExcludes>
+ <!-- Removes com.sun.jersey from testing classpath so there is no conflict with org.glassfish.jersey -->
+ <classpathDependencyExclude>com.sun.jersey</classpathDependencyExclude>
+ </classpathDependencyExcludes>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
org.opendaylight.netconf.sal.restconf.impl,
org.opendaylight.netconf.md.sal.rest.common.*,
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.rest.connector.rev140724.*,
+ javax.annotation
</Private-Package>
<Import-Package>
- com.sun.jersey.spi.container.servlet, org.eclipse.jetty.servlets,
- <!-- Set the javax packages version to 0. Relying on "*" includes versions from jsr305 dependency whic are
- incompatible with karaf provided packages -->
- javax.*;version="0.0",
*,
+ com.sun.jersey.spi.container.servlet,
+ org.eclipse.jetty.servlets,
+ org.opendaylight.aaa.shiro.filters,
+ org.opendaylight.aaa.shiro.realm,
+ org.opendaylight.aaa.shiro.web.env,
+ org.apache.shiro.web.env
</Import-Package>
<Embed-Dependency>stax-utils</Embed-Dependency>
<Web-ContextPath>/restconf</Web-ContextPath>
+/**
+ * Copyright (c) 2015 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.yang.md.sal.rest.connector;
import org.opendaylight.netconf.sal.restconf.impl.RestconfProviderImpl;
+/**
+ * Copyright (c) 2015 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
+ */
/*
* Generated file
*
+/**
+ * Copyright (c) 2015 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.yang.sal.restconf.service;
import org.opendaylight.netconf.sal.restconf.impl.JSONRestconfServiceImpl;
+/**
+ * Copyright (c) 2015 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
+ */
/*
* Generated file
*
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.data.api.schema.stream.ForwardingNormalizedNodeStreamWriter;
import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeWriter;
import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactory;
// stream writer validates the node type against the schema and thus will expect a LeafSchemaNode but
// the schema has a ContainerSchemaNode so, to avoid an error, we override the leafNode behavior
// for error-info.
- final NormalizedNodeStreamWriter streamWriter = new DelegatingNormalizedNodeStreamWriter(jsonStreamWriter) {
+ final NormalizedNodeStreamWriter streamWriter = new ForwardingNormalizedNodeStreamWriter() {
+ @Override
+ protected NormalizedNodeStreamWriter delegate() {
+ return jsonStreamWriter;
+ }
+
@Override
public void leafNode(final NodeIdentifier name, final Object value) throws IOException {
if(name.getNodeType().equals(Draft02.RestConfModule.ERROR_INFO_QNAME)) {
// stream writer validates the node type against the schema and thus will expect a LeafSchemaNode but
// the schema has a ContainerSchemaNode so, to avoid an error, we override the leafNode behavior
// for error-info.
- final NormalizedNodeStreamWriter streamWriter = new DelegatingNormalizedNodeStreamWriter(xmlStreamWriter) {
+ final NormalizedNodeStreamWriter streamWriter = new ForwardingNormalizedNodeStreamWriter() {
+ @Override
+ protected NormalizedNodeStreamWriter delegate() {
+ return xmlStreamWriter;
+ }
+
@Override
public void leafNode(final NodeIdentifier name, final Object value) throws IOException {
if(name.getNodeType().equals(Draft02.RestConfModule.ERROR_INFO_QNAME)) {
nnWriter.flush();
}
}
-
- private static class DelegatingNormalizedNodeStreamWriter implements NormalizedNodeStreamWriter {
- private final NormalizedNodeStreamWriter delegate;
-
- DelegatingNormalizedNodeStreamWriter(NormalizedNodeStreamWriter delegate) {
- this.delegate = delegate;
- }
-
- @Override
- public void leafNode(NodeIdentifier name, Object value) throws IOException, IllegalArgumentException {
- delegate.leafNode(name, value);
- }
-
- @Override
- public void startLeafSet(NodeIdentifier name, int childSizeHint) throws IOException, IllegalArgumentException {
- delegate.startLeafSet(name, childSizeHint);
- }
-
- @Override
- public void leafSetEntryNode(Object value) throws IOException, IllegalArgumentException {
- delegate.leafSetEntryNode(value);
- }
-
- @Override
- public void startContainerNode(NodeIdentifier name, int childSizeHint) throws IOException,
- IllegalArgumentException {
- delegate.startContainerNode(name, childSizeHint);
- }
-
- @Override
- public void startUnkeyedList(NodeIdentifier name, int childSizeHint) throws IOException,
- IllegalArgumentException {
- delegate.startUnkeyedList(name, childSizeHint);
- }
-
- @Override
- public void startUnkeyedListItem(NodeIdentifier name, int childSizeHint) throws IOException,
- IllegalStateException {
- delegate.startUnkeyedListItem(name, childSizeHint);
- }
-
- @Override
- public void startMapNode(NodeIdentifier name, int childSizeHint) throws IOException, IllegalArgumentException {
- delegate.startMapNode(name, childSizeHint);
- }
-
- @Override
- public void startMapEntryNode(NodeIdentifierWithPredicates identifier, int childSizeHint) throws IOException,
- IllegalArgumentException {
- delegate.startMapEntryNode(identifier, childSizeHint);
- }
-
- @Override
- public void startOrderedMapNode(NodeIdentifier name, int childSizeHint) throws IOException,
- IllegalArgumentException {
- delegate.startOrderedMapNode(name, childSizeHint);
- }
-
- @Override
- public void startChoiceNode(NodeIdentifier name, int childSizeHint) throws IOException,
- IllegalArgumentException {
- delegate.startChoiceNode(name, childSizeHint);
- }
-
- @Override
- public void startAugmentationNode(AugmentationIdentifier identifier) throws IOException,
- IllegalArgumentException {
- delegate.startAugmentationNode(identifier);
- }
-
- @Override
- public void anyxmlNode(NodeIdentifier name, Object value) throws IOException, IllegalArgumentException {
- delegate.anyxmlNode(name, value);
- }
-
- @Override
- public void startYangModeledAnyXmlNode(NodeIdentifier name, int childSizeHint) throws IOException {
- delegate.startYangModeledAnyXmlNode(name, childSizeHint);
- }
-
- @Override
- public void endNode() throws IOException, IllegalStateException {
- delegate.endNode();
- }
-
- @Override
- public void close() throws IOException {
- delegate.close();
- }
-
- @Override
- public void flush() throws IOException {
- delegate.flush();
- }
- }
}
<param-name>javax.ws.rs.Application</param-name>
<param-value>org.opendaylight.netconf.sal.rest.impl.RestconfApplication</param-value>
</init-param>
- <!-- AAA Auth Filter -->
- <init-param>
- <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
- <param-value> org.opendaylight.aaa.sts.TokenAuthFilter</param-value>
- </init-param>
<load-on-startup>1</load-on-startup>
</servlet>
+ <context-param>
+ <param-name>shiroEnvironmentClass</param-name>
+ <param-value>org.opendaylight.aaa.shiro.web.env.KarafIniWebEnvironment</param-value>
+ </context-param>
+
+ <listener>
+ <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>ShiroFilter</filter-name>
+ <filter-class>org.opendaylight.aaa.shiro.filters.AAAFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>ShiroFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
<servlet-mapping>
<servlet-name>JAXRSRestconf</servlet-name>
<url-pattern>/*</url-pattern>