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.deserialization;
11 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
12 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
13 import org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.ApplyActionsInstructionDeserializer;
14 import org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.ClearActionsInstructionDeserializer;
15 import org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.GoToTableInstructionDeserializer;
16 import org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.MeterInstructionDeserializer;
17 import org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.WriteActionsInstructionDeserializer;
18 import org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.WriteMetadataInstructionDeserializer;
19 import org.opendaylight.openflowjava.protocol.impl.util.InstructionDeserializerRegistryHelper;
22 * Utilities for registering nstruction deserializer initializers.
24 * @author michal.polkorab
26 public final class InstructionDeserializerInitializer {
28 private InstructionDeserializerInitializer() {
29 throw new UnsupportedOperationException("Utility class shouldn't be instantiated");
33 * Registers instruction deserializers.
35 * @param registry registry to be filled with deserializers
37 public static void registerDeserializers(final DeserializerRegistry registry) {
38 // register OF v1.3 instruction deserializers
39 InstructionDeserializerRegistryHelper helper =
40 new InstructionDeserializerRegistryHelper(EncodeConstants.OF_VERSION_1_3, registry);
41 helper.registerDeserializer(1, new GoToTableInstructionDeserializer());
42 helper.registerDeserializer(2, new WriteMetadataInstructionDeserializer());
43 helper.registerDeserializer(3, new WriteActionsInstructionDeserializer());
44 helper.registerDeserializer(4, new ApplyActionsInstructionDeserializer());
45 helper.registerDeserializer(5, new ClearActionsInstructionDeserializer());
46 helper.registerDeserializer(6, new MeterInstructionDeserializer());