Updated extension registration keys
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / deserialization / InstructionDeserializerInitializer.java
1 /*\r
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 \r
9 package org.opendaylight.openflowjava.protocol.impl.deserialization;\r
10 \r
11 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;\r
12 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;\r
13 import org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.ApplyActionsInstructionDeserializer;\r
14 import org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.ClearActionsInstructionDeserializer;\r
15 import org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.GoToTableInstructionDeserializer;\r
16 import org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.MeterInstructionDeserializer;\r
17 import org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.WriteActionsInstructionDeserializer;\r
18 import org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.WriteMetadataInstructionDeserializer;\r
19 import org.opendaylight.openflowjava.protocol.impl.util.InstructionDeserializerRegistryHelper;\r
20 \r
21 /**\r
22  * @author michal.polkorab\r
23  *\r
24  */\r
25 public class InstructionDeserializerInitializer {\r
26 \r
27     /**\r
28      * Registers instruction deserializers\r
29      * @param registry registry to be filled with deserializers\r
30      */\r
31     public static void registerDeserializers(DeserializerRegistry registry) {\r
32         // register OF v1.3 instruction deserializers\r
33         InstructionDeserializerRegistryHelper helper =\r
34                 new InstructionDeserializerRegistryHelper(EncodeConstants.OF13_VERSION_ID, registry);\r
35         helper.registerDeserializer(1, new GoToTableInstructionDeserializer());\r
36         helper.registerDeserializer(2, new WriteMetadataInstructionDeserializer());\r
37         helper.registerDeserializer(3, new WriteActionsInstructionDeserializer());\r
38         helper.registerDeserializer(4, new ApplyActionsInstructionDeserializer());\r
39         helper.registerDeserializer(5, new ClearActionsInstructionDeserializer());\r
40         helper.registerDeserializer(6, new MeterInstructionDeserializer());\r
41     }\r
42 }