Mass replace CRLF->LF
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / deserialization / InstructionDeserializerInitializer.java
1 /*
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.openflowjava.protocol.impl.deserialization;
10
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;
20
21 /**
22  * @author michal.polkorab
23  *
24  */
25 public final class InstructionDeserializerInitializer {
26
27     private InstructionDeserializerInitializer() {
28         throw new UnsupportedOperationException("Utility class shouldn't be instantiated");
29     }
30
31     /**
32      * Registers instruction deserializers
33      * @param registry registry to be filled with deserializers
34      */
35     public static void registerDeserializers(DeserializerRegistry registry) {
36         // register OF v1.3 instruction deserializers
37         InstructionDeserializerRegistryHelper helper =
38                 new InstructionDeserializerRegistryHelper(EncodeConstants.OF13_VERSION_ID, registry);
39         helper.registerDeserializer(1, new GoToTableInstructionDeserializer());
40         helper.registerDeserializer(2, new WriteMetadataInstructionDeserializer());
41         helper.registerDeserializer(3, new WriteActionsInstructionDeserializer());
42         helper.registerDeserializer(4, new ApplyActionsInstructionDeserializer());
43         helper.registerDeserializer(5, new ClearActionsInstructionDeserializer());
44         helper.registerDeserializer(6, new MeterInstructionDeserializer());
45     }
46 }