Update MRI upstreams for Phosphorus
[openflowplugin.git] / extension / openflowplugin-extension-api / src / main / java / org / opendaylight / openflowplugin / extension / api / ConverterMessageToOFJava.java
1 /*
2  * Copyright (c) 2015 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.openflowplugin.extension.api.exception.ConversionException;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.experimenter.core.message.ExperimenterMessageOfChoice;
13 import org.opendaylight.yangtools.yang.binding.DataContainer;
14 import org.opendaylight.yangtools.yang.common.Uint32;
15
16 /**
17  * Convert message from MD-SAL model into OFJava-API model.
18  *
19  * @param <F> input message model - MD-SAL model
20  * @param <T> output message model - OFJava-API
21  */
22 public interface ConverterMessageToOFJava<F extends ExperimenterMessageOfChoice, T extends DataContainer,
23         D extends ConvertorData> {
24
25     /**
26      * Converts a message to MD-SAL model.
27      *
28      * @param experimenterMessageCase where is vendor's augmentation
29      * @param data which contains the Xid and datapathId
30      * @return message converted to OFJava-API
31      * @throws ConversionException if given argument is none of valid types
32      */
33     T convert(F experimenterMessageCase, D data) throws ConversionException;
34
35     /**
36      * Returns the corresponding experimenter id (vendor id).
37      * @return experimenter id
38      */
39     ExperimenterId getExperimenterId();
40
41     /**
42      * Returns the corresponding experimenter message type.
43      * @return experimenter message type.
44      */
45     Uint32 getType();
46 }