support for create/remove terminatingserviceActions
[vpnservice.git] / mdsalutil / mdsalutil-api / src / main / java / org / opendaylight / vpnservice / mdsalutil / MatchFieldType.java
index 178ba18cf232b856f2aac5c4b08707fda97e17fc..57a7f38d048d7e11b8fdc8d64fc6b24c6acca392 100644 (file)
@@ -1,7 +1,9 @@
 /*
- * Copyright (c) 2013 Ericsson AB.  All rights reserved.
- *
+ * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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.vpnservice.mdsalutil;
 
@@ -161,8 +163,8 @@ public enum MatchFieldType {
         @Override
         public void setMatch(MatchBuilder matchBuilderInOut, MatchInfo matchInfo, Map<Class<?>, Object> mapMatchBuilder) {
 
-            StringBuffer nodeConnectorId = new StringBuffer().append("openflow:").append(matchInfo.getMatchValues()[0])
-            .append(':').append(matchInfo.getMatchValues()[1]);
+            StringBuffer nodeConnectorId = new StringBuffer().append("openflow:").append(matchInfo.getBigMatchValues()[0])
+            .append(':').append(matchInfo.getBigMatchValues()[1]);
             matchBuilderInOut.setInPort(new NodeConnectorId(nodeConnectorId.toString()));
         }
     },
@@ -551,7 +553,11 @@ public enum MatchFieldType {
             }
 
             BigInteger[] tunnelIdValues = matchInfo.getBigMatchValues();
-            tunnelBuilder.setTunnelId(tunnelIdValues[0]).setTunnelMask(tunnelIdValues[1]).build();
+            tunnelBuilder.setTunnelId(tunnelIdValues[0]);
+            if(tunnelIdValues.length > 1){
+                tunnelBuilder.setTunnelMask(tunnelIdValues[1]);
+            }
+            tunnelBuilder.build();
         }
 
         @Override