2 * Copyright (c) 2014 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
9 package org.opendaylight.openflowjava.util;
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;
20 * @author michal.polkorab
22 public abstract class ExperimenterSerializerKeyFactory {
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
30 public static ExperimenterIdSerializerKey<ExperimenterDataOfChoice> createExperimenterMessageSerializerKey(
31 short msgVersion, long experimenterId, long type) {
32 return new ExperimenterIdTypeSerializerKey<>(msgVersion, experimenterId, type, ExperimenterDataOfChoice.class);
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
41 public static ExperimenterIdSerializerKey<ExperimenterDataOfChoice> createMultipartRequestSerializerKey(
42 short msgVersion, long experimenterId, long type) {
43 return new ExperimenterIdTypeSerializerKey<>(msgVersion, experimenterId, type, ExperimenterDataOfChoice.class);
47 * @param msgVersion openflow wire version
48 * @param experimenterId experimenter / vendor ID
49 * @return key instance
51 public static ExperimenterIdSerializerKey<TableFeatureProperties> createMultipartRequestTFSerializerKey(
52 short msgVersion, long experimenterId) {
53 return new ExperimenterIdSerializerKey<>(msgVersion, experimenterId, TableFeatureProperties.class);
57 * @param msgVersion openflow wire version
58 * @param experimenterId experimenter / vendor ID
59 * @return key instance
61 public static ExperimenterIdSerializerKey<MeterBandExperimenterCase> createMeterBandSerializerKey(
62 short msgVersion, long experimenterId) {
63 return new ExperimenterIdMeterSubTypeSerializerKey<>(msgVersion, experimenterId, MeterBandExperimenterCase.class, null);
66 public static ExperimenterIdSerializerKey<MeterBandExperimenterCase> createMeterBandSerializerKey(
67 short msgVersion, long experimenterId, Class<? extends ExperimenterMeterBandSubType> meterSubType) {
68 return new ExperimenterIdMeterSubTypeSerializerKey<>(msgVersion, experimenterId, MeterBandExperimenterCase.class, meterSubType);