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
8 package org.opendaylight.openflowjava.protocol.impl.util;
10 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
11 import org.opendaylight.openflowjava.protocol.api.extensibility.OFGeneralDeserializer;
12 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
15 * @author michal.polkorab
18 public class MatchEntryDeserializerRegistryHelper {
20 private short version;
21 private DeserializerRegistry registry;
25 * @param version wire protocol version
26 * @param oxmClass oxm_class that will be used for match entry deserializer
28 * @param deserializerRegistry registry to be filled with message deserializers
30 public MatchEntryDeserializerRegistryHelper(short version, int oxmClass,
31 DeserializerRegistry deserializerRegistry) {
32 this.version = version;
33 this.oxmClass = oxmClass;
34 this.registry = deserializerRegistry;
38 * Registers match entry deserializer under provided oxmfield ()
39 * @param oxmField oxm_field value/code
40 * @param deserializer deserializer instance
42 public void register(int oxmField, OFGeneralDeserializer deserializer) {
43 MatchEntryDeserializerKey key = new MatchEntryDeserializerKey(version, oxmClass, oxmField);
44 key.setExperimenterId(null);
45 registry.registerDeserializer(key, deserializer);