Remove bundle extension (de)serializers
[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.ExperimenterIdMeterSubTypeSerializerKey;
12 import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdSerializerKey;
13 import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdTypeSerializerKey;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterMeterBandSubType;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.MeterBandExperimenterCase;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties;
18
19 /**
20  * @author michal.polkorab
21  */
22 public abstract class ExperimenterSerializerKeyFactory {
23
24     /**
25      * @param msgVersion openflow wire version
26      * @param experimenterId experimenter / vendor ID
27      * @param type experimenter type according to vendor implementation
28      * @return key instance
29      */
30     public static ExperimenterIdSerializerKey<ExperimenterDataOfChoice> createExperimenterMessageSerializerKey(
31             short msgVersion, long experimenterId, long type) {
32         return new ExperimenterIdTypeSerializerKey<>(msgVersion, experimenterId, type, ExperimenterDataOfChoice.class);
33     }
34
35     /**
36      * @param msgVersion openflow wire version
37      * @param experimenterId experimenter / vendor ID
38      * @param type experimenter type according to vendor implementation
39      * @return key instance
40      */
41     public static ExperimenterIdSerializerKey<ExperimenterDataOfChoice> createMultipartRequestSerializerKey(
42             short msgVersion, long experimenterId, long type) {
43         return new ExperimenterIdTypeSerializerKey<>(msgVersion, experimenterId, type, ExperimenterDataOfChoice.class);
44     }
45
46     /**
47      * @param msgVersion openflow wire version
48      * @param experimenterId experimenter / vendor ID
49      * @return key instance
50      */
51     public static ExperimenterIdSerializerKey<TableFeatureProperties> createMultipartRequestTFSerializerKey(
52             short msgVersion, long experimenterId) {
53         return new ExperimenterIdSerializerKey<>(msgVersion, experimenterId, TableFeatureProperties.class);
54     }
55
56     /**
57      * @param msgVersion openflow wire version
58      * @param experimenterId experimenter / vendor ID
59      * @return key instance
60      */
61     public static ExperimenterIdSerializerKey<MeterBandExperimenterCase> createMeterBandSerializerKey(
62             short msgVersion, long experimenterId) {
63         return new ExperimenterIdMeterSubTypeSerializerKey<>(msgVersion, experimenterId, MeterBandExperimenterCase.class, null);
64     }
65
66     public static ExperimenterIdSerializerKey<MeterBandExperimenterCase> createMeterBandSerializerKey(
67             short msgVersion, long experimenterId, Class<? extends ExperimenterMeterBandSubType> meterSubType) {
68         return new ExperimenterIdMeterSubTypeSerializerKey<>(msgVersion, experimenterId, MeterBandExperimenterCase.class, meterSubType);
69     }
70
71 }