Map<ConnectionConstants, String> params) {
if (connectionService == null)
return null;
- Node node = connectionService.connect(connectionIdentifier, params);
+ Node node = connectionService.connect(type, connectionIdentifier, params);
AbstractScheme scheme = schemes.get(activeScheme);
if (scheme != null && node != null)
scheme.addNode(node);
return nodeConnectorId.getValue();
}
+ public static NodeId toAdNodeId(final NodeConnectorId nodeConnectorId) {
+ NodeId nodeId = null;
+ if (nodeConnectorId != null) {
+ nodeId = new NodeId(nodeConnectorId.getValue().replaceFirst(":[0-9]+$", ""));
+ }
+ return nodeId;
+ }
+
public static NodeConnectorId toControllerNodeConnectorId(final NodeId node) {
return new NodeConnectorId(node.getValue() + ":" + 4294967293L);
}
import org.opendaylight.controller.sal.core.NodeConnector;
import org.opendaylight.controller.sal.flowprogrammer.Flow;
import org.opendaylight.controller.sal.match.Match;
+import org.opendaylight.controller.sal.match.MatchType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.MacAddressFilter;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanId;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.common.net.InetAddresses;
public class ToSalConversionsUtils {
+ private static final Logger LOG = LoggerFactory.getLogger(ToSalConversionsUtils.class);
+
private ToSalConversionsUtils() {
}
fillFrom(target, source.getLayer3Match());
fillFrom(target, source.getLayer4Match());
fillFrom(target, source.getIpMatch());
+ fillFrom(target, source.getInPort());
}
return target;
}
+ /**
+ * @param target
+ * @param inPort
+ */
+ private static void fillFrom(Match target, NodeConnectorId inPort) {
+ if (inPort != null) {
+ String inPortValue = inPort.getValue();
+ if (inPortValue != null) {
+ try {
+ target.setField(MatchType.IN_PORT, NodeMapping.toADNodeConnector(inPort,
+ NodeMapping.toAdNodeId(inPort)));
+ } catch (ConstructionException e) {
+ LOG.warn("nodeConnector construction failed", e);
+ }
+ }
+ }
+ }
+
private static void fillFrom(Match target, VlanMatch vlanMatch) {
if (vlanMatch != null) {
VlanId vlanId = vlanMatch.getVlanId();
import org.junit.Test;
import org.opendaylight.controller.sal.compatibility.NodeMapping;
import org.opendaylight.controller.sal.core.MacAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
/**
}
}
+ /**
+ * Test method for
+ * {@link org.opendaylight.controller.sal.compatibility.NodeMapping#toAdNodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId)}
+ * .
+ */
+ @Test
+ public void testToAdNodeId() {
+ NodeId observed;
+ observed = NodeMapping.toAdNodeId(null);
+ Assert.assertNull(observed);
+
+ observed = NodeMapping.toAdNodeId(new NodeConnectorId("MD_SAL|openflow:5:2"));
+ Assert.assertEquals("MD_SAL|openflow:5", observed.getValue());
+ }
+
}
@Path("/config/{identifier:.+}")
@Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public StructuredData readConfigurationData(@Encoded @PathParam("identifier") String identifier);
+ public StructuredData readConfigurationData(@Encoded @PathParam("identifier") String identifier,
+ @Context UriInfo depth);
@GET
@Path("/operational/{identifier:.+}")
@Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public StructuredData readOperationalData(@Encoded @PathParam("identifier") String identifier);
+ public StructuredData readOperationalData(@Encoded @PathParam("identifier") String identifier,
+ @Context UriInfo depth);
@PUT
@Path("/config/{identifier:.+}")
import org.opendaylight.yangtools.yang.data.api.MutableCompositeNode;
import org.opendaylight.yangtools.yang.data.api.Node;
import org.opendaylight.yangtools.yang.data.api.SimpleNode;
+import org.opendaylight.yangtools.yang.data.impl.ImmutableCompositeNode;
import org.opendaylight.yangtools.yang.data.impl.NodeFactory;
import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
}
@Override
- public StructuredData readConfigurationData(final String identifier) {
+ public StructuredData readConfigurationData(final String identifier, UriInfo info) {
final InstanceIdWithSchemaNode iiWithData = this.controllerContext.toInstanceIdentifier(identifier);
CompositeNode data = null;
MountInstance mountPoint = iiWithData.getMountPoint();
data = broker.readConfigurationData(iiWithData.getInstanceIdentifier());
}
+ data = pruneDataAtDepth( data, parseDepthParameter( info ) );
return new StructuredData(data, iiWithData.getSchemaNode(), iiWithData.getMountPoint());
}
+ @SuppressWarnings("unchecked")
+ private <T extends Node<?>> T pruneDataAtDepth( T node, Integer depth ) {
+ if( depth == null ) {
+ return node;
+ }
+
+ if( node instanceof CompositeNode ) {
+ ImmutableList.Builder<Node<?>> newChildNodes = ImmutableList.<Node<?>> builder();
+ if( depth > 1 ) {
+ for( Node<?> childNode: ((CompositeNode)node).getValue() ) {
+ newChildNodes.add( pruneDataAtDepth( childNode, depth - 1 ) );
+ }
+ }
+
+ return (T) ImmutableCompositeNode.create( node.getNodeType(), newChildNodes.build() );
+ }
+ else { // SimpleNode
+ return node;
+ }
+ }
+
+ private Integer parseDepthParameter( UriInfo info ) {
+ String param = info.getQueryParameters( false ).getFirst( "depth" );
+ if( Strings.isNullOrEmpty( param ) || "unbounded".equals( param ) ) {
+ return null;
+ }
+
+ try {
+ Integer depth = Integer.valueOf( param );
+ if( depth < 1 ) {
+ throw new RestconfDocumentedException( new RestconfError(
+ ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE, "Invalid depth parameter: " + depth,
+ null, "The depth parameter must be an integer > 1 or \"unbounded\"" ) );
+ }
+
+ return depth;
+ }
+ catch( NumberFormatException e ) {
+ throw new RestconfDocumentedException( new RestconfError(
+ ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
+ "Invalid depth parameter: " + e.getMessage(),
+ null, "The depth parameter must be an integer > 1 or \"unbounded\"" ) );
+ }
+ }
+
@Override
- public StructuredData readOperationalData(final String identifier) {
+ public StructuredData readOperationalData(final String identifier, UriInfo info) {
final InstanceIdWithSchemaNode iiWithData = this.controllerContext.toInstanceIdentifier(identifier);
CompositeNode data = null;
MountInstance mountPoint = iiWithData.getMountPoint();
data = broker.readOperationalData(iiWithData.getInstanceIdentifier());
}
+ data = pruneDataAtDepth( data, parseDepthParameter( info ) );
return new StructuredData(data, iiWithData.getSchemaNode(), mountPoint);
}
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.UriInfo;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.JerseyTest;
String uriPrefix = "/config/";
String uriPath = "ietf-interfaces:interfaces";
String uri = uriPrefix + uriPath;
- when(restconfService.readConfigurationData(uriPath)).thenReturn(null);
+ when(restconfService.readConfigurationData(eq(uriPath), any(UriInfo.class))).thenReturn(null);
get(uri, Draft02.MediaTypes.DATA+JSON);
- verify(restconfService, times(1)).readConfigurationData(uriPath);
+ verify(restconfService, times(1)).readConfigurationData(eq(uriPath), any(UriInfo.class));
get(uri, Draft02.MediaTypes.DATA+XML);
- verify(restconfService, times(2)).readConfigurationData(uriPath);
+ verify(restconfService, times(2)).readConfigurationData(eq(uriPath), any(UriInfo.class));
get(uri, MediaType.APPLICATION_JSON);
- verify(restconfService, times(3)).readConfigurationData(uriPath);
+ verify(restconfService, times(3)).readConfigurationData(eq(uriPath), any(UriInfo.class));
get(uri, MediaType.APPLICATION_XML);
- verify(restconfService, times(4)).readConfigurationData(uriPath);
+ verify(restconfService, times(4)).readConfigurationData(eq(uriPath), any(UriInfo.class));
get(uri, MediaType.TEXT_XML);
- verify(restconfService, times(5)).readConfigurationData(uriPath);
+ verify(restconfService, times(5)).readConfigurationData(eq(uriPath), any(UriInfo.class));
// negative tests
get(uri, MediaType.TEXT_PLAIN);
- verify(restconfService, times(5)).readConfigurationData(uriPath);
+ verify(restconfService, times(5)).readConfigurationData(eq(uriPath), any(UriInfo.class));
}
@Test
String uriPrefix = "/operational/";
String uriPath = "ietf-interfaces:interfaces";
String uri = uriPrefix + uriPath;
- when(restconfService.readOperationalData(uriPath)).thenReturn(null);
+ when(restconfService.readOperationalData(eq(uriPath), any(UriInfo.class))).thenReturn(null);
get(uri, Draft02.MediaTypes.DATA+JSON);
- verify(restconfService, times(1)).readOperationalData(uriPath);
+ verify(restconfService, times(1)).readOperationalData(eq(uriPath), any(UriInfo.class));
get(uri, Draft02.MediaTypes.DATA+XML);
- verify(restconfService, times(2)).readOperationalData(uriPath);
+ verify(restconfService, times(2)).readOperationalData(eq(uriPath), any(UriInfo.class));
get(uri, MediaType.APPLICATION_JSON);
- verify(restconfService, times(3)).readOperationalData(uriPath);
+ verify(restconfService, times(3)).readOperationalData(eq(uriPath), any(UriInfo.class));
get(uri, MediaType.APPLICATION_XML);
- verify(restconfService, times(4)).readOperationalData(uriPath);
+ verify(restconfService, times(4)).readOperationalData(eq(uriPath), any(UriInfo.class));
get(uri, MediaType.TEXT_XML);
- verify(restconfService, times(5)).readOperationalData(uriPath);
+ verify(restconfService, times(5)).readOperationalData(eq(uriPath), any(UriInfo.class));
// negative tests
get(uri, MediaType.TEXT_PLAIN);
- verify(restconfService, times(5)).readOperationalData(uriPath);
+ verify(restconfService, times(5)).readOperationalData(eq(uriPath), any(UriInfo.class));
}
@Test
*/
package org.opendaylight.controller.sal.restconf.impl.test;
-import static junit.framework.Assert.assertNotNull;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.io.FileNotFoundException;
+import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedHashMap;
+import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.JerseyTest;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
import org.opendaylight.controller.sal.core.api.mount.MountInstance;
import org.opendaylight.controller.sal.core.api.mount.MountService;
import org.opendaylight.controller.sal.rest.impl.JsonToCompositeNodeProvider;
import org.opendaylight.controller.sal.restconf.impl.BrokerFacade;
import org.opendaylight.controller.sal.restconf.impl.CompositeNodeWrapper;
import org.opendaylight.controller.sal.restconf.impl.ControllerContext;
+import org.opendaylight.controller.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.controller.sal.restconf.impl.RestconfImpl;
import org.opendaylight.controller.sal.restconf.impl.SimpleNodeWrapper;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.data.api.Node;
+import org.opendaylight.yangtools.yang.data.impl.ImmutableCompositeNode;
+import org.opendaylight.yangtools.yang.data.impl.util.CompositeNodeBuilder;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
public class RestGetOperationTest extends JerseyTest {
+ static class NodeData {
+ Object key;
+ Object data; // List for a CompositeNode, value Object for a SimpleNode
+
+ NodeData( Object key, Object data ) {
+ this.key = key;
+ this.data = data;
+ }
+ }
+
private static BrokerFacade brokerFacade;
private static RestconfImpl restconfImpl;
private static SchemaContext schemaContextYangsIetf;
return null;
}
+ @Test
+ public void getDataWithUriDepthParameterTest() throws UnsupportedEncodingException {
+
+ ControllerContext.getInstance().setGlobalSchema( schemaContextModules );
+
+ CompositeNode depth1Cont = toCompositeNode(
+ toCompositeNodeData( toNestedQName( "depth1-cont" ),
+ toCompositeNodeData( toNestedQName( "depth2-cont1" ),
+ toCompositeNodeData( toNestedQName( "depth3-cont1" ),
+ toCompositeNodeData( toNestedQName( "depth4-cont1" ),
+ toSimpleNodeData( toNestedQName( "depth5-leaf1" ), "depth5-leaf1-value" )
+ ),
+ toSimpleNodeData( toNestedQName( "depth4-leaf1" ), "depth4-leaf1-value" )
+ ),
+ toSimpleNodeData( toNestedQName( "depth3-leaf1" ), "depth3-leaf1-value" )
+ ),
+ toCompositeNodeData( toNestedQName( "depth2-cont2" ),
+ toCompositeNodeData( toNestedQName( "depth3-cont2" ),
+ toCompositeNodeData( toNestedQName( "depth4-cont2" ),
+ toSimpleNodeData( toNestedQName( "depth5-leaf2" ), "depth5-leaf2-value" )
+ ),
+ toSimpleNodeData( toNestedQName( "depth4-leaf2" ), "depth4-leaf2-value" )
+ ),
+ toSimpleNodeData( toNestedQName( "depth3-leaf2" ), "depth3-leaf2-value" )
+ ),
+ toSimpleNodeData( toNestedQName( "depth2-leaf1" ), "depth2-leaf1-value" )
+ ) );
+
+ when( brokerFacade.readConfigurationData( any( InstanceIdentifier.class ) ) )
+ .thenReturn( depth1Cont );
+
+ // Test config with depth 1
+
+ Response response = target( "/config/nested-module:depth1-cont" ).queryParam( "depth", "1" )
+ .request( "application/xml" ).get();
+
+ verifyXMLResponse( response, expectEmptyContainer( "depth1-cont" ) );
+
+ // Test config with depth 2
+
+ response = target( "/config/nested-module:depth1-cont" ).queryParam( "depth", "2" )
+ .request( "application/xml" ).get();
+
+// String xml="<depth1-cont><depth2-cont1/><depth2-cont2/><depth2-leaf1>depth2-leaf1-value</depth2-leaf1></depth1-cont>";
+// Response mr=mock(Response.class);
+// when(mr.getEntity()).thenReturn( new java.io.StringBufferInputStream(xml) );
+
+ verifyXMLResponse( response,
+ expectContainer( "depth1-cont",
+ expectEmptyContainer( "depth2-cont1" ),
+ expectEmptyContainer( "depth2-cont2" ),
+ expectLeaf( "depth2-leaf1", "depth2-leaf1-value" )
+ ) );
+
+ // Test config with depth 3
+
+ response = target( "/config/nested-module:depth1-cont" ).queryParam( "depth", "3" )
+ .request( "application/xml" ).get();
+
+ verifyXMLResponse( response,
+ expectContainer( "depth1-cont",
+ expectContainer( "depth2-cont1",
+ expectEmptyContainer( "depth3-cont1" ),
+ expectLeaf( "depth3-leaf1", "depth3-leaf1-value" )
+ ),
+ expectContainer( "depth2-cont2",
+ expectEmptyContainer( "depth3-cont2" ),
+ expectLeaf( "depth3-leaf2", "depth3-leaf2-value" )
+ ),
+ expectLeaf( "depth2-leaf1", "depth2-leaf1-value" )
+ ) );
+
+ // Test config with depth 4
+
+ response = target( "/config/nested-module:depth1-cont" ).queryParam( "depth", "4" )
+ .request( "application/xml" ).get();
+
+ verifyXMLResponse( response,
+ expectContainer( "depth1-cont",
+ expectContainer( "depth2-cont1",
+ expectContainer( "depth3-cont1",
+ expectEmptyContainer( "depth4-cont1" ),
+ expectLeaf( "depth4-leaf1", "depth4-leaf1-value" )
+ ),
+ expectLeaf( "depth3-leaf1", "depth3-leaf1-value" )
+ ),
+ expectContainer( "depth2-cont2",
+ expectContainer( "depth3-cont2",
+ expectEmptyContainer( "depth4-cont2" ),
+ expectLeaf( "depth4-leaf2", "depth4-leaf2-value" )
+ ),
+ expectLeaf( "depth3-leaf2", "depth3-leaf2-value" )
+ ),
+ expectLeaf( "depth2-leaf1", "depth2-leaf1-value" )
+ ) );
+
+ // Test config with depth 5
+
+ response = target( "/config/nested-module:depth1-cont" ).queryParam( "depth", "5" )
+ .request( "application/xml" ).get();
+
+ verifyXMLResponse( response,
+ expectContainer( "depth1-cont",
+ expectContainer( "depth2-cont1",
+ expectContainer( "depth3-cont1",
+ expectContainer( "depth4-cont1",
+ expectLeaf( "depth5-leaf1", "depth5-leaf1-value" )
+ ),
+ expectLeaf( "depth4-leaf1", "depth4-leaf1-value" )
+ ),
+ expectLeaf( "depth3-leaf1", "depth3-leaf1-value" )
+ ),
+ expectContainer( "depth2-cont2",
+ expectContainer( "depth3-cont2",
+ expectContainer( "depth4-cont2",
+ expectLeaf( "depth5-leaf2", "depth5-leaf2-value" )
+ ),
+ expectLeaf( "depth4-leaf2", "depth4-leaf2-value" )
+ ),
+ expectLeaf( "depth3-leaf2", "depth3-leaf2-value" )
+ ),
+ expectLeaf( "depth2-leaf1", "depth2-leaf1-value" )
+ ) );
+
+ // Test config with depth unbounded
+
+ response = target( "/config/nested-module:depth1-cont" ).queryParam( "depth", "unbounded" )
+ .request( "application/xml" ).get();
+
+ verifyXMLResponse( response,
+ expectContainer( "depth1-cont",
+ expectContainer( "depth2-cont1",
+ expectContainer( "depth3-cont1",
+ expectContainer( "depth4-cont1",
+ expectLeaf( "depth5-leaf1", "depth5-leaf1-value" )
+ ),
+ expectLeaf( "depth4-leaf1", "depth4-leaf1-value" )
+ ),
+ expectLeaf( "depth3-leaf1", "depth3-leaf1-value" )
+ ),
+ expectContainer( "depth2-cont2",
+ expectContainer( "depth3-cont2",
+ expectContainer( "depth4-cont2",
+ expectLeaf( "depth5-leaf2", "depth5-leaf2-value" )
+ ),
+ expectLeaf( "depth4-leaf2", "depth4-leaf2-value" )
+ ),
+ expectLeaf( "depth3-leaf2", "depth3-leaf2-value" )
+ ),
+ expectLeaf( "depth2-leaf1", "depth2-leaf1-value" )
+ ) );
+
+ // Test operational
+
+ CompositeNode depth2Cont1 = toCompositeNode(
+ toCompositeNodeData( toNestedQName( "depth2-cont1" ),
+ toCompositeNodeData( toNestedQName( "depth3-cont1" ),
+ toCompositeNodeData( toNestedQName( "depth4-cont1" ),
+ toSimpleNodeData( toNestedQName( "depth5-leaf1" ), "depth5-leaf1-value" )
+ ),
+ toSimpleNodeData( toNestedQName( "depth4-leaf1" ), "depth4-leaf1-value" )
+ ),
+ toSimpleNodeData( toNestedQName( "depth3-leaf1" ), "depth3-leaf1-value" )
+ ) );
+
+ when( brokerFacade.readOperationalData( any( InstanceIdentifier.class ) ) )
+ .thenReturn( depth2Cont1 );
+
+ response = target( "/operational/nested-module:depth1-cont/depth2-cont1" )
+ .queryParam( "depth", "3" ).request( "application/xml" ).get();
+
+ verifyXMLResponse( response,
+ expectContainer( "depth2-cont1",
+ expectContainer( "depth3-cont1",
+ expectEmptyContainer( "depth4-cont1" ),
+ expectLeaf( "depth4-leaf1", "depth4-leaf1-value" )
+ ),
+ expectLeaf( "depth3-leaf1", "depth3-leaf1-value" )
+ ) );
+ }
+
+ @Test
+ public void getDataWithInvalidDepthParameterTest() {
+
+ ControllerContext.getInstance().setGlobalSchema( schemaContextModules );
+
+ final MultivaluedMap<String,String> paramMap = new MultivaluedHashMap<>();
+ paramMap.putSingle( "depth", "1o" );
+ UriInfo mockInfo = mock( UriInfo.class );
+ when( mockInfo.getQueryParameters( false ) ).thenAnswer(
+ new Answer<MultivaluedMap<String,String>>() {
+ @Override
+ public MultivaluedMap<String, String> answer( InvocationOnMock invocation ) {
+ return paramMap;
+ }
+ } );
+
+ getDataWithInvalidDepthParameterTest( mockInfo );
+
+ paramMap.putSingle( "depth", "0" );
+ getDataWithInvalidDepthParameterTest( mockInfo );
+
+ paramMap.putSingle( "depth", "-1" );
+ getDataWithInvalidDepthParameterTest( mockInfo );
+ }
+
+ private void getDataWithInvalidDepthParameterTest( UriInfo uriInfo ) {
+ try {
+ restconfImpl.readConfigurationData( "nested-module:depth1-cont", uriInfo );
+ fail( "Expected RestconfDocumentedException" );
+ }
+ catch( RestconfDocumentedException e ) {
+ assertTrue( "Unexpected error message: " + e.getErrors().get( 0 ).getErrorMessage(),
+ e.getErrors().get( 0 ).getErrorMessage().contains( "depth" ) );
+ }
+ }
+
+ private void verifyXMLResponse( Response response, NodeData nodeData ) {
+
+ Document doc = TestUtils.loadDocumentFrom( (InputStream) response.getEntity() );
+ assertNotNull( "Could not parse XML document", doc );
+
+ //System.out.println(TestUtils.getDocumentInPrintableForm( doc ));
+
+ verifyContainerElement( doc.getDocumentElement(), nodeData );
+ }
+
+ @SuppressWarnings("unchecked")
+ private void verifyContainerElement( Element element, NodeData nodeData ) {
+
+ assertEquals( "Element local name", nodeData.key, element.getNodeName() );
+
+ NodeList childNodes = element.getChildNodes();
+ if( nodeData.data == null ) { // empty container
+ assertTrue( "Expected no child elements for \"" + element.getNodeName() + "\"",
+ childNodes.getLength() == 0 );
+ return;
+ }
+
+ Map<String,NodeData> expChildMap = Maps.newHashMap();
+ for( NodeData expChild: (List<NodeData>)nodeData.data ) {
+ expChildMap.put( expChild.key.toString(), expChild );
+ }
+
+ for( int i = 0; i < childNodes.getLength(); i++ ) {
+ org.w3c.dom.Node actualChild = childNodes.item( i );
+ if( !( actualChild instanceof Element ) ) {
+ continue;
+ }
+
+ Element actualElement = (Element)actualChild;
+ NodeData expChild = expChildMap.remove( actualElement.getNodeName() );
+ assertNotNull( "Unexpected child element for parent \"" + element.getNodeName() +
+ "\": " + actualElement.getNodeName(), expChild );
+
+ if( expChild.data == null || expChild.data instanceof List ) {
+ verifyContainerElement( actualElement, expChild );
+ }
+ else {
+ assertEquals( "Text content for element: " + actualElement.getNodeName(),
+ expChild.data, actualElement.getTextContent() );
+ }
+ }
+
+ if( !expChildMap.isEmpty() ) {
+ fail( "Missing elements for parent \"" + element.getNodeName() +
+ "\": " + expChildMap.keySet() );
+ }
+ }
+
+ private NodeData expectContainer( String name, NodeData... childData ) {
+ return new NodeData( name, Lists.newArrayList( childData ) );
+ }
+
+ private NodeData expectEmptyContainer( String name ) {
+ return new NodeData( name, null );
+ }
+
+ private NodeData expectLeaf( String name, Object value ) {
+ return new NodeData( name, value );
+ }
+
+ private QName toNestedQName( String localName ) {
+ return QName.create( "urn:nested:module", "2014-06-3", localName );
+ }
+
+ @SuppressWarnings("unchecked")
+ private CompositeNode toCompositeNode( NodeData nodeData ) {
+ CompositeNodeBuilder<ImmutableCompositeNode> builder = ImmutableCompositeNode.builder();
+ builder.setQName( (QName) nodeData.key );
+
+ for( NodeData child: (List<NodeData>)nodeData.data ) {
+ if( child.data instanceof List ) {
+ builder.add( toCompositeNode( child ) );
+ }
+ else {
+ builder.addLeaf( (QName) child.key, child.data );
+ }
+ }
+
+ return builder.toInstance();
+ }
+
+ private NodeData toCompositeNodeData( QName key, NodeData... childData ) {
+ return new NodeData( key, Lists.newArrayList( childData ) );
+ }
+
+ private NodeData toSimpleNodeData( QName key, Object value ) {
+ return new NodeData( key, value );
+ }
}
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
+import javax.ws.rs.core.UriInfo;
import javax.xml.namespace.NamespaceContext;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
void stageMockEx( final RestconfDocumentedException ex ) {
reset( mockRestConf );
- when( mockRestConf.readOperationalData( any( String.class ) ) ).thenThrow( ex );
+ when( mockRestConf.readOperationalData( any( String.class ), any( UriInfo.class ) ) ).thenThrow( ex );
}
void testJsonResponse( final RestconfDocumentedException ex, final Status expStatus, final ErrorType expErrorType,
// The StructuredDataToJsonProvider should throw a RestconfDocumentedException with no data
- when( mockRestConf.readOperationalData( any( String.class ) ) )
- .thenReturn( new StructuredData( null, null, null ) );
+ when( mockRestConf.readOperationalData( any( String.class ), any( UriInfo.class ) ) )
+ .thenReturn( new StructuredData( null, null, null ) );
Response resp = target("/operational/foo").request( MediaType.APPLICATION_JSON ).get();
--- /dev/null
+module nested-module {
+ namespace "urn:nested:module";
+ prefix "nested";
+ revision "2014-06-3";
+
+ container depth1-cont {
+ container depth2-cont1 {
+ container depth3-cont1 {
+ container depth4-cont1 {
+ leaf depth5-leaf1 {
+ type string;
+ }
+ }
+
+ leaf depth4-leaf1 {
+ type string;
+ }
+ }
+
+ leaf depth3-leaf1 {
+ type string;
+ }
+ }
+
+ container depth2-cont2 {
+ container depth3-cont2 {
+ container depth4-cont2 {
+ leaf depth5-leaf2 {
+ type string;
+ }
+ }
+
+ leaf depth4-leaf2 {
+ type string;
+ }
+ }
+
+ leaf depth3-leaf2 {
+ type string;
+ }
+ }
+
+ leaf depth2-leaf1 {
+ type string;
+ }
+ }
+}
\ No newline at end of file
xml.checkName(XmlNetconfConstants.GET);
xml.checkNamespace(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
- // Filter option - unsupported
- if (xml.getChildElements(XmlNetconfConstants.FILTER).size() != 0){
- throw new UnsupportedOperationException("Unsupported option " + XmlNetconfConstants.FILTER + " for " + XmlNetconfConstants.GET);
- }
+ // Filter option: ignore for now, TODO only load modules specified by the filter
}
@Override
package org.opendaylight.controller.netconf.confignetconfconnector.operations.getconfig;
import com.google.common.base.Optional;
+import java.util.Set;
+import javax.management.ObjectName;
import org.opendaylight.controller.config.util.ConfigRegistryClient;
import org.opendaylight.controller.config.util.ConfigTransactionClient;
import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import javax.management.ObjectName;
-import java.util.Set;
-
public class GetConfig extends AbstractConfigNetconfOperation {
public static final String GET_CONFIG = "get-config";
logger.debug("Setting source datastore to '{}'", sourceParsed);
Datastore sourceDatastore = Datastore.valueOf(sourceParsed);
- // Filter option - unsupported
- if (xml.getChildElements(XmlNetconfConstants.FILTER).size() != 0){
- throw new UnsupportedOperationException("Unsupported option " + XmlNetconfConstants.FILTER + " for "
- + GET_CONFIG);
- }
+ // Filter option: ignore for now, TODO only load modules specified by the filter
return sourceDatastore;
import com.google.common.collect.ImmutableMap;
import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
import org.opendaylight.controller.netconf.api.NetconfMessage;
-import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
import org.opendaylight.controller.netconf.api.NetconfSessionListener;
import org.opendaylight.controller.netconf.api.NetconfTerminationReason;
import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultCloseSession;
+import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService;
import org.opendaylight.controller.netconf.util.messages.SendErrorExceptionUtil;
import org.opendaylight.controller.netconf.util.xml.XmlElement;
session.onIncommingRpcFail();
throw new IllegalStateException("Unable to process incoming message " + netconfMessage, e);
} catch (NetconfDocumentedException e) {
- logger.trace("Error occured while processing mesage {}",e);
+ logger.trace("Error occurred while processing message",e);
session.onOutgoingRpcError();
session.onIncommingRpcFail();
SendErrorExceptionUtil.sendErrorMessage(session, e, netconfMessage);
logger.info("Session {} closed successfully", session.getSessionId());
}
+
+
private NetconfMessage processDocument(final NetconfMessage netconfMessage, NetconfServerSession session)
throws NetconfDocumentedException {
Document rpcReply = operationRouter.onNetconfMessage(incomingDocument, session);
+ rpcReply = SubtreeFilter.applySubtreeFilter(incomingDocument, rpcReply);
+
session.onIncommingRpcSuccess();
responseDocument.appendChild(responseDocument.importNode(rpcReply.getDocumentElement(), true));
--- /dev/null
+/*
+ * 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.netconf.impl;
+
+import com.google.common.base.Optional;
+import java.io.IOException;
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
+import org.opendaylight.controller.netconf.util.mapping.AbstractNetconfOperation.OperationNameAndNamespace;
+import org.opendaylight.controller.netconf.util.xml.XmlElement;
+import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants;
+import org.opendaylight.controller.netconf.util.xml.XmlUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+/**
+ * See <a href="http://tools.ietf.org/html/rfc6241#section-6">rfc6241</a> for details.
+ */
+public class SubtreeFilter {
+ private static final Logger logger = LoggerFactory.getLogger(SubtreeFilter.class);
+
+ static Document applySubtreeFilter(Document requestDocument, Document rpcReply) throws NetconfDocumentedException {
+ // FIXME: rpcReply document must be reread otherwise some nodes do not inherit namespaces. (services/service)
+ try {
+ rpcReply = XmlUtil.readXmlToDocument(XmlUtil.toString(rpcReply, true));
+ } catch (SAXException | IOException e) {
+ logger.error("Cannot transform document", e);
+ throw new NetconfDocumentedException("Cannot transform document");
+ }
+
+ OperationNameAndNamespace operationNameAndNamespace = new OperationNameAndNamespace(requestDocument);
+ if (XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0.equals(operationNameAndNamespace.getNamespace()) &&
+ XmlNetconfConstants.GET.equals(operationNameAndNamespace.getOperationName()) ||
+ XmlNetconfConstants.GET_CONFIG.equals(operationNameAndNamespace.getOperationName())) {
+ // process subtree filtering here, in case registered netconf operations do
+ // not implement filtering.
+ Optional<XmlElement> maybeFilter = operationNameAndNamespace.getOperationElement().getOnlyChildElementOptionally(
+ XmlNetconfConstants.FILTER, XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
+ if (maybeFilter.isPresent() && (
+ "subtree".equals(maybeFilter.get().getAttribute("type"))||
+ "subtree".equals(maybeFilter.get().getAttribute("type", XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0))
+ )) {
+
+
+ // do
+ return filtered(maybeFilter.get(), rpcReply);
+ }
+ }
+ return rpcReply; // return identical document
+ }
+
+ private static Document filtered(XmlElement filter, Document originalReplyDocument) throws NetconfDocumentedException {
+ Document result = XmlUtil.newDocument();
+ // even if filter is empty, copy /rpc/data
+ Element rpcReply = originalReplyDocument.getDocumentElement();
+ Node rpcReplyDst = result.importNode(rpcReply, false);
+ result.appendChild(rpcReplyDst);
+ XmlElement dataSrc = XmlElement.fromDomElement(rpcReply).getOnlyChildElement("data", XmlNetconfConstants.RFC4741_TARGET_NAMESPACE);
+ Element dataDst = (Element) result.importNode(dataSrc.getDomElement(), false);
+ rpcReplyDst.appendChild(dataDst);
+ addSubtree(filter, dataSrc, XmlElement.fromDomElement(dataDst));
+
+ return result;
+ }
+
+ private static void addSubtree(XmlElement filter, XmlElement src, XmlElement dst) {
+ for (XmlElement srcChild : src.getChildElements()) {
+ for (XmlElement filterChild : filter.getChildElements()) {
+ addSubtree2(filterChild, srcChild, dst);
+ }
+ }
+ }
+
+ private static MatchingResult addSubtree2(XmlElement filter, XmlElement src, XmlElement dstParent) {
+ Document document = dstParent.getDomElement().getOwnerDocument();
+ MatchingResult matches = matches(src, filter);
+ if (matches != MatchingResult.NO_MATCH && matches != MatchingResult.CONTENT_MISMATCH) {
+ // copy srcChild to dst
+ boolean filterHasChildren = filter.getChildElements().isEmpty() == false;
+ // copy to depth if this is leaf of filter tree
+ Element copied = (Element) document.importNode(src.getDomElement(), filterHasChildren == false);
+ boolean shouldAppend = filterHasChildren == false;
+ if (filterHasChildren) { // this implies TAG_MATCH
+ // do the same recursively
+ int numberOfTextMatchingChildren = 0;
+ for (XmlElement srcChild : src.getChildElements()) {
+ for (XmlElement filterChild : filter.getChildElements()) {
+ MatchingResult childMatch = addSubtree2(filterChild, srcChild, XmlElement.fromDomElement(copied));
+ if (childMatch == MatchingResult.CONTENT_MISMATCH) {
+ return MatchingResult.NO_MATCH;
+ }
+ if (childMatch == MatchingResult.CONTENT_MATCH) {
+ numberOfTextMatchingChildren++;
+ }
+ shouldAppend |= childMatch != MatchingResult.NO_MATCH;
+ }
+ }
+ // if only text matching child filters are specified..
+ if (numberOfTextMatchingChildren == filter.getChildElements().size()) {
+ // force all children to be added (to depth). This is done by copying parent node to depth.
+ // implies shouldAppend == true
+ copied = (Element) document.importNode(src.getDomElement(), true);
+ }
+ }
+ if (shouldAppend) {
+ dstParent.getDomElement().appendChild(copied);
+ }
+ }
+ return matches;
+ }
+
+ /**
+ * Shallow compare src node to filter: tag name and namespace must match.
+ * If filter node has no children and has text content, it also must match.
+ */
+ private static MatchingResult matches(XmlElement src, XmlElement filter) {
+ boolean tagMatch = src.getName().equals(filter.getName()) &&
+ src.getNamespaceOptionally().equals(filter.getNamespaceOptionally());
+ MatchingResult result = null;
+ if (tagMatch) {
+ // match text content
+ Optional<String> maybeText = filter.getOnlyTextContentOptionally();
+ if (maybeText.isPresent()) {
+ if (maybeText.equals(src.getOnlyTextContentOptionally())) {
+ result = MatchingResult.CONTENT_MATCH;
+ } else {
+ result = MatchingResult.CONTENT_MISMATCH;
+ }
+ }
+ // match attributes, combination of content and tag is not supported
+ if (result == null) {
+ for (Attr attr : filter.getAttributes().values()) {
+ // ignore namespace declarations
+ if (XmlUtil.XMLNS_URI.equals(attr.getNamespaceURI()) == false ) {
+ // find attr with matching localName(), namespaceURI(), == value() in src
+ String found = src.getAttribute(attr.getLocalName(), attr.getNamespaceURI());
+ if (attr.getValue().equals(found) && result != MatchingResult.NO_MATCH) {
+ result = MatchingResult.TAG_MATCH;
+ } else {
+ result = MatchingResult.NO_MATCH;
+ }
+ }
+ }
+ }
+ if (result == null) {
+ result = MatchingResult.TAG_MATCH;
+ }
+ }
+ if (result == null) {
+ result = MatchingResult.NO_MATCH;
+ }
+ logger.debug("Matching {} to {} resulted in {}", src, filter, tagMatch);
+ return result;
+ }
+
+ enum MatchingResult {
+ NO_MATCH, TAG_MATCH, CONTENT_MATCH, CONTENT_MISMATCH
+ }
+}
--- /dev/null
+/*
+ * 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.netconf.impl;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.XMLUnit;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+import org.opendaylight.controller.netconf.util.xml.XmlUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+@RunWith(value = Parameterized.class)
+public class SubtreeFilterTest {
+ private static final Logger logger = LoggerFactory.getLogger(SubtreeFilterTest.class);
+
+ private final int directoryIndex;
+
+ @Parameters
+ public static Collection<Object[]> data() {
+ List<Object[]> result = new ArrayList<>();
+ for (int i = 0; i <= 8; i++) {
+ result.add(new Object[]{i});
+ }
+ return result;
+ }
+
+ public SubtreeFilterTest(int directoryIndex) {
+ this.directoryIndex = directoryIndex;
+ }
+
+ @Before
+ public void setUp(){
+ XMLUnit.setIgnoreWhitespace(true);
+ }
+
+ @Test
+ public void test() throws Exception {
+ Document requestDocument = getDocument("request.xml");
+ Document preFilterDocument = getDocument("pre-filter.xml");
+ Document postFilterDocument = getDocument("post-filter.xml");
+ Document actualPostFilterDocument = SubtreeFilter.applySubtreeFilter(requestDocument, preFilterDocument);
+ logger.info("Actual document: {}", XmlUtil.toString(actualPostFilterDocument));
+ Diff diff = XMLUnit.compareXML(postFilterDocument, actualPostFilterDocument);
+ assertTrue(diff.toString(), diff.similar());
+
+ }
+
+ public Document getDocument(String fileName) throws SAXException, IOException {
+ return XmlUtil.readXmlToDocument(getClass().getResourceAsStream("/subtree/" + directoryIndex + "/" +
+ fileName));
+ }
+}
--- /dev/null
+<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-2">
+ <data>
+ <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+ prefix:toaster-provider-impl
+ </type>
+ <name>toaster-provider-impl</name>
+ <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+ prefix:binding-notification-service
+ </type>
+ <name>binding-notification-broker</name>
+ </notification-service>
+ <rpc-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+ prefix:binding-rpc-registry
+ </type>
+ <name>binding-rpc-broker</name>
+ </rpc-registry>
+ <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+ prefix:binding-data-broker
+ </type>
+ <name>binding-data-broker</name>
+ </data-broker>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+ prefix:sal-netconf-connector
+ </type>
+ <name>controller-config</name>
+ <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1830</port>
+ <connection-timeout-millis xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+ 20000
+ </connection-timeout-millis>
+ <between-attempts-timeout-millis
+ xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">2000
+ </between-attempts-timeout-millis>
+ <sleep-factor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1.5</sleep-factor>
+ <password xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</password>
+ <dom-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">
+ prefix:dom-broker-osgi-registry
+ </type>
+ <name>dom-broker</name>
+ </dom-registry>
+ <client-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">
+ prefix:netconf-client-dispatcher
+ </type>
+ <name>global-netconf-dispatcher</name>
+ </client-dispatcher>
+ <username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</username>
+ <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">127.0.0.1</address>
+ <processing-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+ <name>global-netconf-processing-executor</name>
+ </processing-executor>
+ <tcp-only xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">false</tcp-only>
+ <binding-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+ prefix:binding-broker-osgi-registry
+ </type>
+ <name>binding-osgi-broker</name>
+ </binding-registry>
+ <max-connection-attempts xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">0
+ </max-connection-attempts>
+ <event-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+ <name>global-event-executor</name>
+ </event-executor>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
+ prefix:netconf-client-dispatcher
+ </type>
+ <name>global-netconf-dispatcher</name>
+ <worker-thread-group xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+ <name>global-worker-group</name>
+ </worker-thread-group>
+ <timer xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
+ <name>global-timer</name>
+ </timer>
+ <boss-thread-group xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+ <name>global-boss-group</name>
+ </boss-thread-group>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:logback:config">prefix:logback</type>
+ <name>singleton</name>
+ <console-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <threshold-filter>ERROR</threshold-filter>
+ <name>STDOUT</name>
+ <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</encoder-pattern>
+ </console-appenders>
+ <file-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <append>true</append>
+ <file-name>logs/audit.log</file-name>
+ <name>audit-file</name>
+ <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} %msg %n</encoder-pattern>
+ </file-appenders>
+ <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <level>WARN</level>
+ <logger-name>org.opendaylight.controller.logging.bridge</logger-name>
+ </loggers>
+ <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <level>INFO</level>
+ <logger-name>audit</logger-name>
+ <appenders>audit-file</appenders>
+ </loggers>
+ <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <level>ERROR</level>
+ <logger-name>ROOT</logger-name>
+ <appenders>STDOUT</appenders>
+ <appenders>opendaylight.log</appenders>
+ </loggers>
+ <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <level>INFO</level>
+ <logger-name>org.opendaylight</logger-name>
+ </loggers>
+ <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <level>INFO</level>
+ <logger-name>org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort</logger-name>
+ <appenders>opendaylight.log</appenders>
+ </loggers>
+ <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <level>TRACE</level>
+ <logger-name>org.opendaylight.controller.netconf</logger-name>
+ </loggers>
+ <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <level>WARN</level>
+ <logger-name>io.netty</logger-name>
+ </loggers>
+ <rolling-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <append>true</append>
+ <max-file-size>10MB</max-file-size>
+ <file-name>logs/opendaylight.log</file-name>
+ <name>opendaylight.log</name>
+ <file-name-pattern>logs/opendaylight.%d.log.zip</file-name-pattern>
+ <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{35} - %msg%n</encoder-pattern>
+ <clean-history-on-start>false</clean-history-on-start>
+ <max-history>1</max-history>
+ <rolling-policy-type>TimeBasedRollingPolicy</rolling-policy-type>
+ </rolling-appenders>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:shutdown:impl">prefix:shutdown</type>
+ <name>shutdown</name>
+ <secret xmlns="urn:opendaylight:params:xml:ns:yang:controller:shutdown:impl"/>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:timer">
+ prefix:netty-hashed-wheel-timer
+ </type>
+ <name>global-timer</name>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup">
+ prefix:netty-threadgroup-fixed
+ </type>
+ <name>global-boss-group</name>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup">
+ prefix:netty-threadgroup-fixed
+ </type>
+ <name>global-worker-group</name>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+ prefix:schema-service-singleton
+ </type>
+ <name>yang-schema-service</name>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:dom-broker-impl
+ </type>
+ <name>inmemory-dom-broker</name>
+ <async-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker
+ </type>
+ <name>inmemory-data-broker</name>
+ </async-data-broker>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+ prefix:dom-inmemory-data-broker
+ </type>
+ <name>inmemory-data-broker</name>
+ <schema-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+ <name>yang-schema-service</name>
+ </schema-service>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">
+ prefix:threadpool-flexible
+ </type>
+ <name>global-netconf-processing-executor</name>
+ <threadFactory xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+ <name>global-netconf-processing-executor-threadfactory</name>
+ </threadFactory>
+ <minThreadCount xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">1
+ </minThreadCount>
+ <max-thread-count xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">4
+ </max-thread-count>
+ <keepAliveMillis xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">600000
+ </keepAliveMillis>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:eventexecutor">
+ prefix:netty-global-event-executor
+ </type>
+ <name>singleton</name>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ prefix:binding-broker-impl
+ </type>
+ <name>binding-broker-impl</name>
+ <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+ prefix:binding-notification-service
+ </type>
+ <name>binding-notification-broker</name>
+ </notification-service>
+ <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+ prefix:binding-data-broker
+ </type>
+ <name>binding-data-broker</name>
+ </data-broker>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ prefix:runtime-generated-mapping
+ </type>
+ <name>runtime-mapping-singleton</name>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ prefix:binding-notification-broker
+ </type>
+ <name>binding-notification-broker</name>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ prefix:binding-data-compatible-broker
+ </type>
+ <name>inmemory-binding-data-broker</name>
+ <dom-async-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">
+ prefix:dom-broker-osgi-registry
+ </type>
+ <name>dom-broker</name>
+ </dom-async-broker>
+ <binding-mapping-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ prefix:binding-dom-mapping-service
+ </type>
+ <name>runtime-mapping-singleton</name>
+ </binding-mapping-service>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl">
+ prefix:threadfactory-naming
+ </type>
+ <name>global-netconf-processing-executor-threadfactory</name>
+ <name-prefix xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl">
+ remote-connector-processing-executor
+ </name-prefix>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+ prefix:kitchen-service-impl
+ </type>
+ <name>kitchen-service-impl</name>
+ <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+ prefix:binding-notification-service
+ </type>
+ <name>binding-notification-broker</name>
+ </notification-service>
+ <rpc-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+ prefix:binding-rpc-registry
+ </type>
+ <name>binding-rpc-broker</name>
+ </rpc-registry>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">
+ prefix:remote-zeromq-rpc-server
+ </type>
+ <name>remoter</name>
+ <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">5666</port>
+ <dom-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">
+ prefix:dom-broker-osgi-registry
+ </type>
+ <name>dom-broker</name>
+ </dom-broker>
+ </module>
+ </modules>
+ <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+ <instance>
+ <name>yang-schema-service</name>
+ <provider>/modules/module[type='schema-service-singleton'][name='yang-schema-service']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry
+ </type>
+ <instance>
+ <name>dom-broker</name>
+ <provider>/modules/module[type='dom-broker-impl'][name='inmemory-dom-broker']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker
+ </type>
+ <instance>
+ <name>inmemory-data-broker</name>
+ <provider>/modules/module[type='dom-inmemory-data-broker'][name='inmemory-data-broker']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+ <instance>
+ <name>global-netconf-processing-executor</name>
+ <provider>/modules/module[type='threadpool-flexible'][name='global-netconf-processing-executor']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+ <instance>
+ <name>global-netconf-processing-executor-threadfactory</name>
+ <provider>
+ /modules/module[type='threadfactory-naming'][name='global-netconf-processing-executor-threadfactory']
+ </provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ prefix:binding-dom-mapping-service
+ </type>
+ <instance>
+ <name>runtime-mapping-singleton</name>
+ <provider>/modules/module[type='runtime-generated-mapping'][name='runtime-mapping-singleton']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
+ <instance>
+ <name>global-timer</name>
+ <provider>/modules/module[type='netty-hashed-wheel-timer'][name='global-timer']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+ <instance>
+ <name>global-boss-group</name>
+ <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-boss-group']</provider>
+ </instance>
+ <instance>
+ <name>global-worker-group</name>
+ <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-worker-group']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+ <instance>
+ <name>global-event-executor</name>
+ <provider>/modules/module[type='netty-global-event-executor'][name='singleton']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry
+ </type>
+ <instance>
+ <name>binding-rpc-broker</name>
+ <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+ prefix:binding-notification-service
+ </type>
+ <instance>
+ <name>binding-notification-broker</name>
+ <provider>/modules/module[type='binding-notification-broker'][name='binding-notification-broker']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+ prefix:binding-broker-osgi-registry
+ </type>
+ <instance>
+ <name>binding-osgi-broker</name>
+ <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker
+ </type>
+ <instance>
+ <name>binding-data-broker</name>
+ <provider>/modules/module[type='binding-data-compatible-broker'][name='inmemory-binding-data-broker']
+ </provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+ prefix:kitchen-service
+ </type>
+ <instance>
+ <name>kitchen-service</name>
+ <provider>/modules/module[type='kitchen-service-impl'][name='kitchen-service-impl']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">
+ prefix:netconf-client-dispatcher
+ </type>
+ <instance>
+ <name>global-netconf-dispatcher</name>
+ <provider>/modules/module[type='netconf-client-dispatcher'][name='global-netconf-dispatcher']</provider>
+ </instance>
+ </service>
+ </services>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<configuration scan="true">
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <root level="error">
+ <appender-ref ref="STDOUT" />
+ </root>
+ <logger name="org.opendaylight.controller.netconf" level="TRACE"/>
+</configuration>
--- /dev/null
+<!--
+ ~ 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
+ -->
+
+<rpc-reply message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>root</name>
+ <type>superuser</type>
+ <full-name>Charlie Root</full-name>
+ <company-info>
+ <dept>1</dept>
+ <id>1</id>
+ </company-info>
+ </user>
+ <user>
+ <name>fred</name>
+ <type>admin</type>
+ <full-name>Fred Flintstone</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>2</id>
+ </company-info>
+ </user>
+ <user>
+ <name>barney</name>
+ <type>admin</type>
+ <full-name>Barney Rubble</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>3</id>
+ </company-info>
+ </user>
+ </users>
+ <groups>
+ <group>
+ <name>admin</name>
+ </group>
+ </groups>
+ </top>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<rpc-reply message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>root</name>
+ <type>superuser</type>
+ <full-name>Charlie Root</full-name>
+ <company-info>
+ <dept>1</dept>
+ <id>1</id>
+ </company-info>
+ </user>
+ <user>
+ <name>fred</name>
+ <type>admin</type>
+ <full-name>Fred Flintstone</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>2</id>
+ </company-info>
+ </user>
+ <user>
+ <name>barney</name>
+ <type>admin</type>
+ <full-name>Barney Rubble</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>3</id>
+ </company-info>
+ </user>
+ </users>
+ <groups>
+ <group>
+ <name>admin</name>
+ </group>
+ </groups>
+ </top>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<rpc message-id="0"
+ xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <get>
+ </get>
+</rpc>
\ No newline at end of file
--- /dev/null
+<rpc-reply message-id="1"
+ xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ </data>
+</rpc-reply>
--- /dev/null
+<rpc-reply message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>root</name>
+ <type>superuser</type>
+ <full-name>Charlie Root</full-name>
+ <company-info>
+ <dept>1</dept>
+ <id>1</id>
+ </company-info>
+ </user>
+ <user>
+ <name>fred</name>
+ <type>admin</type>
+ <full-name>Fred Flintstone</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>2</id>
+ </company-info>
+ </user>
+ <user>
+ <name>barney</name>
+ <type>admin</type>
+ <full-name>Barney Rubble</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>3</id>
+ </company-info>
+ </user>
+ </users>
+ <groups>
+ <group>
+ <name>admin</name>
+ </group>
+ </groups>
+ </top>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<rpc message-id="1"
+ xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <get>
+ <filter type="subtree">
+ </filter>
+ </get>
+</rpc>
\ No newline at end of file
--- /dev/null
+<rpc-reply message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>root</name>
+ <type>superuser</type>
+ <full-name>Charlie Root</full-name>
+ <company-info>
+ <dept>1</dept>
+ <id>1</id>
+ </company-info>
+ </user>
+ <user>
+ <name>fred</name>
+ <type>admin</type>
+ <full-name>Fred Flintstone</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>2</id>
+ </company-info>
+ </user>
+ <user>
+ <name>barney</name>
+ <type>admin</type>
+ <full-name>Barney Rubble</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>3</id>
+ </company-info>
+ </user>
+ </users>
+ </top>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<!--
+ ~ 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
+ -->
+
+<rpc-reply message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>root</name>
+ <type>superuser</type>
+ <full-name>Charlie Root</full-name>
+ <company-info>
+ <dept>1</dept>
+ <id>1</id>
+ </company-info>
+ </user>
+ <user>
+ <name>fred</name>
+ <type>admin</type>
+ <full-name>Fred Flintstone</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>2</id>
+ </company-info>
+ </user>
+ <user>
+ <name>barney</name>
+ <type>admin</type>
+ <full-name>Barney Rubble</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>3</id>
+ </company-info>
+ </user>
+ </users>
+ <groups>
+ <group>
+ <name>admin</name>
+ </group>
+ </groups>
+ </top>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<rpc message-id="2"
+ xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <get-config>
+ <source>
+ <running/>
+ </source>
+ <filter type="subtree">
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users/>
+ </top>
+ </filter>
+ </get-config>
+</rpc>
--- /dev/null
+<!--
+ ~ 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
+ -->
+
+<rpc-reply message-id="3"
+ xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>root</name>
+ </user>
+ <user>
+ <name>fred</name>
+ </user>
+ <user>
+ <name>barney</name>
+ </user>
+ </users>
+ </top>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<!--
+ ~ 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
+ -->
+
+<rpc-reply message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>root</name>
+ <type>superuser</type>
+ <full-name>Charlie Root</full-name>
+ <company-info>
+ <dept>1</dept>
+ <id>1</id>
+ </company-info>
+ </user>
+ <user>
+ <name>fred</name>
+ <type>admin</type>
+ <full-name>Fred Flintstone</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>2</id>
+ </company-info>
+ </user>
+ <user>
+ <name>barney</name>
+ <type>admin</type>
+ <full-name>Barney Rubble</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>3</id>
+ </company-info>
+ </user>
+ </users>
+ <groups>
+ <group>
+ <name>admin</name>
+ </group>
+ </groups>
+ </top>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<!--
+ ~ 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
+ -->
+
+<rpc message-id="3"
+ xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <get-config>
+ <source>
+ <running/>
+ </source>
+ <filter type="subtree">
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name/>
+ </user>
+ </users>
+ </top>
+ </filter>
+ </get-config>
+</rpc>
\ No newline at end of file
--- /dev/null
+<rpc-reply message-id="4"
+ xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>fred</name>
+ <type>admin</type>
+ <full-name>Fred Flintstone</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>2</id>
+ </company-info>
+ </user>
+ </users>
+ </top>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<!--
+ ~ 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
+ -->
+
+<rpc-reply message-id="4" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>root</name>
+ <type>superuser</type>
+ <full-name>Charlie Root</full-name>
+ <company-info>
+ <dept>1</dept>
+ <id>1</id>
+ </company-info>
+ </user>
+ <user>
+ <name>fred</name>
+ <type>admin</type>
+ <full-name>Fred Flintstone</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>2</id>
+ </company-info>
+ </user>
+ <user>
+ <name>barney</name>
+ <type>admin</type>
+ <full-name>Barney Rubble</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>3</id>
+ </company-info>
+ </user>
+ </users>
+ <groups>
+ <group>
+ <name>admin</name>
+ </group>
+ </groups>
+ </top>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<rpc message-id="4"
+ xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <get-config>
+ <source>
+ <running/>
+ </source>
+ <filter type="subtree">
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>fred</name>
+ </user>
+ </users>
+ </top>
+ </filter>
+ </get-config>
+</rpc>
\ No newline at end of file
--- /dev/null
+<rpc-reply message-id="5"
+ xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>fred</name>
+ <type>admin</type>
+ <full-name>Fred Flintstone</full-name>
+ </user>
+ </users>
+ </top>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<rpc-reply message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>root</name>
+ <type>superuser</type>
+ <full-name>Charlie Root</full-name>
+ <company-info>
+ <dept>1</dept>
+ <id>1</id>
+ </company-info>
+ </user>
+ <user>
+ <name>fred</name>
+ <type>admin</type>
+ <full-name>Fred Flintstone</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>2</id>
+ </company-info>
+ </user>
+ <user>
+ <name>barney</name>
+ <type>admin</type>
+ <full-name>Barney Rubble</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>3</id>
+ </company-info>
+ </user>
+ </users>
+ <groups>
+ <group>
+ <name>admin</name>
+ </group>
+ </groups>
+ </top>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<rpc message-id="5"
+ xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <get-config>
+ <source>
+ <running/>
+ </source>
+ <filter type="subtree">
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>fred</name>
+ <type/>
+ <full-name/>
+ </user>
+ </users>
+ </top>
+ </filter>
+ </get-config>
+</rpc>
\ No newline at end of file
--- /dev/null
+<rpc-reply message-id="6"
+ xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>root</name>
+ <company-info>
+ <dept>1</dept>
+ <id>1</id>
+ </company-info>
+ </user>
+ <user>
+ <name>fred</name>
+ <company-info>
+ <id>2</id>
+ </company-info>
+ </user>
+ </users>
+ </top>
+ </data>
+</rpc-reply>
--- /dev/null
+<!--
+ ~ 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
+ -->
+
+<rpc-reply message-id="6" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>root</name>
+ <type>superuser</type>
+ <full-name>Charlie Root</full-name>
+ <company-info>
+ <dept>1</dept>
+ <id>1</id>
+ </company-info>
+ </user>
+ <user>
+ <name>fred</name>
+ <type>admin</type>
+ <full-name>Fred Flintstone</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>2</id>
+ </company-info>
+ </user>
+ <user>
+ <name>barney</name>
+ <type>admin</type>
+ <full-name>Barney Rubble</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>3</id>
+ </company-info>
+ </user>
+ </users>
+ <groups>
+ <group>
+ <name>admin</name>
+ </group>
+ </groups>
+ </top>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<rpc message-id="6"
+ xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <get-config>
+ <source>
+ <running/>
+ </source>
+ <filter type="subtree">
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>root</name>
+ <company-info/>
+ </user>
+ <user>
+ <name>fred</name>
+ <company-info>
+ <id/>
+ </company-info>
+ </user>
+ <user>
+ <name>barney</name>
+ <type>superuser</type>
+ <company-info>
+ <dept/>
+ </company-info>
+ </user>
+ </users>
+ </top>
+ </filter>
+ </get-config>
+</rpc>
+
--- /dev/null
+<rpc-reply message-id="7"
+ xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <t:top xmlns:t="http://example.com/schema/1.2/stats">
+ <t:interfaces>
+ <t:interface t:ifName="eth0">
+ <t:ifInOctets>45621</t:ifInOctets>
+ <t:ifOutOctets>774344</t:ifOutOctets>
+ </t:interface>
+ </t:interfaces>
+ </t:top>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<rpc-reply message-id="7" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <data>
+ <top xmlns="http://example.com/schema/1.2/config">
+ <users>
+ <user>
+ <name>root</name>
+ <type>superuser</type>
+ <full-name>Charlie Root</full-name>
+ <company-info>
+ <dept>1</dept>
+ <id>1</id>
+ </company-info>
+ </user>
+ <user>
+ <name>fred</name>
+ <type>admin</type>
+ <full-name>Fred Flintstone</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>2</id>
+ </company-info>
+ </user>
+ <user>
+ <name>barney</name>
+ <type>admin</type>
+ <full-name>Barney Rubble</full-name>
+ <company-info>
+ <dept>2</dept>
+ <id>3</id>
+ </company-info>
+ </user>
+ </users>
+ <groups>
+ <group>
+ <name>admin</name>
+ </group>
+ </groups>
+ </top>
+ <prefix:top xmlns:prefix="http://example.com/schema/1.2/stats">
+ <prefix:interfaces>
+ <prefix:interface prefix:ifName="eth0">
+ <prefix:ifInOctets>45621</prefix:ifInOctets>
+ <prefix:ifOutOctets>774344</prefix:ifOutOctets>
+ </prefix:interface>
+ <prefix:interface prefix:ifName="eth1">
+ <prefix:ifInOctets>1</prefix:ifInOctets>
+ <prefix:ifOutOctets>1</prefix:ifOutOctets>
+ </prefix:interface>
+ </prefix:interfaces>
+ </prefix:top>
+ </data>
+</rpc-reply>
\ No newline at end of file
--- /dev/null
+<rpc message-id="7"
+ xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <get>
+ <filter type="subtree">
+ <t:top xmlns:t="http://example.com/schema/1.2/stats">
+ <t:interfaces>
+ <t:interface t:ifName="eth0"/>
+ </t:interfaces>
+ </t:top>
+ </filter>
+ </get>
+</rpc>
\ No newline at end of file
--- /dev/null
+<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-6">
+ <data>
+ <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+ <instance>
+ <name>yang-schema-service</name>
+ <provider>/modules/module[type='schema-service-singleton'][name='yang-schema-service']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+ <instance>
+ <name>dom-broker</name>
+ <provider>/modules/module[type='dom-broker-impl'][name='inmemory-dom-broker']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker</type>
+ <instance>
+ <name>inmemory-data-broker</name>
+ <provider>/modules/module[type='dom-inmemory-data-broker'][name='inmemory-data-broker']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+ <instance>
+ <name>global-netconf-processing-executor</name>
+ <provider>/modules/module[type='threadpool-flexible'][name='global-netconf-processing-executor']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+ <instance>
+ <name>global-netconf-processing-executor-threadfactory</name>
+ <provider>/modules/module[type='threadfactory-naming'][name='global-netconf-processing-executor-threadfactory']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-dom-mapping-service</type>
+ <instance>
+ <name>runtime-mapping-singleton</name>
+ <provider>/modules/module[type='runtime-generated-mapping'][name='runtime-mapping-singleton']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
+ <instance>
+ <name>global-timer</name>
+ <provider>/modules/module[type='netty-hashed-wheel-timer'][name='global-timer']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+ <instance>
+ <name>global-boss-group</name>
+ <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-boss-group']</provider>
+ </instance>
+ <instance>
+ <name>global-worker-group</name>
+ <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-worker-group']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+ <instance>
+ <name>global-event-executor</name>
+ <provider>/modules/module[type='netty-global-event-executor'][name='singleton']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry</type>
+ <instance>
+ <name>binding-rpc-broker</name>
+ <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+ <instance>
+ <name>binding-notification-broker</name>
+ <provider>/modules/module[type='binding-notification-broker'][name='binding-notification-broker']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
+ <instance>
+ <name>binding-osgi-broker</name>
+ <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker</type>
+ <instance>
+ <name>binding-data-broker</name>
+ <provider>/modules/module[type='binding-data-compatible-broker'][name='inmemory-binding-data-broker']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">prefix:kitchen-service</type>
+ <instance>
+ <name>kitchen-service</name>
+ <provider>/modules/module[type='kitchen-service-impl'][name='kitchen-service-impl']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">prefix:netconf-client-dispatcher</type>
+ <instance>
+ <name>global-netconf-dispatcher</name>
+ <provider>/modules/module[type='netconf-client-dispatcher'][name='global-netconf-dispatcher']</provider>
+ </instance>
+ </service>
+ </services>
+ </data>
+</rpc-reply>
--- /dev/null
+<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-6">
+ <data>
+ <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">prefix:toaster-provider-impl</type>
+ <name>toaster-provider-impl</name>
+ <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+ <name>binding-notification-broker</name>
+ </notification-service>
+ <rpc-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry</type>
+ <name>binding-rpc-broker</name>
+ </rpc-registry>
+ <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker</type>
+ <name>binding-data-broker</name>
+ </data-broker>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">prefix:sal-netconf-connector</type>
+ <name>controller-config</name>
+ <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1830</port>
+ <connection-timeout-millis xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">20000</connection-timeout-millis>
+ <between-attempts-timeout-millis xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">2000</between-attempts-timeout-millis>
+ <sleep-factor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1.5</sleep-factor>
+ <password xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</password>
+ <dom-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+ <name>dom-broker</name>
+ </dom-registry>
+ <client-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">prefix:netconf-client-dispatcher</type>
+ <name>global-netconf-dispatcher</name>
+ </client-dispatcher>
+ <username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</username>
+ <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">127.0.0.1</address>
+ <processing-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+ <name>global-netconf-processing-executor</name>
+ </processing-executor>
+ <tcp-only xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">false</tcp-only>
+ <binding-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
+ <name>binding-osgi-broker</name>
+ </binding-registry>
+ <max-connection-attempts xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">0</max-connection-attempts>
+ <event-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+ <name>global-event-executor</name>
+ </event-executor>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">prefix:netconf-client-dispatcher</type>
+ <name>global-netconf-dispatcher</name>
+ <worker-thread-group xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+ <name>global-worker-group</name>
+ </worker-thread-group>
+ <timer xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
+ <name>global-timer</name>
+ </timer>
+ <boss-thread-group xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+ <name>global-boss-group</name>
+ </boss-thread-group>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:logback:config">prefix:logback</type>
+ <name>singleton</name>
+ <console-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <threshold-filter>ERROR</threshold-filter>
+ <name>STDOUT</name>
+ <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</encoder-pattern>
+ </console-appenders>
+ <file-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <append>true</append>
+ <file-name>logs/audit.log</file-name>
+ <name>audit-file</name>
+ <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} %msg %n</encoder-pattern>
+ </file-appenders>
+ <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <level>WARN</level>
+ <logger-name>org.opendaylight.controller.logging.bridge</logger-name>
+ </loggers>
+ <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <level>INFO</level>
+ <logger-name>audit</logger-name>
+ <appenders>audit-file</appenders>
+ </loggers>
+ <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <level>ERROR</level>
+ <logger-name>ROOT</logger-name>
+ <appenders>STDOUT</appenders>
+ <appenders>opendaylight.log</appenders>
+ </loggers>
+ <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <level>INFO</level>
+ <logger-name>org.opendaylight</logger-name>
+ </loggers>
+ <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <level>INFO</level>
+ <logger-name>org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort</logger-name>
+ <appenders>opendaylight.log</appenders>
+ </loggers>
+ <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <level>TRACE</level>
+ <logger-name>org.opendaylight.controller.netconf</logger-name>
+ </loggers>
+ <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <level>WARN</level>
+ <logger-name>io.netty</logger-name>
+ </loggers>
+ <rolling-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+ <append>true</append>
+ <max-file-size>10MB</max-file-size>
+ <file-name>logs/opendaylight.log</file-name>
+ <name>opendaylight.log</name>
+ <file-name-pattern>logs/opendaylight.%d.log.zip</file-name-pattern>
+ <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{35} - %msg%n</encoder-pattern>
+ <clean-history-on-start>false</clean-history-on-start>
+ <max-history>1</max-history>
+ <rolling-policy-type>TimeBasedRollingPolicy</rolling-policy-type>
+ </rolling-appenders>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:shutdown:impl">prefix:shutdown</type>
+ <name>shutdown</name>
+ <secret xmlns="urn:opendaylight:params:xml:ns:yang:controller:shutdown:impl"/>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:timer">prefix:netty-hashed-wheel-timer</type>
+ <name>global-timer</name>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup">prefix:netty-threadgroup-fixed</type>
+ <name>global-boss-group</name>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup">prefix:netty-threadgroup-fixed</type>
+ <name>global-worker-group</name>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:schema-service-singleton</type>
+ <name>yang-schema-service</name>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:dom-broker-impl</type>
+ <name>inmemory-dom-broker</name>
+ <async-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker</type>
+ <name>inmemory-data-broker</name>
+ </async-data-broker>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:dom-inmemory-data-broker</type>
+ <name>inmemory-data-broker</name>
+ <schema-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+ <name>yang-schema-service</name>
+ </schema-service>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">prefix:threadpool-flexible</type>
+ <name>global-netconf-processing-executor</name>
+ <threadFactory xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+ <name>global-netconf-processing-executor-threadfactory</name>
+ </threadFactory>
+ <minThreadCount xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">1</minThreadCount>
+ <max-thread-count xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">4</max-thread-count>
+ <keepAliveMillis xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">600000</keepAliveMillis>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:eventexecutor">prefix:netty-global-event-executor</type>
+ <name>singleton</name>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-broker-impl</type>
+ <name>binding-broker-impl</name>
+ <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+ <name>binding-notification-broker</name>
+ </notification-service>
+ <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker</type>
+ <name>binding-data-broker</name>
+ </data-broker>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:runtime-generated-mapping</type>
+ <name>runtime-mapping-singleton</name>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-notification-broker</type>
+ <name>binding-notification-broker</name>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-data-compatible-broker</type>
+ <name>inmemory-binding-data-broker</name>
+ <dom-async-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+ <name>dom-broker</name>
+ </dom-async-broker>
+ <binding-mapping-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-dom-mapping-service</type>
+ <name>runtime-mapping-singleton</name>
+ </binding-mapping-service>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl">prefix:threadfactory-naming</type>
+ <name>global-netconf-processing-executor-threadfactory</name>
+ <name-prefix xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl">remote-connector-processing-executor</name-prefix>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">prefix:kitchen-service-impl</type>
+ <name>kitchen-service-impl</name>
+ <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+ <name>binding-notification-broker</name>
+ </notification-service>
+ <rpc-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry</type>
+ <name>binding-rpc-broker</name>
+ </rpc-registry>
+ </module>
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">prefix:remote-zeromq-rpc-server</type>
+ <name>remoter</name>
+ <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">5666</port>
+ <dom-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+ <name>dom-broker</name>
+ </dom-broker>
+ </module>
+ </modules>
+ <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+ <instance>
+ <name>yang-schema-service</name>
+ <provider>/modules/module[type='schema-service-singleton'][name='yang-schema-service']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+ <instance>
+ <name>dom-broker</name>
+ <provider>/modules/module[type='dom-broker-impl'][name='inmemory-dom-broker']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker</type>
+ <instance>
+ <name>inmemory-data-broker</name>
+ <provider>/modules/module[type='dom-inmemory-data-broker'][name='inmemory-data-broker']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+ <instance>
+ <name>global-netconf-processing-executor</name>
+ <provider>/modules/module[type='threadpool-flexible'][name='global-netconf-processing-executor']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+ <instance>
+ <name>global-netconf-processing-executor-threadfactory</name>
+ <provider>/modules/module[type='threadfactory-naming'][name='global-netconf-processing-executor-threadfactory']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-dom-mapping-service</type>
+ <instance>
+ <name>runtime-mapping-singleton</name>
+ <provider>/modules/module[type='runtime-generated-mapping'][name='runtime-mapping-singleton']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
+ <instance>
+ <name>global-timer</name>
+ <provider>/modules/module[type='netty-hashed-wheel-timer'][name='global-timer']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+ <instance>
+ <name>global-boss-group</name>
+ <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-boss-group']</provider>
+ </instance>
+ <instance>
+ <name>global-worker-group</name>
+ <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-worker-group']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+ <instance>
+ <name>global-event-executor</name>
+ <provider>/modules/module[type='netty-global-event-executor'][name='singleton']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry</type>
+ <instance>
+ <name>binding-rpc-broker</name>
+ <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+ <instance>
+ <name>binding-notification-broker</name>
+ <provider>/modules/module[type='binding-notification-broker'][name='binding-notification-broker']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
+ <instance>
+ <name>binding-osgi-broker</name>
+ <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker</type>
+ <instance>
+ <name>binding-data-broker</name>
+ <provider>/modules/module[type='binding-data-compatible-broker'][name='inmemory-binding-data-broker']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">prefix:kitchen-service</type>
+ <instance>
+ <name>kitchen-service</name>
+ <provider>/modules/module[type='kitchen-service-impl'][name='kitchen-service-impl']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">prefix:netconf-client-dispatcher</type>
+ <instance>
+ <name>global-netconf-dispatcher</name>
+ <provider>/modules/module[type='netconf-client-dispatcher'][name='global-netconf-dispatcher']</provider>
+ </instance>
+ </service>
+ </services>
+ </data>
+</rpc-reply>
--- /dev/null
+<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-10">
+ <get-config>
+ <filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
+ <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <service/>
+ </services>
+ </filter>
+ <source>
+ <running/>
+ </source>
+ </get-config>
+</rpc>
public class NetconfMonitoringOperationService implements NetconfOperationService {
- public static final Set<Capability> CAPABILITIES = Sets.<Capability>newHashSet(new Capability() {
+ private static final Set<Capability> CAPABILITIES = Sets.<Capability>newHashSet(new Capability() {
@Override
public String getCapabilityUri() {
AuthProvider authProvider = mock(AuthProvider.class);
doReturn(PEMGenerator.generate().toCharArray()).when(authProvider).getPEMAsCharArray();
doReturn(true).when(authProvider).authenticated(anyString(), anyString());
- NetconfSSHServer thread = NetconfSSHServer.start(1831, NetconfConfigUtil.getNetconfLocalAddress(), authProvider, new NioEventLoopGroup());
+ NetconfSSHServer thread = NetconfSSHServer.start(10831, NetconfConfigUtil.getNetconfLocalAddress(), authProvider, new NioEventLoopGroup());
Thread.sleep(2000);
logger.info("Closing socket");
thread.close();
public static final class OperationNameAndNamespace {
private final String operationName, namespace;
+ private final XmlElement operationElement;
public OperationNameAndNamespace(Document message) throws NetconfDocumentedException {
XmlElement requestElement = null;
requestElement = getRequestElementWithCheck(message);
-
- XmlElement operationElement = requestElement.getOnlyChildElement();
+ operationElement = requestElement.getOnlyChildElement();
operationName = operationElement.getName();
namespace = operationElement.getNamespace();
}
public String getNamespace() {
return namespace;
}
+
+ public XmlElement getOperationElement() {
+ return operationElement;
+ }
}
protected static XmlElement getRequestElementWithCheck(Document message) throws NetconfDocumentedException {
);
}
+ public Optional<String> getOnlyTextContentOptionally() {
+ // only return text content if this node has exactly one Text child node
+ if (element.getChildNodes().getLength() == 1) {
+ Node item = element.getChildNodes().item(0);
+ if (item instanceof Text) {
+ return Optional.of(((Text) item).getWholeText());
+ }
+ }
+ return Optional.absent();
+ }
+
public String getNamespaceAttribute() throws MissingNameSpaceException {
String attribute = element.getAttribute(XmlUtil.XMLNS_ATTRIBUTE_KEY);
if (attribute == null || attribute.equals("")){
// TODO where to store namespace of config ?
public static final String URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG = "urn:opendaylight:params:xml:ns:yang:controller:config";
public static final String GET = "get";
+ public static final String GET_CONFIG = "get-config";
}
@Override
public Node connect (String type, String connectionIdentifier, Map<ConnectionConstants, String> params) {
IPluginInConnectionService s = pluginService.get(type);
- if (s != null) return s.connect(connectionIdentifier, params);
+ if (s != null) {
+ return s.connect(connectionIdentifier, params);
+ }
return null;
}
for (String pluginType : this.pluginService.keySet()) {
IPluginInConnectionService s = pluginService.get(pluginType);
Node node = s.connect(connectionIdentifier, params);
- if (node != null) return node;
+ if (node != null) {
+ return node;
+ }
}
}
return null;