745ad1454e897f4412e786a1d66160f79fbf65fe
[openflowplugin.git] / extension / openflowplugin-extension-api / src / main / java / org / opendaylight / openflowplugin / extension / api / ExtensionConverterRegistrator.java
1 /**
2  * Copyright (c) 2014 Cisco Systems, Inc. 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 package org.opendaylight.openflowplugin.extension.api;
9
10 import org.opendaylight.openflowjava.protocol.api.keys.ActionSerializerKey;
11 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
12 import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
13 import org.opendaylight.openflowplugin.extension.api.path.MatchPath;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.ExtensionKey;
19 import org.opendaylight.yangtools.concepts.ObjectRegistration;
20
21 /**
22  * registration place for message converters provided by vendor extension
23  */
24 public interface ExtensionConverterRegistrator {
25
26
27     ObjectRegistration<ConvertorToOFJava<MatchEntry>> registerMatchConvertor(
28             ConverterExtensionKey<? extends ExtensionKey> key, ConvertorToOFJava<MatchEntry> convertor);
29
30     ObjectRegistration<ConvertorFromOFJava<MatchEntry, MatchPath>> registerMatchConvertor(
31             MatchEntrySerializerKey<? extends OxmClassBase, ? extends MatchField> key,
32             ConvertorFromOFJava<MatchEntry, MatchPath> convertor);
33
34     /**
35      * @param key       action case type + ofp-version
36      * @param convertor
37      * @return closable registration
38      */
39     ObjectRegistration<ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>>
40     registerActionConvertor(
41             TypeVersionKey<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action> key,
42             ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action> convertor);
43
44     /**
45      * @param key       actionSubType, action type (Experimenter), experimenterId, version
46      * @param convertor
47      * @return closable registration
48      */
49     ObjectRegistration<ConvertorActionFromOFJava<Action, ActionPath>> registerActionConvertor(
50             ActionSerializerKey<?> key, ConvertorActionFromOFJava<Action, ActionPath> convertor);
51 }