2 * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
9 package org.opendaylight.openflowjava.protocol.impl.deserialization.instruction;
\r
11 import io.netty.buffer.ByteBuf;
\r
13 import java.util.ArrayList;
\r
14 import java.util.List;
\r
16 import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;
\r
17 import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
\r
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstruction;
\r
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstructionBuilder;
\r
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
\r
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
\r
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;
\r
25 * @author michal.polkorab
\r
28 public class ClearActionsInstructionDeserializer extends AbstractInstructionDeserializer {
\r
31 public Instruction deserialize(ByteBuf input) {
\r
32 InstructionBuilder builder = super.processHeader(input);
\r
33 input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
\r
34 input.skipBytes(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);
\r
35 ActionsInstructionBuilder actionsBuilder =
\r
36 new ActionsInstructionBuilder();
\r
37 List<Action> actions = new ArrayList<>();
\r
38 actionsBuilder.setAction(actions);
\r
39 builder.addAugmentation(ActionsInstruction.class, actionsBuilder.build());
\r
40 return builder.build();
\r