/*
- * 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;
@Override
public Action buildAction(ActionInfo actionInfo) {
BigInteger [] actionValues = actionInfo.getBigActionValues();
- return new ActionBuilder().setAction(
+ if (actionValues.length == 2) {
+ return new ActionBuilder().setAction(
+ new SetFieldCaseBuilder().setSetField(
+ new SetFieldBuilder()
+ .setTunnel(new TunnelBuilder().setTunnelId(actionValues[0])
+ .setTunnelMask(actionValues[1]).build()).build())
+ .build())
+ .setKey(new ActionKey(actionInfo.getActionKey())).build();
+ } else {
+ return new ActionBuilder().setAction(
new SetFieldCaseBuilder().setSetField(
- new SetFieldBuilder().setTunnel(new TunnelBuilder().setTunnelId(actionValues[0])
- .setTunnelMask(actionValues[1]).build()).build()).build())
- .setKey(new ActionKey(actionInfo.getActionKey())).build();
+ new SetFieldBuilder()
+ .setTunnel(new TunnelBuilder().setTunnelId(actionValues[0])
+ .build()).build())
+ .build())
+ .setKey(new ActionKey(actionInfo.getActionKey())).build();
+ }
}