2 * Copyright (c) 2016 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.openflowplugin.impl.protocol.deserialization.action;
10 import io.netty.buffer.ByteBuf;
11 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
12 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
13 import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;
14 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder;
19 public class OutputActionDeserializer extends AbstractActionDeserializer {
22 public Action deserialize(ByteBuf message) {
23 processHeader(message);
25 final Uri portUri = OpenflowPortsUtil
26 .getProtocolAgnosticPortUri(EncodeConstants.OF13_VERSION_ID, message.readUnsignedInt());
28 final int maxLength = message.readUnsignedShort();
29 message.skipBytes(ActionConstants.OUTPUT_PADDING);
31 return new OutputActionCaseBuilder()
32 .setOutputAction(new OutputActionBuilder()
33 .setOutputNodeConnector(portUri)
34 .setMaxLength(maxLength)
40 public Action deserializeHeader(ByteBuf message) {
41 processHeader(message);
42 return new OutputActionCaseBuilder().build();