fix yang: get-async-*, changed from notification to rpc calls 71/1171/2
authorMichal Rehak <mirehak@cisco.com>
Thu, 12 Sep 2013 19:43:30 +0000 (21:43 +0200)
committerMichal Rehak <mirehak@cisco.com>
Thu, 12 Sep 2013 19:49:21 +0000 (21:49 +0200)
Change-Id: I192989f8960e062350cb29f68de4a57f9fc08356
Signed-off-by: Michal Rehak <mirehak@cisco.com>
openflow-protocol-api/src/main/yang/openflow-protocol.yang
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/connection/ConnectionAdapterImpl.java

index 1e24f7c8ae2703f5a4ebaf931abbb631f34c66be..0782afec2a6f938ee09c5e07c2c9e305922f2988 100644 (file)
@@ -829,21 +829,24 @@ module openflow-protocol {
             } /* Controller/switch message */
             
         /* Asynchronous message configuration. */
-            notification get-async-request-message {
-                uses get-async-request;
-                // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"
-                
-            } /* Controller/switch message */
-            notification get-async-reply-message {
-                uses get-async-reply;
-                // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"
-                
-            } /* Controller/switch message */
-            notification set-async-message {
-                uses set-async;
+            rpc get-async {
+                input {
+                    uses get-async-request;
+                    // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"
+                }
+                output {
+                    uses get-async-reply;
+                    // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"
+                }
+            } 
+             /* Controller/switch message */
+            rpc set-async {
+                input { 
+                    uses set-async;
                 // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"
+                }
                 
-            } /* Controller/switch message */
+            } 
         /* Meters and rate limiters configuration messages. */
             rpc meter-mod {
                 input {
index 076cc4a3b141e1c7d32585f8a4fee3f145c8b90a..0423d25bffcb2d763e6b9ff4202ac88decafb06b 100644 (file)
@@ -15,6 +15,7 @@ import io.netty.util.concurrent.GenericFutureListener;
 import java.util.Collection;
 import java.util.concurrent.Future;
 
+import org.opendaylight.controller.sal.common.util.RpcErrors;
 import org.opendaylight.controller.sal.common.util.Rpcs;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
@@ -24,6 +25,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesInput;
@@ -38,10 +41,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetAsyncInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInput;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcError.ErrorSeverity;
+import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
 import com.google.common.collect.Lists;
@@ -163,6 +168,24 @@ public class ConnectionAdapterImpl implements ConnectionAdapter {
         return null;
     }
 
+    /* (non-Javadoc)
+     * @see org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolService#getAsync(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInput)
+     */
+    @Override
+    public Future<RpcResult<GetAsyncOutput>> getAsync(GetAsyncInput input) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolService#setAsync(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetAsyncInput)
+     */
+    @Override
+    public Future<RpcResult<Void>> setAsync(SetAsyncInput input) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
     @Override
     public Future<Boolean> disconnect() {
         ChannelFuture disconnectResult = channel.disconnect();
@@ -260,12 +283,9 @@ public class ConnectionAdapterImpl implements ConnectionAdapter {
      */
     protected RpcError buildRpcError(String info, ErrorSeverity severity, String message, 
             Throwable cause) {
-        // TODO - uncomment, when sal-common-util merged
-//        RpcError error = RpcErrors.getRpcError(APPLICATION_TAG, TAG, info, severity, message, 
-//                ErrorType.RPC, cause);
-//        return error;
-        
-        return null;
+        RpcError error = RpcErrors.getRpcError(APPLICATION_TAG, TAG, info, severity, message, 
+                ErrorType.RPC, cause);
+        return error;
     }
     
     /**
@@ -274,12 +294,9 @@ public class ConnectionAdapterImpl implements ConnectionAdapter {
      */
     protected RpcError buildTransportError(String info, ErrorSeverity severity, String message, 
             Throwable cause) {
-        // TODO - uncomment, when sal-common-util merged
-//        RpcError error = RpcErrors.getRpcError(APPLICATION_TAG, TAG, info, severity, message, 
-//                ErrorType.TRANSPORT, cause);
-//        return error;
-        
-        return null;
+        RpcError error = RpcErrors.getRpcError(APPLICATION_TAG, TAG, info, severity, message, 
+                ErrorType.TRANSPORT, cause);
+        return error;
     }
 
 }