Switched to using constuctor to populate all fields by xid. 91/3291/1
authorEd Warnicke <eaw@cisco.com>
Sun, 1 Dec 2013 12:24:22 +0000 (04:24 -0800)
committerEd Warnicke <eaw@cisco.com>
Sun, 1 Dec 2013 12:24:22 +0000 (04:24 -0800)
Change-Id: I6e00db9d510672e77abd5301ef0dc84debcf9f23
Signed-off-by: Ed Warnicke <eaw@cisco.com>
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/session/MessageDispatchServiceImpl.java

index 42cbac04a3a003a9821238a6c67ad290c34456f8..7c00f37d080060800897e2641917b01a5881aab6 100644 (file)
@@ -119,21 +119,8 @@ public class MessageDispatchServiceImpl implements IMessageDispatchService {
         // Set Xid before invoking RPC on OFLibrary
         // TODO : Cleaner approach is to use a copy constructor once it is implemented
         Long Xid = session.getNextXid();
-        FlowModInputBuilder mdInput = new FlowModInputBuilder();
+        FlowModInputBuilder mdInput = new FlowModInputBuilder(input);
         mdInput.setXid(Xid);
-        mdInput.setBufferId(input.getBufferId());
-        mdInput.setCommand(input.getCommand());
-        mdInput.setCookie(input.getCookie());
-        mdInput.setCookieMask(input.getCookieMask());
-        mdInput.setFlags(input.getFlags());
-        mdInput.setHardTimeout(input.getHardTimeout());
-        mdInput.setIdleTimeout(input.getHardTimeout());
-        mdInput.setMatch(input.getMatch());
-        mdInput.setOutGroup(input.getOutGroup());
-        mdInput.setOutPort(input.getOutPort());
-        mdInput.setPriority(input.getPriority());
-        mdInput.setTableId(input.getTableId());
-        mdInput.setVersion(input.getVersion());
         LOG.debug("Calling OFLibrary flowMod");
         Future<RpcResult<Void>> response = getConnectionAdapter(cookie).flowMod(mdInput.build());
 
@@ -255,7 +242,7 @@ public class MessageDispatchServiceImpl implements IMessageDispatchService {
 
         LOG.debug("Calling OFLibrary portMod");
         Future<RpcResult<Void>> response = getConnectionAdapter(cookie).portMod(input);
-        
+
         // Send the same Xid back to caller - ModelDrivenSwitch
         UpdatePortOutputBuilder portModOutput = new UpdatePortOutputBuilder();
         String stringXid =input.getXid().toString();