2 * Copyright (c) 2013 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.openflowjava.protocol.impl.serialization;
11 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
12 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
13 import org.opendaylight.openflowjava.protocol.impl.serialization.instruction.ApplyActionsInstructionSerializer;
14 import org.opendaylight.openflowjava.protocol.impl.serialization.instruction.ClearActionsInstructionSerializer;
15 import org.opendaylight.openflowjava.protocol.impl.serialization.instruction.GoToTableInstructionSerializer;
16 import org.opendaylight.openflowjava.protocol.impl.serialization.instruction.MeterInstructionSerializer;
17 import org.opendaylight.openflowjava.protocol.impl.serialization.instruction.WriteActionsInstructionSerializer;
18 import org.opendaylight.openflowjava.protocol.impl.serialization.instruction.WriteMetadataInstructionSerializer;
19 import org.opendaylight.openflowjava.protocol.impl.util.InstructionSerializerRegistryHelper;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ApplyActions;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ClearActions;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.GotoTable;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.Meter;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.WriteActions;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.WriteMetadata;
28 * @author michal.polkorab
31 public final class InstructionsInitializer {
33 private InstructionsInitializer() {
34 throw new UnsupportedOperationException("Utility class shouldn't be instantiated");
38 * Registers instruction serializers into provided registry
39 * @param serializerRegistry registry to be initialized with instruction serializers
41 public static void registerInstructionSerializers(SerializerRegistry serializerRegistry) {
42 // register OF v1.3 instruction serializers
43 InstructionSerializerRegistryHelper helper= new InstructionSerializerRegistryHelper(
44 EncodeConstants.OF13_VERSION_ID, serializerRegistry);
45 helper.registerSerializer(GotoTable.class, new GoToTableInstructionSerializer());
46 helper.registerSerializer(WriteMetadata.class, new WriteMetadataInstructionSerializer());
47 helper.registerSerializer(WriteActions.class, new WriteActionsInstructionSerializer());
48 helper.registerSerializer(ApplyActions.class, new ApplyActionsInstructionSerializer());
49 helper.registerSerializer(ClearActions.class, new ClearActionsInstructionSerializer());
50 helper.registerSerializer(Meter.class, new MeterInstructionSerializer());