2 * Copyright (c) 2017 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
9 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
11 import io.netty.buffer.ByteBuf;
12 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
13 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
14 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
15 import org.opendaylight.openflowplugin.impl.protocol.serialization.util.InstructionUtil;
16 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.OrderComparator;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Instruction;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMiss;
21 public class InstructionsMissTablePropertySerializer extends
22 AbstractTablePropertySerializer<InstructionsMiss> implements SerializerRegistryInjector {
24 private SerializerRegistry registry;
27 protected void serializeProperty(final InstructionsMiss property, final ByteBuf byteBuf) {
29 .getInstructionsMiss()
32 .sorted(OrderComparator.build())
33 .map(Instruction::getInstruction)
34 .forEach(instruction -> InstructionUtil
35 .writeInstructionHeader(
37 EncodeConstants.OF13_VERSION_ID,
43 protected TableFeaturesPropType getType() {
44 return TableFeaturesPropType.OFPTFPTINSTRUCTIONSMISS;
48 protected Class<InstructionsMiss> getClazz() {
49 return InstructionsMiss.class;
53 public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
54 registry = serializerRegistry;