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
23 public abstract class ExperimenterSerializerKeyFactory {
26 * @param msgVersion openflow wire version
27 * @param experimenterId experimenter / vendor ID
28 * @param type experimenter type according to vendor implementation
29 * @return key instance
31 public static ExperimenterIdSerializerKey<ExperimenterDataOfChoice> createExperimenterMessageSerializerKey(
32 short msgVersion, long experimenterId, long type) {
33 return new ExperimenterIdTypeSerializerKey<>(msgVersion, experimenterId, type, ExperimenterDataOfChoice.class);
37 * @param msgVersion openflow wire version
38 * @param experimenterId experimenter / vendor ID
39 * @param type experimenter type according to vendor implementation
40 * @return key instance
42 public static ExperimenterIdSerializerKey<ExperimenterDataOfChoice> createMultipartRequestSerializerKey(
43 short msgVersion, long experimenterId, long type) {
44 return new ExperimenterIdTypeSerializerKey<>(msgVersion, experimenterId, type, ExperimenterDataOfChoice.class);
48 * @param msgVersion openflow wire version
49 * @param experimenterId experimenter / vendor ID
50 * @return key instance
52 public static ExperimenterIdSerializerKey<TableFeatureProperties> createMultipartRequestTFSerializerKey(
53 short msgVersion, long experimenterId) {
54 return new ExperimenterIdSerializerKey<>(msgVersion, experimenterId, TableFeatureProperties.class);
58 * @param msgVersion openflow wire version
59 * @param experimenterId experimenter / vendor ID
60 * @return key instance
62 public static ExperimenterIdSerializerKey<MeterBandExperimenterCase> createMeterBandSerializerKey(
63 short msgVersion, long experimenterId) {
64 return new ExperimenterIdMeterSubTypeSerializerKey<>(msgVersion, experimenterId, MeterBandExperimenterCase.class, null);
67 public static ExperimenterIdSerializerKey<MeterBandExperimenterCase> createMeterBandSerializerKey(
68 short msgVersion, long experimenterId, Class<? extends ExperimenterMeterBandSubType> meterSubType) {
69 return new ExperimenterIdMeterSubTypeSerializerKey<>(msgVersion, experimenterId, MeterBandExperimenterCase.class, meterSubType);