Merge "- netconf SSH bridge bundle - Implement bridge using socket - standard netconf...
authorEd Warnicke <eaw@cisco.com>
Thu, 28 Nov 2013 11:34:00 +0000 (11:34 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 28 Nov 2013 11:34:00 +0000 (11:34 +0000)
14 files changed:
opendaylight/config/pom.xml [changed mode: 0755->0644]
opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-error.yang
opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-service.yang
opendaylight/md-sal/model/model-flow-service/src/main/yang/group-service.yang
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/group-statistics.yang
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/meter-statistics.yang
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeCodeGenerator.xtend
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataModification.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/api/RestconfService.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.xtend
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/XmlProvidersTest.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsProvider.java
opendaylight/netconf/config-netconf-connector/pom.xml [changed mode: 0755->0644]
opendaylight/topologymanager/implementation/pom.xml [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 369b279..3e9d1ee 100644 (file)
@@ -16,7 +16,7 @@ module flow-errors {
             enum flow-mod-failed;
             enum group-mod-failed;
             enum port-mod-failed;
-            enum table-mod-failed;            
+            enum table-mod-failed;
             enum queue-op-failed;
             enum switch-config-failed;
             enum role-request-failed;
@@ -34,7 +34,7 @@ module flow-errors {
         }
         
         leaf code {
-            type uint16;        
+            type uint16;
         }
         
         leaf data {
@@ -48,15 +48,15 @@ module flow-errors {
         }
         
         leaf exp-type {
-            type uint16;        
+            type uint16;
         }
         
         leaf experimenter-id {
-            type uint32;        
+            type uint32;
         }
         
         leaf data {
             type string;
         }
-    }   
+    }
 }
\ No newline at end of file
index a32a45f..07678f5 100644 (file)
@@ -52,7 +52,7 @@ module sal-flow {
     rpc add-flow {
         input {
             uses node-flow;
-            uses tr:transaction-aware;            
+            uses tr:transaction-aware;
         }
         output {
             uses tr:transaction-aware;
@@ -62,7 +62,7 @@ module sal-flow {
     rpc remove-flow {
         input {
             uses node-flow;
-            uses tr:transaction-aware;            
+            uses tr:transaction-aware;
         }
         output {
             uses tr:transaction-aware;
@@ -72,7 +72,7 @@ module sal-flow {
     rpc update-flow {
         input {
             uses flow-update;
-            uses tr:transaction-aware;            
+            uses tr:transaction-aware;
         }
         output {
             uses tr:transaction-aware;
index b21423b..9106bca 100644 (file)
@@ -32,7 +32,7 @@ module sal-group {
     rpc add-group {
         input {
             uses node-group;
-            uses tr:transaction-aware;            
+            uses tr:transaction-aware;
         }
         output {
             uses tr:transaction-aware;
@@ -42,7 +42,7 @@ module sal-group {
     rpc remove-group {
         input {
             uses node-group;
-            uses tr:transaction-aware;            
+            uses tr:transaction-aware;
         }
         output {
             uses tr:transaction-aware;
@@ -52,7 +52,7 @@ module sal-group {
     rpc update-group {
         input {
             uses group-update;
-            uses tr:transaction-aware;            
+            uses tr:transaction-aware;
         }
         output {
             uses tr:transaction-aware;
index d29ddc0..1b6a9df 100644 (file)
@@ -8,9 +8,9 @@ module opendaylight-group-statistics {
     import flow-capable-transaction {prefix tr;}
     
     contact
-       "Anilkumar Vishnoi
-       Email: avishnoi@in.ibm.com";
-               
+        "Anilkumar Vishnoi
+        Email: avishnoi@in.ibm.com";
+            
     revision "2013-11-11" {
         description "Initial revision of group statistics service";
     }
@@ -18,44 +18,44 @@ module opendaylight-group-statistics {
     augment "/inv:nodes/inv:node" {
         ext:augment-identifier "node-group-statistics";
         container group-statistics {
-               //config "false";
-               uses group-types:group-statistics-reply;
+            //config "false";
+            uses group-types:group-statistics-reply;
         }
     }
 
-       augment "/inv:nodes/inv:node" {
+    augment "/inv:nodes/inv:node" {
         ext:augment-identifier "node-group-desc-stats";
         container group-desc {
-               //config "false";
-               uses group-types:group-desc-stats-reply;
+            //config "false";
+            uses group-types:group-desc-stats-reply;
         }
     }
-       
-       augment "/inv:nodes/inv:node" {
+    
+    augment "/inv:nodes/inv:node" {
         ext:augment-identifier "node-group-features";
         container group-features {
-               //config "false";
-               uses group-types:group-features-reply;
+            //config "false";
+            uses group-types:group-features-reply;
         }
     }
 
-       // RPC calls
-       rpc get-all-group-statistics {
-               input {
-            uses inv:node;
+    // RPC calls
+    rpc get-all-group-statistics {
+        input {
+            uses inv:node-context-ref;
         }
         output {
-               uses group-types:group-statistics-reply;
+            uses group-types:group-statistics-reply;
             uses tr:transaction-aware;
         }
-       
-       }
-       
-       rpc get-group-statistics {
-               input {
-            uses inv:node;
+    
+    }
+    
+    rpc get-group-statistics {
+        input {
+            uses inv:node-context-ref;
             leaf group-id{
-               type group-types:group-id;
+                type group-types:group-id;
             }
            
         }
@@ -63,56 +63,56 @@ module opendaylight-group-statistics {
             uses group-types:group-statistics-reply;
             uses tr:transaction-aware;
         }
-       
-       }
-       
-       rpc get-group-description {
-               input {
-            uses inv:node;
+    
+    }
+    
+    rpc get-group-description {
+        input {
+            uses inv:node-context-ref;
         }
         output {
             uses group-types:group-desc-stats-reply;
             uses tr:transaction-aware;
         }
-       }
-       
-       rpc get-group-features {
-               input {
-            uses inv:node;
+    }
+    
+    rpc get-group-features {
+        input {
+            uses inv:node-context-ref;
         }
         output {
             uses group-types:group-features-reply;
             uses tr:transaction-aware;
         }
-       }
-       
+    }
+    
 
-       //Notification calls
-       
-       notification group-statistics-updated {
-               leaf moreReplies {
-                       type boolean;
-               }
-               uses inv:node;
-               uses group-types:group-statistics-reply;
+    //Notification calls
+    
+    notification group-statistics-updated {
+        leaf moreReplies {
+            type boolean;
+        }
+        uses inv:node;
+        uses group-types:group-statistics-reply;
         uses tr:transaction-aware;
-       }
-       
-       notification group-desc-stats-updated {
-               leaf moreReplies {
-                       type boolean;
-               }
-               uses inv:node;
-               uses group-types:group-desc-stats-reply;
+    }
+    
+    notification group-desc-stats-updated {
+        leaf moreReplies {
+            type boolean;
+        }
+        uses inv:node;
+        uses group-types:group-desc-stats-reply;
         uses tr:transaction-aware;
-       }
+    }
 
-       notification group-features-updated {
-               leaf moreReplies {
-                       type boolean;
-               }
-               uses inv:node;
-               uses group-types:group-features-reply;
+    notification group-features-updated {
+        leaf moreReplies {
+            type boolean;
+        }
+        uses inv:node;
+        uses group-types:group-features-reply;
         uses tr:transaction-aware;
-       }
+    }
 }
index c22bdd3..e3b2a3f 100644 (file)
@@ -8,8 +8,8 @@ module opendaylight-meter-statistics {
     import flow-capable-transaction {prefix tr;}
     
     contact
-       "Anilkumar Vishnoi
-       Email: avishnoi@in.ibm.com";
+        "Anilkumar Vishnoi
+        Email: avishnoi@in.ibm.com";
 
     revision "2013-11-11" {
         description "Initial revision of meter statistics service";
@@ -18,103 +18,103 @@ module opendaylight-meter-statistics {
     augment "/inv:nodes/inv:node" {
         ext:augment-identifier "node-meter-statistics";
         container meter-statistics {
-               //config "false";
-               uses meter-types:meter-statistics-reply;
+            //config "false";
+            uses meter-types:meter-statistics-reply;
         }
     }
 
-       augment "/inv:nodes/inv:node" {
+    augment "/inv:nodes/inv:node" {
         ext:augment-identifier "node-meter-config-stats";
         container meter-config-stats {
-               //config "false";
-               uses meter-types:meter-config-stats-reply;
+            //config "false";
+            uses meter-types:meter-config-stats-reply;
         }
     }
-       
-       augment "/inv:nodes/inv:node" {
+    
+    augment "/inv:nodes/inv:node" {
         ext:augment-identifier "node-meter-features";
         container meter-features {
-               //config "false";
-               uses meter-types:meter-features-reply;
+            //config "false";
+            uses meter-types:meter-features-reply;
         }
     }
 
-       // RPC calls
-       rpc get-all-meter-statistics {
-               input {
-            uses inv:node;
+    // RPC calls
+    rpc get-all-meter-statistics {
+        input {
+            uses inv:node-context-ref;
         }
         output {
-                       uses meter-types:meter-statistics-reply;
-                       uses tr:transaction-aware;
+            uses meter-types:meter-statistics-reply;
+            uses tr:transaction-aware;
         }
-       
-       }
-       
-       rpc get-meter-statistics {
-               input {
-            uses inv:node;
+    
+    }
+    
+    rpc get-meter-statistics {
+        input {
+            uses inv:node-context-ref;
             leaf meter-id{
-               type meter-types:meter-id;
+                type meter-types:meter-id;
             }
         }
         output {
             uses meter-types:meter-statistics-reply;
             uses tr:transaction-aware;
         }
-       
-       }
-       
-       rpc get-all-meter-config-statistics {
-               input {
-            uses inv:node;
+    
+    }
+    
+    rpc get-all-meter-config-statistics {
+        input {
+            uses inv:node-context-ref;
         }
         output {
-               uses meter-types:meter-config-stats-reply;
+               uses meter-types:meter-config-stats-reply;
             uses tr:transaction-aware;
         }
-       }
-       
-       rpc get-meter-features {
-               input {
-            uses inv:node;
+    }
+    
+    rpc get-meter-features {
+        input {
+            uses inv:node-context-ref;
         }
         output {
-               uses meter-types:meter-features-reply;
+            uses meter-types:meter-features-reply;
             uses tr:transaction-aware;
         }
-       }
-       
+    }
+    
 
-       //Notification calls
-       
-       notification meter-statistics-updated {
-               leaf moreReplies {
-                       type boolean;
-               }
-               
-               uses inv:node;
+    //Notification calls
+    
+    notification meter-statistics-updated {
+        leaf moreReplies {
+            type boolean;
+        }
+        
+        uses inv:node;
         uses meter-types:meter-statistics-reply;
         uses tr:transaction-aware;
-       }
-       
-       notification meter-config-stats-updated {
-               leaf moreReplies {
-                       type boolean;
-               }
-           
+    }
+    
+    notification meter-config-stats-updated {
+        leaf moreReplies {
+            type boolean;
+        }
+        
         uses inv:node;
-           uses meter-types:meter-config-stats-reply;
-       uses tr:transaction-aware;
-       }
+        uses meter-types:meter-config-stats-reply;
+        uses tr:transaction-aware;
+    }
 
-       notification meter-features-updated {
-               leaf moreReplies {
-                       type boolean;
-               }
-               
-               uses inv:node;
+    notification meter-features-updated {
+        leaf moreReplies {
+            type boolean;
+        }
+        
+        uses inv:node;
         uses meter-types:meter-features-reply;
         uses tr:transaction-aware;
-       }
+    }
 }
index 801e498..90fcbd9 100644 (file)
@@ -57,7 +57,14 @@ class RuntimeCodeGenerator implements org.opendaylight.controller.sal.binding.co
         val targetCls = createClass(iface.directProxyName, supertype) [
             field(DELEGATE_FIELD, iface);
             implementMethodsFrom(supertype) [
-                body = '''return ($r) «DELEGATE_FIELD».«it.name»($$);'''
+                body = '''
+                {
+                    if(«DELEGATE_FIELD» == null) {
+                        throw new java.lang.IllegalStateException("No provider is processing supplied message");
+                    }
+                    return ($r) «DELEGATE_FIELD».«it.name»($$);
+                }
+                '''
             ]
         ]
         return targetCls.toClass(iface.classLoader).newInstance as T
index d059766..d74b26d 100644 (file)
@@ -29,11 +29,12 @@ public interface DataModification<P/* extends Path<P> */, D> extends DataChange<
 
     /**
      * 
-     * Use {@link #putOperationalData(Object, Object)} instead.
+     * @deprecated Use {@link #putOperationalData(Object, Object)} instead.
      * 
      * @param path
      * @param data
      */
+    @Deprecated
     void putRuntimeData(P path, D data);
 
     void putOperationalData(P path, D data);
@@ -41,10 +42,11 @@ public interface DataModification<P/* extends Path<P> */, D> extends DataChange<
     void putConfigurationData(P path, D data);
 
     /**
-     * Use {@link #removeOperationalData(Object)}
+     * @deprecated Use {@link #removeOperationalData(Object)}
      * 
      * @param path
      */
+    @Deprecated
     void removeRuntimeData(P path);
 
     void removeOperationalData(P path);
index 5d08b3e..012b51f 100644 (file)
@@ -92,16 +92,4 @@ public interface RestconfService extends RestconfServiceLegacy {
                MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
     public StructuredData readOperationalData(@PathParam("identifier") String identifier);
 
-    @POST
-    @Path("/operational/{identifier:.+}")
-    @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML, 
-               MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
-    public Response createOperationalData(@PathParam("identifier") String identifier, CompositeNode payload);
-
-    @PUT
-    @Path("/operational/{identifier:.+}")
-    @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML, 
-               MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
-    public Response updateOperationalData(@PathParam("identifier") String identifier, CompositeNode payload);
-
 }
index 8f6ca16..b6426c6 100644 (file)
@@ -2,12 +2,11 @@ package org.opendaylight.controller.sal.restconf.impl
 
 import java.util.List
 import javax.ws.rs.core.Response
+import org.opendaylight.controller.md.sal.common.api.TransactionStatus
 import org.opendaylight.controller.sal.rest.api.RestconfService
 import org.opendaylight.yangtools.yang.data.api.CompositeNode
 import org.opendaylight.yangtools.yang.model.api.DataNodeContainer
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode
-import org.opendaylight.controller.md.sal.common.api.TransactionStatus
-import javax.ws.rs.WebApplicationException
 
 class RestconfImpl implements RestconfService {
     
@@ -96,26 +95,6 @@ class RestconfImpl implements RestconfService {
         createConfigurationData(identifier,payload);
     }
     
-    override createOperationalData(String identifier, CompositeNode payload) {
-        val identifierWithSchemaNode = identifier.resolveInstanceIdentifier
-        val value = resolveNodeNamespaceBySchema(payload, identifierWithSchemaNode.schemaNode)
-        val status = broker.commitOperationalDataPut(identifierWithSchemaNode.instanceIdentifier,value).get();
-        switch status.result {
-            case TransactionStatus.COMMITED: Response.status(Response.Status.OK).build
-            default: Response.status(Response.Status.INTERNAL_SERVER_ERROR).build
-        }
-    }
-    
-    override updateOperationalData(String identifier, CompositeNode payload) {
-        val identifierWithSchemaNode = identifier.resolveInstanceIdentifier
-        val value = resolveNodeNamespaceBySchema(payload, identifierWithSchemaNode.schemaNode)
-        val status = broker.commitOperationalDataPut(identifierWithSchemaNode.instanceIdentifier,value).get();
-        switch status.result {
-            case TransactionStatus.COMMITED: Response.status(Response.Status.NO_CONTENT).build
-            default: Response.status(Response.Status.INTERNAL_SERVER_ERROR).build
-        }
-    }
-    
     private def InstanceIdWithSchemaNode resolveInstanceIdentifier(String identifier) {
         val identifierWithSchemaNode = identifier.toInstanceIdentifier
         if (identifierWithSchemaNode === null) {
index 4336ac8..10885b6 100644 (file)
@@ -133,7 +133,7 @@ public class XmlProvidersTest extends JerseyTest {
         response = target(uri).request(MEDIA_TYPE_DRAFT02).post(entity);
         assertEquals(200, response.getStatus());
         
-        uri = createUri("/operational/", "ietf-interfaces:interfaces/interface/eth0");
+        uri = createUri("/config/", "ietf-interfaces:interfaces/interface/eth0");
         response = target(uri).request(MEDIA_TYPE_DRAFT02).put(entity);
         assertEquals(204, response.getStatus());
         response = target(uri).request(MEDIA_TYPE_DRAFT02).post(entity);
@@ -162,7 +162,7 @@ public class XmlProvidersTest extends JerseyTest {
         response = target(uri).request(MEDIA_TYPE_DRAFT02).post(entity);
         assertEquals(500, response.getStatus());
         
-        uri = createUri("/operational/", "ietf-interfaces:interfaces/interface/eth0");
+        uri = createUri("/config/", "ietf-interfaces:interfaces/interface/eth0");
         response = target(uri).request(MEDIA_TYPE_DRAFT02).put(entity);
         assertEquals(500, response.getStatus());
         response = target(uri).request(MEDIA_TYPE_DRAFT02).post(entity);
index d1ab351..bb7d6f7 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupFeaturesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterConfigStatisticsInputBuilder;
@@ -137,76 +138,86 @@ public class StatisticsProvider implements AutoCloseable {
             //We need to add check, so see if groups/meters are supported
             //by the target node. Below check doesn't look good.
             if(targetNode.getId().getValue().contains("openflow:")){
-                sendAllGroupStatisticsRequest(targetNode);
+                InstanceIdentifier<Node> targetInstanceId = InstanceIdentifier.builder(Nodes.class).child(Node.class,targetNode.getKey()).toInstance();
+                NodeRef targetNodeRef = new NodeRef(targetInstanceId);
                 
-                sendAllMeterStatisticsRequest(targetNode);
+                sendAllGroupStatisticsRequest(targetNodeRef);
                 
-                sendGroupDescriptionRequest(targetNode);
+                sendAllMeterStatisticsRequest(targetNodeRef);
                 
-                sendGroupFeaturesRequest(targetNode);
+                sendGroupDescriptionRequest(targetNodeRef);
                 
-                sendMeterConfigStatisticsRequest(targetNode);
+                sendGroupFeaturesRequest(targetNodeRef);
                 
-                sendMeterFeaturesRequest(targetNode);
+                sendMeterConfigStatisticsRequest(targetNodeRef);
+                
+                sendMeterFeaturesRequest(targetNodeRef);
             }
         }
     }
     
-    private void sendAllGroupStatisticsRequest(Node targetNode){
+    private void sendAllGroupStatisticsRequest(NodeRef targetNode){
         
         final GetAllGroupStatisticsInputBuilder input = new GetAllGroupStatisticsInputBuilder();
         
-        input.setId(targetNode.getId());
+        input.setNode(targetNode);
+        input.setNode(targetNode);
 
+        @SuppressWarnings("unused")
         Future<RpcResult<GetAllGroupStatisticsOutput>> response = 
                 groupStatsService.getAllGroupStatistics(input.build());
     }
     
-    private void sendGroupDescriptionRequest(Node targetNode){
+    private void sendGroupDescriptionRequest(NodeRef targetNode){
         final GetGroupDescriptionInputBuilder input = new GetGroupDescriptionInputBuilder();
         
-        input.setId(targetNode.getId());
-        
+        input.setNode(targetNode);
+
+        @SuppressWarnings("unused")
         Future<RpcResult<GetGroupDescriptionOutput>> response = 
                 groupStatsService.getGroupDescription(input.build());
     }
     
-    private void sendGroupFeaturesRequest(Node targetNode){
+    private void sendGroupFeaturesRequest(NodeRef targetNode){
         
         GetGroupFeaturesInputBuilder input = new GetGroupFeaturesInputBuilder();
         
-        input.setId(targetNode.getId());
-        
+        input.setNode(targetNode);
+
+        @SuppressWarnings("unused")
         Future<RpcResult<GetGroupFeaturesOutput>> response = 
                 groupStatsService.getGroupFeatures(input.build());
     }
     
-    private void sendAllMeterStatisticsRequest(Node targetNode){
+    private void sendAllMeterStatisticsRequest(NodeRef targetNode){
         
         GetAllMeterStatisticsInputBuilder input = new GetAllMeterStatisticsInputBuilder();
         
-        input.setId(targetNode.getId());
-        
+        input.setNode(targetNode);
+
+        @SuppressWarnings("unused")
         Future<RpcResult<GetAllMeterStatisticsOutput>> response = 
                 meterStatsService.getAllMeterStatistics(input.build());
     }
     
-    private void sendMeterConfigStatisticsRequest(Node targetNode){
+    private void sendMeterConfigStatisticsRequest(NodeRef targetNode){
         
         GetAllMeterConfigStatisticsInputBuilder input = new GetAllMeterConfigStatisticsInputBuilder();
         
-        input.setId(targetNode.getId());
-        
+        input.setNode(targetNode);
+
+        @SuppressWarnings("unused")
         Future<RpcResult<GetAllMeterConfigStatisticsOutput>> response = 
                 meterStatsService.getAllMeterConfigStatistics(input.build());
         
     }
-    private void sendMeterFeaturesRequest(Node targetNode){
+    private void sendMeterFeaturesRequest(NodeRef targetNode){
      
         GetMeterFeaturesInputBuilder input = new GetMeterFeaturesInputBuilder();
         
-        input.setId(targetNode.getId());
-        
+        input.setNode(targetNode);
+
+        @SuppressWarnings("unused")
         Future<RpcResult<GetMeterFeaturesOutput>> response = 
                 meterStatsService.getMeterFeatures(input.build());
     }
@@ -241,7 +252,6 @@ public class StatisticsProvider implements AutoCloseable {
           } catch (Throwable e) {
             throw Exceptions.sneakyThrow(e);
           }
-
     }
 
 }