edc6f25ea5be312689e9c7e433bca0a635d93866
[openflowjava.git] / openflowjava-util / src / main / java / org / opendaylight / openflowjava / util / ExperimenterSerializerKeyFactory.java
1 /*
2  * Copyright (c) 2014 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.util;
10
11 import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdSerializerKey;
12 import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdTypeSerializerKey;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.MeterBandExperimenterCase;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties;
16
17 /**
18  * @author michal.polkorab
19  *
20  */
21 public abstract class ExperimenterSerializerKeyFactory {
22
23     /**
24      * @param msgVersion openflow wire version
25      * @param experimenterId experimenter / vendor ID
26      * @param type experimenter type according to vendor implementation
27      * @return key instance
28      */
29     public static ExperimenterIdSerializerKey<ExperimenterDataOfChoice> createExperimenterMessageSerializerKey(
30             short msgVersion, long experimenterId, long type) {
31         return new ExperimenterIdTypeSerializerKey<>(msgVersion, experimenterId, type, ExperimenterDataOfChoice.class);
32     }
33
34     /**
35      * @param msgVersion openflow wire version
36      * @param experimenterId experimenter / vendor ID
37      * @param type experimenter type according to vendor implementation
38      * @return key instance
39      */
40     public static ExperimenterIdSerializerKey<ExperimenterDataOfChoice> createMultipartRequestSerializerKey(
41             short msgVersion, long experimenterId, long type) {
42         return new ExperimenterIdTypeSerializerKey<>(msgVersion, experimenterId, type, ExperimenterDataOfChoice.class);
43     }
44
45     /**
46      * @param msgVersion openflow wire version
47      * @param experimenterId experimenter / vendor ID
48      * @return key instance
49      */
50     public static ExperimenterIdSerializerKey<TableFeatureProperties> createMultipartRequestTFSerializerKey(
51             short msgVersion, long experimenterId) {
52         return new ExperimenterIdSerializerKey<>(msgVersion, experimenterId, TableFeatureProperties.class);
53     }
54
55     /**
56      * @param msgVersion openflow wire version
57      * @param experimenterId experimenter / vendor ID
58      * @return key instance
59      */
60     public static ExperimenterIdSerializerKey<MeterBandExperimenterCase> createMeterBandSerializerKey(
61             short msgVersion, long experimenterId) {
62         return new ExperimenterIdSerializerKey<>(msgVersion, experimenterId, MeterBandExperimenterCase.class);
63     }
64 }