X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowjava-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Futil%2FExperimenterSerializerKeyFactory.java;h=613cd804aef4ef069b6b47478f19aeacf9c61a32;hb=b7aa041859f3b74f0951d57edc5e4a9662c214ab;hp=36033d07b05aa1e67efca0f7c09f9736599afa0a;hpb=721e833bec7d967c8c3fa57db2bf80d8812c2c4e;p=openflowjava.git diff --git a/openflowjava-util/src/main/java/org/opendaylight/openflowjava/util/ExperimenterSerializerKeyFactory.java b/openflowjava-util/src/main/java/org/opendaylight/openflowjava/util/ExperimenterSerializerKeyFactory.java old mode 100644 new mode 100755 index 36033d07..613cd804 --- a/openflowjava-util/src/main/java/org/opendaylight/openflowjava/util/ExperimenterSerializerKeyFactory.java +++ b/openflowjava-util/src/main/java/org/opendaylight/openflowjava/util/ExperimenterSerializerKeyFactory.java @@ -8,36 +8,39 @@ package org.opendaylight.openflowjava.util; +import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdMeterSubTypeSerializerKey; import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdSerializerKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput; +import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdTypeSerializerKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterMeterBandSubType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.MeterBandExperimenterCase; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestExperimenterCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties; /** * @author michal.polkorab - * */ public abstract class ExperimenterSerializerKeyFactory { /** * @param msgVersion openflow wire version * @param experimenterId experimenter / vendor ID + * @param type experimenter type according to vendor implementation * @return key instance */ - public static ExperimenterIdSerializerKey createExperimenterMessageSerializerKey( - short msgVersion, Long experimenterId) { - return new ExperimenterIdSerializerKey<>(msgVersion, experimenterId, ExperimenterInput.class); + public static ExperimenterIdSerializerKey createExperimenterMessageSerializerKey( + short msgVersion, long experimenterId, long type) { + return new ExperimenterIdTypeSerializerKey<>(msgVersion, experimenterId, type, ExperimenterDataOfChoice.class); } /** * @param msgVersion openflow wire version * @param experimenterId experimenter / vendor ID + * @param type experimenter type according to vendor implementation * @return key instance */ - public static ExperimenterIdSerializerKey createMultipartRequestSerializerKey( - short msgVersion, Long experimenterId) { - return new ExperimenterIdSerializerKey<>(msgVersion, experimenterId, MultipartRequestExperimenterCase.class); + public static ExperimenterIdSerializerKey createMultipartRequestSerializerKey( + short msgVersion, long experimenterId, long type) { + return new ExperimenterIdTypeSerializerKey<>(msgVersion, experimenterId, type, ExperimenterDataOfChoice.class); } /** @@ -46,7 +49,7 @@ public abstract class ExperimenterSerializerKeyFactory { * @return key instance */ public static ExperimenterIdSerializerKey createMultipartRequestTFSerializerKey( - short msgVersion, Long experimenterId) { + short msgVersion, long experimenterId) { return new ExperimenterIdSerializerKey<>(msgVersion, experimenterId, TableFeatureProperties.class); } @@ -56,7 +59,12 @@ public abstract class ExperimenterSerializerKeyFactory { * @return key instance */ public static ExperimenterIdSerializerKey createMeterBandSerializerKey( - short msgVersion, Long experimenterId) { - return new ExperimenterIdSerializerKey<>(msgVersion, experimenterId, MeterBandExperimenterCase.class); + short msgVersion, long experimenterId) { + return new ExperimenterIdMeterSubTypeSerializerKey<>(msgVersion, experimenterId, MeterBandExperimenterCase.class, null); + } + + public static ExperimenterIdSerializerKey createMeterBandSerializerKey( + short msgVersion, long experimenterId, Class meterSubType) { + return new ExperimenterIdMeterSubTypeSerializerKey<>(msgVersion, experimenterId, MeterBandExperimenterCase.class, meterSubType); } } \ No newline at end of file