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.ActionUtil;
16 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.OrderComparator;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.Action;
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.WriteActions;
21 public class WriteActionsTablePropertySerializer extends AbstractTablePropertySerializer<WriteActions> implements
22 SerializerRegistryInjector {
24 private SerializerRegistry registry;
27 protected void serializeProperty(final WriteActions property, final ByteBuf byteBuf) {
33 .sorted(OrderComparator.build())
34 .map(Action::getAction)
35 .forEach(action -> ActionUtil
38 EncodeConstants.OF13_VERSION_ID,
44 protected TableFeaturesPropType getType() {
45 return TableFeaturesPropType.OFPTFPTWRITEACTIONS;
49 protected Class<WriteActions> getClazz() {
50 return WriteActions.class;
54 public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
55 registry = serializerRegistry;