BufferHelper.checkHeaderV13(builtByFactory);
Assert.assertEquals("Wrong type", 7, builtByFactory.getType().getIntValue());
- Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE());
+ Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().getOFPMPFREQMORE());
MultipartReplyGroupDescCase messageCase = (MultipartReplyGroupDescCase) builtByFactory.getMultipartReplyBody();
MultipartReplyGroupDesc message = messageCase.getMultipartReplyGroupDesc();
Assert.assertEquals("Wrong type", 1, message.getGroupDesc().get(0).getType().getIntValue());
BufferHelper.checkHeaderV13(builtByFactory);
Assert.assertEquals("Wrong type", 7, builtByFactory.getType().getIntValue());
- Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE());
+ Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().getOFPMPFREQMORE());
MultipartReplyGroupDescCase messageCase = (MultipartReplyGroupDescCase) builtByFactory.getMultipartReplyBody();
MultipartReplyGroupDesc message = messageCase.getMultipartReplyGroupDesc();
Assert.assertEquals("Wrong type", 1,
LOG.info("onSystemBootReady() received, starting the switch connections");
Futures.addCallback(Futures.allAsList(switchConnectionProviders.stream().map(switchConnectionProvider -> {
// Inject OpenFlowPlugin custom serializers and deserializers into OpenFlowJava
- if (config.isUseSingleLayerSerialization()) {
+ if (config.getUseSingleLayerSerialization()) {
SerializerInjector.injectSerializers(switchConnectionProvider,
switchConnectionProvider.getConfiguration().isGroupAddModEnabled());
DeserializerInjector.injectDeserializers(switchConnectionProvider);
final ListenableFuture<List<Boolean>> listListenableFuture =
Futures.allAsList(switchConnectionProviders.stream().map(switchConnectionProvider -> {
// Revert deserializers to their original state
- if (config.isUseSingleLayerSerialization()) {
+ if (config.getUseSingleLayerSerialization()) {
DeserializerInjector.revertDeserializers(switchConnectionProvider);
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.common;
import java.util.ArrayList;
List<Class<? extends GroupType>> supportedGroups =
new ArrayList<>();
- if (replyBody.getTypes().isOFPGTALL()) {
+ if (replyBody.getTypes().getOFPGTALL()) {
supportedGroups.add(GroupAll.class);
}
- if (replyBody.getTypes().isOFPGTSELECT()) {
+ if (replyBody.getTypes().getOFPGTSELECT()) {
supportedGroups.add(GroupSelect.class);
}
- if (replyBody.getTypes().isOFPGTINDIRECT()) {
+ if (replyBody.getTypes().getOFPGTINDIRECT()) {
supportedGroups.add(GroupIndirect.class);
}
- if (replyBody.getTypes().isOFPGTFF()) {
+ if (replyBody.getTypes().getOFPGTFF()) {
supportedGroups.add(GroupFf.class);
}
message.setGroupTypesSupported(supportedGroups);
List<Class<? extends GroupCapability>> supportedCapabilities =
new ArrayList<>();
- if (replyBody.getCapabilities().isOFPGFCCHAINING()) {
+ if (replyBody.getCapabilities().getOFPGFCCHAINING()) {
supportedCapabilities.add(Chaining.class);
}
- if (replyBody.getCapabilities().isOFPGFCCHAININGCHECKS()) {
+ if (replyBody.getCapabilities().getOFPGFCCHAININGCHECKS()) {
supportedCapabilities.add(ChainingChecks.class);
}
- if (replyBody.getCapabilities().isOFPGFCSELECTLIVENESS()) {
+ if (replyBody.getCapabilities().getOFPGFCSELECTLIVENESS()) {
supportedCapabilities.add(SelectLiveness.class);
}
- if (replyBody.getCapabilities().isOFPGFCSELECTWEIGHT()) {
+ if (replyBody.getCapabilities().getOFPGFCSELECTWEIGHT()) {
supportedCapabilities.add(SelectWeight.class);
}
List<Class<? extends MeterCapability>> supportedCapabilities =
new ArrayList<>();
- if (replyBody.getCapabilities().isOFPMFBURST()) {
+ if (replyBody.getCapabilities().getOFPMFBURST()) {
supportedCapabilities.add(MeterBurst.class);
}
- if (replyBody.getCapabilities().isOFPMFKBPS()) {
+ if (replyBody.getCapabilities().getOFPMFKBPS()) {
supportedCapabilities.add(MeterKbps.class);
}
- if (replyBody.getCapabilities().isOFPMFPKTPS()) {
+ if (replyBody.getCapabilities().getOFPMFPKTPS()) {
supportedCapabilities.add(MeterPktps.class);
}
- if (replyBody.getCapabilities().isOFPMFSTATS()) {
+ if (replyBody.getCapabilities().getOFPMFSTATS()) {
supportedCapabilities.add(MeterStats.class);
}
message.setMeterCapabilitiesSupported(supportedCapabilities);
- List<Class<? extends MeterBand>> supportedMeterBand =
- new ArrayList<>();
- if (replyBody.getBandTypes().isOFPMBTDROP()) {
+ List<Class<? extends MeterBand>> supportedMeterBand = new ArrayList<>();
+ if (replyBody.getBandTypes().getOFPMBTDROP()) {
supportedMeterBand.add(MeterBandDrop.class);
}
- if (replyBody.getBandTypes().isOFPMBTDSCPREMARK()) {
+ if (replyBody.getBandTypes().getOFPMBTDSCPREMARK()) {
supportedMeterBand.add(MeterBandDscpRemark.class);
}
message.setMeterBandSupported(supportedMeterBand);
MultipartReplyQueueCase caseBody = (MultipartReplyQueueCase) msg.getMultipartReplyBody();
MultipartReplyQueue replyBody = caseBody.getMultipartReplyQueue();
- List<QueueIdAndStatisticsMap> statsMap =
- new ArrayList<>();
+ List<QueueIdAndStatisticsMap> statsMap = new ArrayList<>();
- for (QueueStats queueStats : replyBody.getQueueStats()) {
+ for (QueueStats queueStats : replyBody.nonnullQueueStats()) {
QueueIdAndStatisticsMapBuilder statsBuilder =
new QueueIdAndStatisticsMapBuilder();
return message.build();
}
-
}
.put(ConfigurationProperty.GLOBAL_NOTIFICATION_QUOTA.toString(),
providerConfig.getGlobalNotificationQuota().toString())
.put(ConfigurationProperty.SWITCH_FEATURES_MANDATORY.toString(),
- providerConfig.isSwitchFeaturesMandatory().toString())
+ providerConfig.getSwitchFeaturesMandatory().toString())
.put(ConfigurationProperty.ENABLE_FLOW_REMOVED_NOTIFICATION.toString(),
- providerConfig.isEnableFlowRemovedNotification().toString())
+ providerConfig.getEnableFlowRemovedNotification().toString())
.put(ConfigurationProperty.IS_STATISTICS_RPC_ENABLED.toString(),
- providerConfig.isIsStatisticsRpcEnabled().toString())
+ providerConfig.getIsStatisticsRpcEnabled().toString())
.put(ConfigurationProperty.BARRIER_COUNT_LIMIT.toString(),
providerConfig.getBarrierCountLimit().getValue().toString())
.put(ConfigurationProperty.BARRIER_INTERVAL_TIMEOUT_LIMIT.toString(),
.put(ConfigurationProperty.ECHO_REPLY_TIMEOUT.toString(),
providerConfig.getEchoReplyTimeout().getValue().toString())
.put(ConfigurationProperty.IS_STATISTICS_POLLING_ON.toString(),
- providerConfig.isIsStatisticsPollingOn().toString())
+ providerConfig.getIsStatisticsPollingOn().toString())
.put(ConfigurationProperty.IS_TABLE_STATISTICS_POLLING_ON.toString(),
- providerConfig.isIsTableStatisticsPollingOn().toString())
+ providerConfig.getIsTableStatisticsPollingOn().toString())
.put(ConfigurationProperty.IS_FLOW_STATISTICS_POLLING_ON.toString(),
- providerConfig.isIsFlowStatisticsPollingOn().toString())
+ providerConfig.getIsFlowStatisticsPollingOn().toString())
.put(ConfigurationProperty.IS_GROUP_STATISTICS_POLLING_ON.toString(),
- providerConfig.isIsGroupStatisticsPollingOn().toString())
+ providerConfig.getIsGroupStatisticsPollingOn().toString())
.put(ConfigurationProperty.IS_METER_STATISTICS_POLLING_ON.toString(),
- providerConfig.isIsMeterStatisticsPollingOn().toString())
+ providerConfig.getIsMeterStatisticsPollingOn().toString())
.put(ConfigurationProperty.IS_PORT_STATISTICS_POLLING_ON.toString(),
- providerConfig.isIsPortStatisticsPollingOn().toString())
+ providerConfig.getIsPortStatisticsPollingOn().toString())
.put(ConfigurationProperty.IS_QUEUE_STATISTICS_POLLING_ON.toString(),
- providerConfig.isIsQueueStatisticsPollingOn().toString())
+ providerConfig.getIsQueueStatisticsPollingOn().toString())
.put(ConfigurationProperty.SKIP_TABLE_FEATURES.toString(),
- providerConfig.isSkipTableFeatures().toString())
+ providerConfig.getSkipTableFeatures().toString())
.put(ConfigurationProperty.BASIC_TIMER_DELAY.toString(),
providerConfig.getBasicTimerDelay().getValue().toString())
.put(ConfigurationProperty.MAXIMUM_TIMER_DELAY.toString(),
providerConfig.getMaximumTimerDelay().getValue().toString())
.put(ConfigurationProperty.USE_SINGLE_LAYER_SERIALIZATION.toString(),
- providerConfig.isUseSingleLayerSerialization().toString())
+ providerConfig.getUseSingleLayerSerialization().toString())
.put(ConfigurationProperty.THREAD_POOL_MIN_THREADS.toString(),
providerConfig.getThreadPoolMinThreads().toString())
.put(ConfigurationProperty.THREAD_POOL_MAX_THREADS.toString(),
final SystemNotificationsListener systemListener = new SystemNotificationsListenerImpl(connectionContext,
config.getEchoReplyTimeout().getValue().toJava(), executorService, notificationPublishService);
connectionAdapter.setSystemListener(systemListener);
- SslContextFactory.setIsCustomTrustManagerEnabled(config.isEnableCustomTrustManager());
+ SslContextFactory.setIsCustomTrustManagerEnabled(config.getEnableCustomTrustManager());
LOG.trace("connection ballet finished");
}
}
@Override
- public LocalDateTime getDeviceLastConnectionTime(BigInteger nodeId) {
+ public LocalDateTime getDeviceLastConnectionTime(final BigInteger nodeId) {
return deviceConnectionMap.get(nodeId);
}
@Override
- public void addDeviceLastConnectionTime(BigInteger nodeId, LocalDateTime time) {
+ public void addDeviceLastConnectionTime(final BigInteger nodeId, final LocalDateTime time) {
deviceConnectionMap.put(nodeId, time);
}
@Override
- public void removeDeviceLastConnectionTime(BigInteger nodeId) {
+ public void removeDeviceLastConnectionTime(final BigInteger nodeId) {
deviceConnectionMap.remove(nodeId);
}
@Override
- public void onDataTreeChanged(@NonNull Collection<DataTreeModification<Node>> changes) {
+ public void onDataTreeChanged(@NonNull final Collection<DataTreeModification<Node>> changes) {
Preconditions.checkNotNull(changes, "Changes must not be null!");
for (DataTreeModification<Node> change : changes) {
final DataObjectModification<Node> mod = change.getRootNode();
return InstanceIdentifier.create(Nodes.class).child(Node.class);
}
- private void processNodeModification(DataTreeModification<Node> change) {
+ private void processNodeModification(final DataTreeModification<Node> change) {
final InstanceIdentifier<Node> key = change.getRootPath().getRootIdentifier();
final InstanceIdentifier<Node> nodeIdent = key.firstIdentifierOf(Node.class);
String[] nodeIdentity = nodeIdent.firstKeyOf(Node.class).getId().getValue().split(":");
OpenflowVersion.get(features.getVersion()));
OF_EVENT_LOG.debug("Node Connector Status, Node: {}, PortNumber: {}, PortName: {}, Status: {}",
features.getDatapathId(), portNumber, stat.getName(),
- stat.getConfiguration().isPORTDOWN() ? "Down" : "Up");
+ stat.getConfiguration().getPORTDOWN() ? "Down" : "Up");
writeToTransaction(
getInstanceIdentifier()
* SwitchFeature builder for OF 1.0.
*/
public final class BuildSwitchCapabilitiesOF10 implements BuildSwitchFeatures {
-
- private static BuildSwitchCapabilitiesOF10 instance = new BuildSwitchCapabilitiesOF10();
+ private static final BuildSwitchCapabilitiesOF10 INSTANCE = new BuildSwitchCapabilitiesOF10();
private BuildSwitchCapabilitiesOF10() {
+ // Hidden on purpose
}
/**
* @return instance
*/
public static BuildSwitchCapabilitiesOF10 getInstance() {
- return instance;
+ return INSTANCE;
}
@Override
- public SwitchFeatures build(GetFeaturesOutput features) {
-
- SwitchFeaturesBuilder builderSwFeatures = new SwitchFeaturesBuilder();
- builderSwFeatures.setMaxBuffers(features.getBuffers());
- builderSwFeatures.setMaxTables(features.getTables());
-
+ public SwitchFeatures build(final GetFeaturesOutput features) {
List<Class<? extends FeatureCapability>> capabilities = new ArrayList<>();
-
- if (features.getCapabilitiesV10().isOFPCARPMATCHIP()) {
+ if (features.getCapabilitiesV10().getOFPCARPMATCHIP()) {
capabilities.add(FlowFeatureCapabilityArpMatchIp.class);
}
- if (features.getCapabilitiesV10().isOFPCFLOWSTATS()) {
+ if (features.getCapabilitiesV10().getOFPCFLOWSTATS()) {
capabilities.add(FlowFeatureCapabilityFlowStats.class);
}
- if (features.getCapabilitiesV10().isOFPCIPREASM()) {
+ if (features.getCapabilitiesV10().getOFPCIPREASM()) {
capabilities.add(FlowFeatureCapabilityIpReasm.class);
}
- if (features.getCapabilitiesV10().isOFPCPORTSTATS()) {
+ if (features.getCapabilitiesV10().getOFPCPORTSTATS()) {
capabilities.add(FlowFeatureCapabilityPortStats.class);
}
- if (features.getCapabilitiesV10().isOFPCQUEUESTATS()) {
+ if (features.getCapabilitiesV10().getOFPCQUEUESTATS()) {
capabilities.add(FlowFeatureCapabilityQueueStats.class);
}
- if (features.getCapabilitiesV10().isOFPCRESERVED()) {
+ if (features.getCapabilitiesV10().getOFPCRESERVED()) {
capabilities.add(FlowFeatureCapabilityReserved.class);
}
- if (features.getCapabilitiesV10().isOFPCSTP()) {
+ if (features.getCapabilitiesV10().getOFPCSTP()) {
capabilities.add(FlowFeatureCapabilityStp.class);
}
- if (features.getCapabilitiesV10().isOFPCTABLESTATS()) {
+ if (features.getCapabilitiesV10().getOFPCTABLESTATS()) {
capabilities.add(FlowFeatureCapabilityTableStats.class);
}
- builderSwFeatures.setCapabilities(capabilities);
-
- return builderSwFeatures.build();
+ return new SwitchFeaturesBuilder()
+ .setMaxBuffers(features.getBuffers())
+ .setMaxTables(features.getTables())
+ .setCapabilities(capabilities)
+ .build();
}
-
-
}
* SwitchFeature builder for OF 1.3.
*/
public final class BuildSwitchCapabilitiesOF13 implements BuildSwitchFeatures {
-
- private static BuildSwitchCapabilitiesOF13 instance = new BuildSwitchCapabilitiesOF13();
+ private static final BuildSwitchCapabilitiesOF13 INSTANCE = new BuildSwitchCapabilitiesOF13();
private BuildSwitchCapabilitiesOF13() {
+ // Hidden on purpose
}
/**
* @return instance
*/
public static BuildSwitchCapabilitiesOF13 getInstance() {
- return instance;
+ return INSTANCE;
}
@Override
- public SwitchFeatures build(GetFeaturesOutput features) {
-
- SwitchFeaturesBuilder builderSwFeatures = new SwitchFeaturesBuilder();
- builderSwFeatures.setMaxBuffers(features.getBuffers());
- builderSwFeatures.setMaxTables(features.getTables());
-
+ public SwitchFeatures build(final GetFeaturesOutput features) {
List<Class<? extends FeatureCapability>> capabilities = new ArrayList<>();
-
- if (features.getCapabilities().isOFPCFLOWSTATS()) {
+ if (features.getCapabilities().getOFPCFLOWSTATS()) {
capabilities.add(FlowFeatureCapabilityFlowStats.class);
}
- if (features.getCapabilities().isOFPCGROUPSTATS()) {
+ if (features.getCapabilities().getOFPCGROUPSTATS()) {
capabilities.add(FlowFeatureCapabilityGroupStats.class);
}
- if (features.getCapabilities().isOFPCIPREASM()) {
+ if (features.getCapabilities().getOFPCIPREASM()) {
capabilities.add(FlowFeatureCapabilityIpReasm.class);
}
- if (features.getCapabilities().isOFPCPORTBLOCKED()) {
+ if (features.getCapabilities().getOFPCPORTBLOCKED()) {
capabilities.add(FlowFeatureCapabilityPortBlocked.class);
}
- if (features.getCapabilities().isOFPCPORTSTATS()) {
+ if (features.getCapabilities().getOFPCPORTSTATS()) {
capabilities.add(FlowFeatureCapabilityPortStats.class);
}
- if (features.getCapabilities().isOFPCQUEUESTATS()) {
+ if (features.getCapabilities().getOFPCQUEUESTATS()) {
capabilities.add(FlowFeatureCapabilityQueueStats.class);
}
- if (features.getCapabilities().isOFPCTABLESTATS()) {
+ if (features.getCapabilities().getOFPCTABLESTATS()) {
capabilities.add(FlowFeatureCapabilityTableStats.class);
}
- builderSwFeatures.setCapabilities(capabilities);
-
- return builderSwFeatures.build();
+ return new SwitchFeaturesBuilder()
+ .setMaxBuffers(features.getBuffers())
+ .setMaxTables(features.getTables())
+ .setCapabilities(capabilities)
+ .build();
}
-
}
this.messageSpy = messageSpy;
DeviceInitializationUtil.makeEmptyNodes(dataBroker);
this.queuedNotificationManager = QueuedNotificationManager.create(executorService, (key, entries) -> {
- entries.forEach(jobEntry -> jobEntry.run());
+ entries.forEach(Runnable::run);
}, 2048, "port-status-queue");
}
messageSpy,
translatorLibrary,
convertorExecutor,
- config.isSkipTableFeatures(),
+ config.getSkipTableFeatures(),
hashedWheelTimer,
- config.isUseSingleLayerSerialization(),
+ config.getUseSingleLayerSerialization(),
deviceInitializerProvider,
- config.isEnableFlowRemovedNotification(),
- config.isSwitchFeaturesMandatory(),
+ config.getEnableFlowRemovedNotification(),
+ config.getSwitchFeaturesMandatory(),
contextChainHolder,
queuedNotificationManager,
- config.isIsStatisticsPollingOn());
+ config.getIsStatisticsPollingOn());
((ExtensionConverterProviderKeeper) deviceContext).setExtensionConverterProvider(extensionConverterProvider);
deviceContext.setNotificationPublishService(notificationPublishService);
}
@Override
- protected VlanId extractEntry(Match match) {
+ protected VlanId extractEntry(final Match match) {
final VlanMatch vlanMatch = match.getVlanMatch();
return vlanMatch == null ? null : vlanMatch.getVlanId();
}
@Override
- protected Empty extractEntryMask(VlanId entry) {
- return Boolean.TRUE.equals(entry.isVlanIdPresent())
+ protected Empty extractEntryMask(final VlanId entry) {
+ return Boolean.TRUE.equals(entry.getVlanIdPresent())
&& (entry.getVlanId() == null || entry.getVlanId().getValue().shortValue() == 0) ? Empty.getInstance()
: null;
}
@Override
- protected void serializeEntry(VlanId entry, Empty mask, ByteBuf outBuffer) {
+ protected void serializeEntry(final VlanId entry, final Empty mask, final ByteBuf outBuffer) {
final org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId vlanId = entry.getVlanId();
int vlanVidValue = vlanId != null ? vlanId.getValue().toJava() : 0;
- if (Boolean.TRUE.equals(entry.isVlanIdPresent())) {
+ if (Boolean.TRUE.equals(entry.getVlanIdPresent())) {
short cfi = 1 << 12;
vlanVidValue = vlanVidValue | cfi;
}
public class AsyncConfigMessageSerializer extends AbstractMessageSerializer<AsyncConfigMessage> {
@Override
- public void serialize(AsyncConfigMessage message, ByteBuf outBuffer) {
+ public void serialize(final AsyncConfigMessage message, final ByteBuf outBuffer) {
final int index = outBuffer.writerIndex();
super.serialize(message, outBuffer);
final Map<Integer, Boolean> map = new WeakHashMap<>();
- if (mask.isNOMATCH()) {
+ if (mask.getNOMATCH()) {
map.put(PacketInReason.OFPRNOMATCH.getIntValue(), true);
}
- if (mask.isACTION()) {
+ if (mask.getACTION()) {
map.put(PacketInReason.OFPRACTION.getIntValue(), true);
}
- if (mask.isINVALIDTTL()) {
+ if (mask.getINVALIDTTL()) {
map.put(PacketInReason.OFPRINVALIDTTL.getIntValue(), true);
}
final Map<Integer, Boolean> map = new WeakHashMap<>();
- if (mask.isADD()) {
+ if (mask.getADD()) {
map.put(PortReason.OFPPRADD.getIntValue(), true);
}
- if (mask.isDELETE()) {
+ if (mask.getDELETE()) {
map.put(PortReason.OFPPRDELETE.getIntValue(), true);
}
- if (mask.isUPDATE()) {
+ if (mask.getUPDATE()) {
map.put(PortReason.OFPPRMODIFY.getIntValue(), true);
}
final Map<Integer, Boolean> map = new WeakHashMap<>();
- if (mask.isIDLETIMEOUT()) {
+ if (mask.getIDLETIMEOUT()) {
map.put(FlowRemovedReason.OFPRRIDLETIMEOUT.getIntValue(), true);
}
- if (mask.isHARDTIMEOUT()) {
+ if (mask.getHARDTIMEOUT()) {
map.put(FlowRemovedReason.OFPRRHARDTIMEOUT.getIntValue(), true);
}
- if (mask.isDELETE()) {
+ if (mask.getDELETE()) {
map.put(FlowRemovedReason.OFPRRDELETE.getIntValue(), true);
}
- if (mask.isGROUPDELETE()) {
+ if (mask.getGROUPDELETE()) {
map.put(FlowRemovedReason.OFPRRGROUPDELETE.getIntValue(), true);
}
*/
private static Optional<Instruction> updateInstruction(final Instruction instruction, final Uint8 protocol) {
if (instruction instanceof ApplyActionsCase) {
- return Optional
- .ofNullable(((ApplyActionsCase) instruction).getApplyActions())
+ // FIXME: get rid of this atrocity and just use null checks
+ return Optional.ofNullable(((ApplyActionsCase) instruction).getApplyActions())
.flatMap(aa -> Optional.ofNullable(aa.nonnullAction()))
.map(as -> new ApplyActionsCaseBuilder()
.setApplyActions(new ApplyActionsBuilder()
- .setAction(as
- .values()
- .stream()
+ .setAction(as.values().stream()
.filter(Objects::nonNull)
.map(a -> updateSetTpActions(a, protocol))
.collect(Collectors.toList()))
final int[] offset = {0};
return i.getInstruction() instanceof ApplyActionsCase
- ? Optional
- .ofNullable(((ApplyActionsCase) i.getInstruction()).getApplyActions())
+ // FIXME: get rid of this atrocity and just use null checks
+ ? Optional.ofNullable(((ApplyActionsCase) i.getInstruction()).getApplyActions())
.flatMap(as -> Optional.ofNullable(as.nonnullAction()))
.map(a -> a.values().stream()
.sorted(OrderComparator.build())
*/
private static int createFlowModFlagsBitmask(final FlowModFlags flags) {
return ByteBufUtils.fillBitMask(0,
- flags.isSENDFLOWREM(),
- flags.isCHECKOVERLAP(),
- flags.isRESETCOUNTS(),
- flags.isNOPKTCOUNTS(),
- flags.isNOBYTCOUNTS());
+ flags.getSENDFLOWREM(),
+ flags.getCHECKOVERLAP(),
+ flags.getRESETCOUNTS(),
+ flags.getNOPKTCOUNTS(),
+ flags.getNOBYTCOUNTS());
}
/**
* @return true if flow contains vlan match
*/
private static boolean isVlanMatchPresent(final Flow flow) {
- return Optional
- .ofNullable(flow.getMatch())
+ // FIXME: get rid of this atrocity and just use null checks
+ return Optional.ofNullable(flow.getMatch())
.flatMap(m -> Optional.ofNullable(m.getVlanMatch()))
.isPresent();
}
* @return true if flow contains SetVlanIdAction
*/
private static boolean isSetVlanIdActionCasePresent(final Flow flow) {
- return Optional
- .ofNullable(flow.getInstructions())
+ // FIXME: get rid of this atrocity and just use null checks
+ return Optional.ofNullable(flow.getInstructions())
.flatMap(is -> Optional.ofNullable(is.nonnullInstruction()))
.flatMap(is -> is.values().stream()
.map(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types
private void serializeBands(final MeterBandHeaders meterBandHeaders, final ByteBuf outBuffer) {
if (meterBandHeaders != null && meterBandHeaders.getMeterBandHeader() != null) {
meterBandHeaders.nonnullMeterBandHeader().values().forEach(meterBandHeader ->
+ // FIXME: get rid of this atrocity and just use a null check
Optional.ofNullable(meterBandHeader.getMeterBandTypes())
.flatMap(m -> Optional.ofNullable(m.getFlags()))
.ifPresent(flags -> Optional.ofNullable(meterBandHeader.getBandType()).ifPresent(type -> {
- if (flags.isOfpmbtDrop()) {
+ if (flags.getOfpmbtDrop()) {
final Drop band = (Drop) type;
outBuffer.writeShort(MeterBandType.OFPMBTDROP.getIntValue());
outBuffer.writeInt(band.getDropRate().intValue());
outBuffer.writeInt(band.getDropBurstSize().intValue());
outBuffer.writeZero(PADDING_IN_METER_BAND_DROP);
- } else if (flags.isOfpmbtDscpRemark()) {
+ } else if (flags.getOfpmbtDscpRemark()) {
final DscpRemark band = (DscpRemark) type;
outBuffer.writeShort(MeterBandType.OFPMBTDSCPREMARK.getIntValue());
outBuffer.writeInt(band.getDscpRemarkBurstSize().intValue());
outBuffer.writeByte(band.getPrecLevel().toJava());
outBuffer.writeZero(PADDING_IN_METER_BAND_DSCP_REMARK);
- } else if (flags.isOfpmbtExperimenter()) {
+ } else if (flags.getOfpmbtExperimenter()) {
final Experimenter band = (Experimenter) type;
// TODO: finish experimenter serialization
private static int createMeterFlagsBitMask(final MeterFlags flags) {
return ByteBufUtils.fillBitMask(0,
- flags.isMeterKbps(),
- flags.isMeterPktps(),
- flags.isMeterBurst(),
- flags.isMeterStats());
+ flags.getMeterKbps(),
+ flags.getMeterPktps(),
+ flags.getMeterBurst(),
+ flags.getMeterStats());
}
}
private static Integer createPortConfigBitMask(final PortConfig config) {
return config == null ? null : ByteBufUtils.fillBitMaskFromMap(ImmutableMap
.<Integer, Boolean>builder()
- .put(0, config.isPORTDOWN())
- .put(2, config.isNORECV())
- .put(5, config.isNOFWD())
- .put(6, config.isNOPACKETIN())
+ .put(0, config.getPORTDOWN())
+ .put(2, config.getNORECV())
+ .put(5, config.getNOFWD())
+ .put(6, config.getNOPACKETIN())
.build());
}
private static int createPortFeaturesBitMask(final PortFeatures feature) {
return ByteBufUtils.fillBitMask(0,
- feature.isTenMbHd(),
- feature.isTenMbFd(),
- feature.isHundredMbHd(),
- feature.isHundredMbFd(),
- feature.isOneGbHd(),
- feature.isOneGbFd(),
- feature.isTenGbFd(),
- feature.isFortyGbFd(),
- feature.isHundredGbFd(),
- feature.isOneTbFd(),
- feature.isOther(),
- feature.isCopper(),
- feature.isFiber(),
- feature.isAutoeng(),
- feature.isPause(),
- feature.isPauseAsym());
+ feature.getTenMbHd(),
+ feature.getTenMbFd(),
+ feature.getHundredMbHd(),
+ feature.getHundredMbFd(),
+ feature.getOneGbHd(),
+ feature.getOneGbFd(),
+ feature.getTenGbFd(),
+ feature.getFortyGbFd(),
+ feature.getHundredGbFd(),
+ feature.getOneTbFd(),
+ feature.getOther(),
+ feature.getCopper(),
+ feature.getFiber(),
+ feature.getAutoeng(),
+ feature.getPause(),
+ feature.getPauseAsym());
}
-
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
import com.google.common.base.Preconditions;
final int index = outBuffer.writerIndex();
super.serialize(message, outBuffer);
outBuffer.writeShort(multipartType.getIntValue());
- outBuffer.writeShort(ByteBufUtils.fillBitMask(0, message.isRequestMore()));
+ outBuffer.writeShort(ByteBufUtils.fillBitMask(0, message.getRequestMore()));
outBuffer.writeZero(PADDING_IN_MULTIPART_REQUEST_MESSAGE);
final OFSerializer<MultipartRequestBody> serializer = Preconditions.checkNotNull(registry)
public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
registry = serializerRegistry;
}
-
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
import com.google.common.base.Preconditions;
byteBuf.writeZero(32 - tableFeature.getName().getBytes(StandardCharsets.UTF_8).length);
byteBuf.writeLong(tableFeature.getMetadataMatch().longValue());
byteBuf.writeLong(tableFeature.getMetadataWrite().longValue());
- byteBuf.writeInt(ByteBufUtils.fillBitMask(0, tableFeature.getConfig().isDEPRECATEDMASK()));
+ byteBuf.writeInt(ByteBufUtils.fillBitMask(0, tableFeature.getConfig().getDEPRECATEDMASK()));
byteBuf.writeInt(tableFeature.getMaxEntries().intValue());
serializeProperties(tableFeature.getTableProperties(), byteBuf);
byteBuf.setShort(featureIndex, byteBuf.writerIndex() - featureIndex);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
import io.netty.buffer.ByteBuf;
int fieldAndMask = getOxmFieldCode() << 1;
int length = getValueLength();
- if (setFieldMatch.isHasMask()) {
+ if (setFieldMatch.getHasMask()) {
fieldAndMask |= 1;
length *= 2;
}
protected abstract int getOxmFieldCode();
protected abstract int getValueLength();
-
}
this.timer = timer;
this.config = config;
this.executorService = executorService;
- slaveTask = timer.newTimeout((timerTask) -> makeDeviceSlave(), checkRoleMasterTimeout, TimeUnit.MILLISECONDS);
+ slaveTask = timer.newTimeout(timerTask -> makeDeviceSlave(), checkRoleMasterTimeout, TimeUnit.MILLISECONDS);
LOG.info("Started timer for setting SLAVE role on device {} if no role will be set in {}s.",
deviceInfo,
}
private ListenableFuture<RpcResult<SetRoleOutput>> sendRoleChangeToDevice(final OfpRole newRole) {
- final Boolean isEqualRole = config.isEnableEqualRole();
+ final Boolean isEqualRole = config.getEnableEqualRole();
if (isEqualRole) {
LOG.warn("Skip sending role change request to device {} as user enabled"
+ " equal role for controller", deviceInfo);
extensionConverterProvider,
convertorExecutor,
notificationPublishService,
- config.isIsStatisticsRpcEnabled(),
+ config.getIsStatisticsRpcEnabled(),
flowGroupCacheManager);
contexts.put(deviceContext.getDeviceInfo(), rpcContext);
import org.opendaylight.yangtools.yang.common.RpcResult;
public abstract class AbstractMultipartService<I, T extends OfHeader> extends AbstractService<I, List<T>> {
-
private static final Function<OfHeader, Boolean> ALTERNATE_IS_COMPLETE = message ->
- !(message instanceof MultipartReply) || !((MultipartReply) message).isRequestMore();
+ !(message instanceof MultipartReply) || !((MultipartReply) message).getRequestMore();
protected AbstractMultipartService(final RequestContextStack requestContextStack,
final DeviceContext deviceContext) {
}
@Override
- protected FutureCallback<OfHeader> createCallback(RequestContext<List<T>> context, Class<?> requestType) {
+ protected FutureCallback<OfHeader> createCallback(final RequestContext<List<T>> context,
+ final Class<?> requestType) {
return canUseSingleLayerSerialization()
? new SingleLayerMultipartRequestCallback<>(context, requestType, getDeviceContext(), getEventIdentifier())
: new MultiLayerMultipartRequestCallback<>(context, requestType, getDeviceContext(), getEventIdentifier());
? super.handleServiceCall(input, ALTERNATE_IS_COMPLETE)
: super.handleServiceCall(input);
}
-
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.services.multilayer;
import java.util.List;
}
@Override
- protected boolean isMultipart(OfHeader result) {
+ protected boolean isMultipart(final OfHeader result) {
return result instanceof MultipartReply
&& ((MultipartReply) result).getType().equals(getMultipartType());
}
@Override
- protected boolean isReqMore(T result) {
- return ((MultipartReply) result).getFlags().isOFPMPFREQMORE();
+ protected boolean isReqMore(final T result) {
+ return ((MultipartReply) result).getFlags().getOFPMPFREQMORE();
}
@Override
public class MultiLayerMultipartRequestCallback<T extends OfHeader> extends AbstractMultipartRequestCallback<T> {
- public MultiLayerMultipartRequestCallback(RequestContext<List<T>> context, Class<?> requestType,
- DeviceContext deviceContext,
- EventIdentifier eventIdentifier) {
+ public MultiLayerMultipartRequestCallback(final RequestContext<List<T>> context, final Class<?> requestType,
+ final DeviceContext deviceContext,
+ final EventIdentifier eventIdentifier) {
super(context, requestType, deviceContext, eventIdentifier);
}
@Override
- protected boolean isMultipart(OfHeader result) {
+ protected boolean isMultipart(final OfHeader result) {
return result instanceof MultipartReply;
}
@Override
- protected boolean isReqMore(T result) {
+ protected boolean isReqMore(final T result) {
final MultipartRequestFlags flags = ((MultipartReply) result).getFlags();
- return flags != null && flags.isOFPMPFREQMORE();
+ return flags != null && flags.getOFPMPFREQMORE();
}
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.services.sal;
import com.google.common.annotations.VisibleForTesting;
FlatBatchUtil.markBarriersWhereNeeded(batchPlan);
// prepare chain elements
final List<BatchStepJob> batchChainElements =
- prepareBatchChain(batchPlan, input.getNode(), input.isExitOnFirstError());
+ prepareBatchChain(batchPlan, input.getNode(), input.getExitOnFirstError());
// execute plan with barriers and collect outputs chain correspondingly, collect results
return executeBatchPlan(batchChainElements);
}
ListenableFuture<RpcResult<RemoveFlowsBatchOutput>> removeFlowsBulkFuture =
Futures.transform(commonResult, FlowUtil.FLOW_REMOVE_TRANSFORM, MoreExecutors.directExecutor());
- if (input.isBarrierAfter()) {
+ if (input.getBarrierAfter()) {
removeFlowsBulkFuture = BarrierUtil.chainBarrier(removeFlowsBulkFuture, input.getNode(),
transactionService, FlowUtil.FLOW_REMOVE_COMPOSING_TRANSFORM);
}
ListenableFuture<RpcResult<AddFlowsBatchOutput>> addFlowsBulkFuture =
Futures.transform(commonResult, FlowUtil.FLOW_ADD_TRANSFORM, MoreExecutors.directExecutor());
- if (input.isBarrierAfter()) {
+ if (input.getBarrierAfter()) {
addFlowsBulkFuture = BarrierUtil.chainBarrier(addFlowsBulkFuture, input.getNode(),
transactionService, FlowUtil.FLOW_ADD_COMPOSING_TRANSFORM);
}
ListenableFuture<RpcResult<UpdateFlowsBatchOutput>> updateFlowsBulkFuture =
Futures.transform(commonResult, FlowUtil.FLOW_UPDATE_TRANSFORM, MoreExecutors.directExecutor());
- if (input.isBarrierAfter()) {
+ if (input.getBarrierAfter()) {
updateFlowsBulkFuture = BarrierUtil.chainBarrier(updateFlowsBulkFuture, input.getNode(),
transactionService, FlowUtil.FLOW_UPDATE_COMPOSING_TRANSFORM);
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.services.sal;
import com.google.common.base.Preconditions;
ListenableFuture<RpcResult<UpdateGroupsBatchOutput>> updateGroupsBulkFuture = Futures
.transform(commonResult, GroupUtil.GROUP_UPDATE_TRANSFORM, MoreExecutors.directExecutor());
- if (input.isBarrierAfter()) {
+ if (input.getBarrierAfter()) {
updateGroupsBulkFuture = BarrierUtil
.chainBarrier(updateGroupsBulkFuture, input.getNode(), transactionService,
GroupUtil.GROUP_UPDATE_COMPOSING_TRANSFORM);
ListenableFuture<RpcResult<AddGroupsBatchOutput>> addGroupsBulkFuture = Futures
.transform(commonResult, GroupUtil.GROUP_ADD_TRANSFORM, MoreExecutors.directExecutor());
- if (input.isBarrierAfter()) {
+ if (input.getBarrierAfter()) {
addGroupsBulkFuture = BarrierUtil.chainBarrier(addGroupsBulkFuture, input.getNode(), transactionService,
GroupUtil.GROUP_ADD_COMPOSING_TRANSFORM);
}
ListenableFuture<RpcResult<RemoveGroupsBatchOutput>> removeGroupsBulkFuture = Futures
.transform(commonResult, GroupUtil.GROUP_REMOVE_TRANSFORM, MoreExecutors.directExecutor());
- if (input.isBarrierAfter()) {
+ if (input.getBarrierAfter()) {
removeGroupsBulkFuture = BarrierUtil
.chainBarrier(removeGroupsBulkFuture, input.getNode(), transactionService,
GroupUtil.GROUP_REMOVE_COMPOSING_TRANSFORM);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.services.sal;
import com.google.common.base.Preconditions;
ListenableFuture<RpcResult<UpdateMetersBatchOutput>> updateMetersBulkFuture =
Futures.transform(commonResult, MeterUtil.METER_UPDATE_TRANSFORM, MoreExecutors.directExecutor());
- if (input.isBarrierAfter()) {
+ if (input.getBarrierAfter()) {
updateMetersBulkFuture = BarrierUtil.chainBarrier(updateMetersBulkFuture, input.getNode(),
transactionService, MeterUtil.METER_UPDATE_COMPOSING_TRANSFORM);
}
ListenableFuture<RpcResult<AddMetersBatchOutput>> addMetersBulkFuture =
Futures.transform(commonResult, MeterUtil.METER_ADD_TRANSFORM, MoreExecutors.directExecutor());
- if (input.isBarrierAfter()) {
+ if (input.getBarrierAfter()) {
addMetersBulkFuture = BarrierUtil.chainBarrier(addMetersBulkFuture, input.getNode(),
transactionService, MeterUtil.METER_ADD_COMPOSING_TRANSFORM);
}
ListenableFuture<RpcResult<RemoveMetersBatchOutput>> removeMetersBulkFuture =
Futures.transform(commonResult, MeterUtil.METER_REMOVE_TRANSFORM, MoreExecutors.directExecutor());
- if (input.isBarrierAfter()) {
+ if (input.getBarrierAfter()) {
removeMetersBulkFuture = BarrierUtil.chainBarrier(removeMetersBulkFuture, input.getNode(),
transactionService, MeterUtil.METER_REMOVE_COMPOSING_TRANSFORM);
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.services.singlelayer;
import java.util.List;
}
@Override
- protected boolean isMultipart(OfHeader result) {
+ protected boolean isMultipart(final OfHeader result) {
return result instanceof MultipartReply
&& ((MultipartReply) result).getMultipartReplyBody() instanceof MultipartReplyFlowStats;
}
@Override
- protected boolean isReqMore(T result) {
- return ((MultipartReply) result).isRequestMore();
+ protected boolean isReqMore(final T result) {
+ return ((MultipartReply) result).getRequestMore();
}
@Override
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.services.singlelayer;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
final FlowMessageBuilder flowMessageBuilder = new FlowMessageBuilder(input);
final Class<? extends DataContainer> clazz = input.implementedInterface();
- if (clazz.equals(AddFlowInput.class)
- || clazz.equals(UpdatedFlow.class)) {
+ if (clazz.equals(AddFlowInput.class) || clazz.equals(UpdatedFlow.class)) {
flowMessageBuilder.setCommand(FlowModCommand.OFPFCADD);
- } else if (clazz.equals(RemoveFlowInput.class)
- || clazz.equals(OriginalFlow.class)) {
- flowMessageBuilder.setCommand(Boolean.TRUE.equals(input.isStrict())
- ? FlowModCommand.OFPFCDELETESTRICT
- : FlowModCommand.OFPFCDELETE);
+ } else if (clazz.equals(RemoveFlowInput.class) || clazz.equals(OriginalFlow.class)) {
+ flowMessageBuilder.setCommand(
+ Boolean.TRUE.equals(input.getStrict()) ? FlowModCommand.OFPFCDELETESTRICT : FlowModCommand.OFPFCDELETE);
}
return flowMessageBuilder
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.services.singlelayer;
import java.util.List;
public class SingleLayerMultipartRequestCallback<T extends OfHeader> extends AbstractMultipartRequestCallback<T> {
- public SingleLayerMultipartRequestCallback(RequestContext<List<T>> context,
- Class<?> requestType,
- DeviceContext deviceContext,
- EventIdentifier eventIdentifier) {
+ public SingleLayerMultipartRequestCallback(final RequestContext<List<T>> context,
+ final Class<?> requestType,
+ final DeviceContext deviceContext,
+ final EventIdentifier eventIdentifier) {
super(context, requestType, deviceContext, eventIdentifier);
}
@Override
- protected boolean isMultipart(OfHeader result) {
+ protected boolean isMultipart(final OfHeader result) {
return result instanceof MultipartReply;
}
@Override
- protected boolean isReqMore(T result) {
- return ((MultipartReply) result).isRequestMore();
+ protected boolean isReqMore(final T result) {
+ return ((MultipartReply) result).getRequestMore();
}
}
public void initializeDevice() {
final List<MultipartType> statListForCollecting = new ArrayList<>();
- if (devState.isGroupAvailable() && config.isIsGroupStatisticsPollingOn()) {
+ if (devState.isGroupAvailable() && config.getIsGroupStatisticsPollingOn()) {
statListForCollecting.add(MultipartType.OFPMPGROUPDESC);
statListForCollecting.add(MultipartType.OFPMPGROUP);
}
- if (devState.isMetersAvailable() && config.isIsMeterStatisticsPollingOn()) {
+ if (devState.isMetersAvailable() && config.getIsMeterStatisticsPollingOn()) {
statListForCollecting.add(MultipartType.OFPMPMETERCONFIG);
statListForCollecting.add(MultipartType.OFPMPMETER);
}
- if (devState.isFlowStatisticsAvailable() && config.isIsFlowStatisticsPollingOn()) {
+ if (devState.isFlowStatisticsAvailable() && config.getIsFlowStatisticsPollingOn()) {
statListForCollecting.add(MultipartType.OFPMPFLOW);
}
- if (devState.isTableStatisticsAvailable() && config.isIsTableStatisticsPollingOn()) {
+ if (devState.isTableStatisticsAvailable() && config.getIsTableStatisticsPollingOn()) {
statListForCollecting.add(MultipartType.OFPMPTABLE);
}
- if (devState.isPortStatisticsAvailable() && config.isIsPortStatisticsPollingOn()) {
+ if (devState.isPortStatisticsAvailable() && config.getIsPortStatisticsPollingOn()) {
statListForCollecting.add(MultipartType.OFPMPPORTSTATS);
}
- if (devState.isQueueStatisticsAvailable() && config.isIsQueueStatisticsPollingOn()) {
+ if (devState.isQueueStatisticsAvailable() && config.getIsQueueStatisticsPollingOn()) {
statListForCollecting.add(MultipartType.OFPMPQUEUE);
}
@Override
public ListenableFuture<RpcResult<GetStatisticsWorkModeOutput>> getStatisticsWorkMode(
- GetStatisticsWorkModeInput input) {
+ final GetStatisticsWorkModeInput input) {
return RpcResultBuilder.success(new GetStatisticsWorkModeOutputBuilder()
.setMode(workMode)
.build()).buildFuture();
@Override
public ListenableFuture<RpcResult<ChangeStatisticsWorkModeOutput>> changeStatisticsWorkMode(
- ChangeStatisticsWorkModeInput input) {
+ final ChangeStatisticsWorkModeInput input) {
if (workModeGuard.tryAcquire()) {
final StatisticsWorkMode targetWorkMode = input.getMode();
isStatisticsFullyDisabled = StatisticsWorkMode.FULLYDISABLED.equals(targetWorkMode);
statisticsWriterProvider,
executorService,
config,
- !isStatisticsFullyDisabled && config.isIsStatisticsPollingOn(),
+ !isStatisticsFullyDisabled && config.getIsStatisticsPollingOn(),
useReconciliationFramework);
contexts.put(deviceContext.getDeviceInfo(), statisticsContext);
private static final MultipartRequestGroupFeaturesCase GROUP_FEAT_CASE =
new MultipartRequestGroupFeaturesCaseBuilder().build();
- GroupFeaturesService(RequestContextStack requestContextStack,
- DeviceContext deviceContext,
- AtomicLong compatibilityXidSeed) {
+ GroupFeaturesService(final RequestContextStack requestContextStack,
+ final DeviceContext deviceContext,
+ final AtomicLong compatibilityXidSeed) {
super(requestContextStack, deviceContext, compatibilityXidSeed);
}
}
@Override
- public GetGroupFeaturesOutput buildTxCapableResult(TransactionId emulatedTxId) {
+ public GetGroupFeaturesOutput buildTxCapableResult(final TransactionId emulatedTxId) {
return new GetGroupFeaturesOutputBuilder().setTransactionId(emulatedTxId).build();
}
@Override
- public GroupFeaturesUpdated transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
+ public GroupFeaturesUpdated transformToNotification(final List<MultipartReply> result,
+ final TransactionId emulatedTxId) {
final int mpSize = result.size();
Preconditions.checkArgument(mpSize == 1, "unexpected (!=1) mp-reply size received: {}", mpSize);
}
@VisibleForTesting
- static List<Class<? extends GroupCapability>> extractSupportedCapabilities(GroupCapabilities capabilities) {
+ static List<Class<? extends GroupCapability>> extractSupportedCapabilities(final GroupCapabilities capabilities) {
List<Class<? extends GroupCapability>> supportedCapabilities = new ArrayList<>();
-
- if (capabilities.isOFPGFCCHAINING()) {
+ if (capabilities.getOFPGFCCHAINING()) {
supportedCapabilities.add(Chaining.class);
}
- if (capabilities.isOFPGFCCHAININGCHECKS()) {
+ if (capabilities.getOFPGFCCHAININGCHECKS()) {
supportedCapabilities.add(ChainingChecks.class);
}
- if (capabilities.isOFPGFCSELECTLIVENESS()) {
+ if (capabilities.getOFPGFCSELECTLIVENESS()) {
supportedCapabilities.add(SelectLiveness.class);
}
- if (capabilities.isOFPGFCSELECTWEIGHT()) {
+ if (capabilities.getOFPGFCSELECTWEIGHT()) {
supportedCapabilities.add(SelectWeight.class);
}
return supportedCapabilities;
}
@VisibleForTesting
- static List<Class<? extends GroupType>> extractSupportedGroupTypes(GroupTypes types) {
+ static List<Class<? extends GroupType>> extractSupportedGroupTypes(final GroupTypes types) {
List<Class<? extends GroupType>> supportedGroups = new ArrayList<>();
-
- if (types.isOFPGTALL()) {
+ if (types.getOFPGTALL()) {
supportedGroups.add(GroupAll.class);
}
- if (types.isOFPGTSELECT()) {
+ if (types.getOFPGTSELECT()) {
supportedGroups.add(GroupSelect.class);
}
- if (types.isOFPGTINDIRECT()) {
+ if (types.getOFPGTINDIRECT()) {
supportedGroups.add(GroupIndirect.class);
}
- if (types.isOFPGTFF()) {
+ if (types.getOFPGTFF()) {
supportedGroups.add(GroupFf.class);
}
return supportedGroups;
private static final MultipartRequestMeterFeaturesCase METER_FEATURES_CASE =
new MultipartRequestMeterFeaturesCaseBuilder().build();
- MeterFeaturesService(RequestContextStack requestContextStack,
- DeviceContext deviceContext,
- AtomicLong compatibilityXidSeed) {
+ MeterFeaturesService(final RequestContextStack requestContextStack,
+ final DeviceContext deviceContext,
+ final AtomicLong compatibilityXidSeed) {
super(requestContextStack, deviceContext, compatibilityXidSeed);
}
}
@Override
- public GetMeterFeaturesOutput buildTxCapableResult(TransactionId emulatedTxId) {
+ public GetMeterFeaturesOutput buildTxCapableResult(final TransactionId emulatedTxId) {
return new GetMeterFeaturesOutputBuilder().setTransactionId(emulatedTxId).build();
}
@Override
- public MeterFeaturesUpdated transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
+ public MeterFeaturesUpdated transformToNotification(final List<MultipartReply> result,
+ final TransactionId emulatedTxId) {
final int mpSize = result.size();
- Preconditions.checkArgument(mpSize == 1, "unexpected (!=1) mp-reply size received: {}", mpSize);
+ Preconditions.checkArgument(mpSize == 1, "unexpected (!=1) mp-reply size received: %s", mpSize);
MeterFeaturesUpdatedBuilder notification = new MeterFeaturesUpdatedBuilder();
notification.setId(getDeviceInfo().getNodeId());
}
@VisibleForTesting
- protected static List<Class<? extends MeterBand>> extractSupportedMeterBand(MultipartReplyMeterFeatures replyBody,
- MeterBandTypeBitmap bandTypes) {
+ protected static List<Class<? extends MeterBand>> extractSupportedMeterBand(
+ final MultipartReplyMeterFeatures replyBody, final MeterBandTypeBitmap bandTypes) {
List<Class<? extends MeterBand>> supportedMeterBand = new ArrayList<>();
- if (bandTypes.isOFPMBTDROP()) {
+ if (bandTypes.getOFPMBTDROP()) {
supportedMeterBand.add(MeterBandDrop.class);
}
- if (replyBody.getBandTypes().isOFPMBTDSCPREMARK()) {
+ if (replyBody.getBandTypes().getOFPMBTDSCPREMARK()) {
supportedMeterBand.add(MeterBandDscpRemark.class);
}
return supportedMeterBand;
}
@VisibleForTesting
- protected static List<Class<? extends MeterCapability>> extractMeterCapabilities(MeterFlags capabilities) {
+ protected static List<Class<? extends MeterCapability>> extractMeterCapabilities(final MeterFlags capabilities) {
List<Class<? extends MeterCapability>> supportedCapabilities = new ArrayList<>();
- if (capabilities.isOFPMFBURST()) {
+ if (capabilities.getOFPMFBURST()) {
supportedCapabilities.add(MeterBurst.class);
}
- if (capabilities.isOFPMFKBPS()) {
+ if (capabilities.getOFPMFKBPS()) {
supportedCapabilities.add(MeterKbps.class);
}
- if (capabilities.isOFPMFPKTPS()) {
+ if (capabilities.getOFPMFPKTPS()) {
supportedCapabilities.add(MeterPktps.class);
}
- if (capabilities.isOFPMFSTATS()) {
+ if (capabilities.getOFPMFSTATS()) {
supportedCapabilities.add(MeterStats.class);
}
return supportedCapabilities;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.statistics.services.direct;
import com.google.common.base.Preconditions;
this::transformResult,
MoreExecutors.directExecutor());
- if (Boolean.TRUE.equals(input.isStoreStats())) {
+ if (Boolean.TRUE.equals(input.getStoreStats())) {
rpcResult = Futures.transform(rpcResult, this::storeResult, MoreExecutors.directExecutor());
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.util;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
public final class DeviceStateUtil {
-
private DeviceStateUtil() {
- throw new IllegalStateException("This class should not be instantiated");
+ // Hidden on purpose
}
public static void setDeviceStateBasedOnV13Capabilities(final DeviceState deviceState,
final Capabilities capabilities) {
- deviceState.setFlowStatisticsAvailable(capabilities.isOFPCFLOWSTATS());
- deviceState.setTableStatisticsAvailable(capabilities.isOFPCTABLESTATS());
- deviceState.setPortStatisticsAvailable(capabilities.isOFPCPORTSTATS());
- deviceState.setQueueStatisticsAvailable(capabilities.isOFPCQUEUESTATS());
- deviceState.setGroupAvailable(capabilities.isOFPCGROUPSTATS());
+ deviceState.setFlowStatisticsAvailable(capabilities.getOFPCFLOWSTATS());
+ deviceState.setTableStatisticsAvailable(capabilities.getOFPCTABLESTATS());
+ deviceState.setPortStatisticsAvailable(capabilities.getOFPCPORTSTATS());
+ deviceState.setQueueStatisticsAvailable(capabilities.getOFPCQUEUESTATS());
+ deviceState.setGroupAvailable(capabilities.getOFPCGROUPSTATS());
}
public static void setDeviceStateBasedOnV10Capabilities(final DeviceState deviceState,
final CapabilitiesV10 capabilitiesV10) {
- deviceState.setFlowStatisticsAvailable(capabilitiesV10.isOFPCFLOWSTATS());
- deviceState.setTableStatisticsAvailable(capabilitiesV10.isOFPCTABLESTATS());
- deviceState.setPortStatisticsAvailable(capabilitiesV10.isOFPCPORTSTATS());
- deviceState.setQueueStatisticsAvailable(capabilitiesV10.isOFPCQUEUESTATS());
+ deviceState.setFlowStatisticsAvailable(capabilitiesV10.getOFPCFLOWSTATS());
+ deviceState.setTableStatisticsAvailable(capabilitiesV10.getOFPCTABLESTATS());
+ deviceState.setPortStatisticsAvailable(capabilitiesV10.getOFPCPORTSTATS());
+ deviceState.setQueueStatisticsAvailable(capabilitiesV10.getOFPCQUEUESTATS());
}
- public static KeyedInstanceIdentifier<Node, NodeKey> createNodeInstanceIdentifier(NodeId nodeId) {
+ public static KeyedInstanceIdentifier<Node, NodeKey> createNodeInstanceIdentifier(final NodeId nodeId) {
return InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(nodeId));
}
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
public final class FlowCreatorUtil {
/**
*
* @return V10 Match object
*/
+ // FIXME: make this a constant
public static MatchV10 createWildcardedMatchV10() {
- MatchV10Builder builder = new MatchV10Builder();
- builder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
- builder.setNwSrcMask((short) 0);
- builder.setNwDstMask((short) 0);
- builder.setInPort(0);
- builder.setDlSrc(new MacAddress("00:00:00:00:00:00"));
- builder.setDlDst(new MacAddress("00:00:00:00:00:00"));
- builder.setDlVlan(0);
- builder.setDlVlanPcp((short) 0);
- builder.setDlType(0);
- builder.setNwTos((short) 0);
- builder.setNwProto((short) 0);
- builder.setNwSrc(new Ipv4Address("0.0.0.0"));
- builder.setNwDst(new Ipv4Address("0.0.0.0"));
- builder.setTpSrc(0);
- builder.setTpDst(0);
- return builder.build();
+ return new MatchV10Builder()
+ .setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true))
+ .setNwSrcMask(Uint8.ZERO)
+ .setNwDstMask(Uint8.ZERO)
+ .setInPort(Uint16.ZERO)
+ .setDlSrc(new MacAddress("00:00:00:00:00:00"))
+ .setDlDst(new MacAddress("00:00:00:00:00:00"))
+ .setDlVlan(Uint16.ZERO)
+ .setDlVlanPcp(Uint8.ZERO)
+ .setDlType(Uint16.ZERO)
+ .setNwTos(Uint8.ZERO)
+ .setNwProto(Uint8.ZERO)
+ .setNwSrc(new Ipv4Address("0.0.0.0"))
+ .setNwDst(new Ipv4Address("0.0.0.0"))
+ .setTpSrc(Uint16.ZERO)
+ .setTpDst(Uint16.ZERO)
+ .build();
}
public static Match createWildcardedMatch() {
return false;
}
- if (!Boolean.TRUE.equals(updated.isStrict()) && version != null
+ if (!Boolean.TRUE.equals(updated.getStrict()) && version != null
&& version.shortValue() != OFConstants.OFP_VERSION_1_0) {
FlowCookie cookieMask = updated.getCookieMask();
if (cookieMask != null) {
f2 = flags2 == null ? DEFAULT_FLOW_MOD_FLAGS : flags2;
}
- return equalsWithDefault(f1.isCHECKOVERLAP(), f2.isCHECKOVERLAP(), Boolean.FALSE) && equalsWithDefault(
- f1.isNOBYTCOUNTS(), f2.isNOBYTCOUNTS(), Boolean.FALSE) && equalsWithDefault(f1.isNOPKTCOUNTS(),
- f2.isNOPKTCOUNTS(),
- Boolean.FALSE)
- && equalsWithDefault(f1.isRESETCOUNTS(), f2.isRESETCOUNTS(), Boolean.FALSE) && equalsWithDefault(
- f1.isSENDFLOWREM(), f2.isSENDFLOWREM(), Boolean.FALSE);
+ return equalsWithDefault(f1.getCHECKOVERLAP(), f2.getCHECKOVERLAP(), Boolean.FALSE)
+ && equalsWithDefault(f1.getNOBYTCOUNTS(), f2.getNOBYTCOUNTS(), Boolean.FALSE)
+ && equalsWithDefault(f1.getNOPKTCOUNTS(), f2.getNOPKTCOUNTS(), Boolean.FALSE)
+ && equalsWithDefault(f1.getRESETCOUNTS(), f2.getRESETCOUNTS(), Boolean.FALSE)
+ && equalsWithDefault(f1.getSENDFLOWREM(), f2.getSENDFLOWREM(), Boolean.FALSE);
}
/**
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.util;
import com.google.common.annotations.VisibleForTesting;
* Provides group util methods.
*/
public final class GroupUtil {
-
private static final RpcResultBuilder<List<BatchFailedGroupsOutput>> SUCCESSFUL_GROUP_OUTPUT_RPC_RESULT =
RpcResultBuilder.success(Collections.emptyList());
GROUP_UPDATE_COMPOSING_TRANSFORM = createComposingFunction();
private GroupUtil() {
- throw new IllegalStateException("This class should not be instantiated.");
+ // Hidden on purpose
}
/**
for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType supportedActions
: actionsSupported) {
long supportActionBitmap = 0;
- supportActionBitmap |= supportedActions.isOFPATOUTPUT() ? 1 : 0;
- supportActionBitmap |= supportedActions.isOFPATCOPYTTLOUT() ? 1 << 11 : 0;
- supportActionBitmap |= supportedActions.isOFPATCOPYTTLIN() ? 1 << 12 : 0;
- supportActionBitmap |= supportedActions.isOFPATSETMPLSTTL() ? 1 << 15 : 0;
- supportActionBitmap |= supportedActions.isOFPATDECMPLSTTL() ? 1 << 16 : 0;
- supportActionBitmap |= supportedActions.isOFPATPUSHVLAN() ? 1 << 17 : 0;
- supportActionBitmap |= supportedActions.isOFPATPOPVLAN() ? 1 << 18 : 0;
- supportActionBitmap |= supportedActions.isOFPATPUSHMPLS() ? 1 << 19 : 0;
- supportActionBitmap |= supportedActions.isOFPATPOPMPLS() ? 1 << 20 : 0;
- supportActionBitmap |= supportedActions.isOFPATSETQUEUE() ? 1 << 21 : 0;
- supportActionBitmap |= supportedActions.isOFPATGROUP() ? 1 << 22 : 0;
- supportActionBitmap |= supportedActions.isOFPATSETNWTTL() ? 1 << 23 : 0;
- supportActionBitmap |= supportedActions.isOFPATDECNWTTL() ? 1 << 24 : 0;
- supportActionBitmap |= supportedActions.isOFPATSETFIELD() ? 1 << 25 : 0;
- supportActionBitmap |= supportedActions.isOFPATPUSHPBB() ? 1 << 26 : 0;
- supportActionBitmap |= supportedActions.isOFPATPOPPBB() ? 1 << 27 : 0;
+ supportActionBitmap |= supportedActions.getOFPATOUTPUT() ? 1 : 0;
+ supportActionBitmap |= supportedActions.getOFPATCOPYTTLOUT() ? 1 << 11 : 0;
+ supportActionBitmap |= supportedActions.getOFPATCOPYTTLIN() ? 1 << 12 : 0;
+ supportActionBitmap |= supportedActions.getOFPATSETMPLSTTL() ? 1 << 15 : 0;
+ supportActionBitmap |= supportedActions.getOFPATDECMPLSTTL() ? 1 << 16 : 0;
+ supportActionBitmap |= supportedActions.getOFPATPUSHVLAN() ? 1 << 17 : 0;
+ supportActionBitmap |= supportedActions.getOFPATPOPVLAN() ? 1 << 18 : 0;
+ supportActionBitmap |= supportedActions.getOFPATPUSHMPLS() ? 1 << 19 : 0;
+ supportActionBitmap |= supportedActions.getOFPATPOPMPLS() ? 1 << 20 : 0;
+ supportActionBitmap |= supportedActions.getOFPATSETQUEUE() ? 1 << 21 : 0;
+ supportActionBitmap |= supportedActions.getOFPATGROUP() ? 1 << 22 : 0;
+ supportActionBitmap |= supportedActions.getOFPATSETNWTTL() ? 1 << 23 : 0;
+ supportActionBitmap |= supportedActions.getOFPATDECNWTTL() ? 1 << 24 : 0;
+ supportActionBitmap |= supportedActions.getOFPATSETFIELD() ? 1 << 25 : 0;
+ supportActionBitmap |= supportedActions.getOFPATPUSHPBB() ? 1 << 26 : 0;
+ supportActionBitmap |= supportedActions.getOFPATPOPPBB() ? 1 << 27 : 0;
supportActionByGroups.add(Uint32.valueOf(supportActionBitmap));
}
return supportActionByGroups;
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures napf = null;
if (apf != null) {
napf = new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures(
- apf.isAutoneg(), //_autoeng
- apf.isCopper(), //_copper
- apf.isFiber(), //_fiber
- apf.is_40gbFd(), //_fortyGbFd
- apf.is_100gbFd(), //_hundredGbFd
- apf.is_100mbFd(), //_hundredMbFd
- apf.is_100mbHd(), //_hundredMbHd
- apf.is_1gbFd(), //_oneGbFd
- apf.is_1gbHd(), //_oneGbHd
- apf.is_1tbFd(), //_oneTbFd
- apf.isOther(), //_other
- apf.isPause(), //_pause
- apf.isPauseAsym(), //_pauseAsym
- apf.is_10gbFd(), //_tenGbFd
- apf.is_10mbFd(), //_tenMbFd
- apf.is_10mbHd()//_tenMbHd
+ apf.getAutoneg(), //_autoeng
+ apf.getCopper(), //_copper
+ apf.getFiber(), //_fiber
+ apf.get_40gbFd(), //_fortyGbFd
+ apf.get_100gbFd(), //_hundredGbFd
+ apf.get_100mbFd(), //_hundredMbFd
+ apf.get_100mbHd(), //_hundredMbHd
+ apf.get_1gbFd(), //_oneGbFd
+ apf.get_1gbHd(), //_oneGbHd
+ apf.get_1tbFd(), //_oneTbFd
+ apf.getOther(), //_other
+ apf.getPause(), //_pause
+ apf.getPauseAsym(), //_pauseAsym
+ apf.get_10gbFd(), //_tenGbFd
+ apf.get_10mbFd(), //_tenMbFd
+ apf.get_10mbHd()//_tenMbHd
);
}
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures napf = null;
if (apf != null) {
napf = new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures(
- apf.isAutoneg(), //_autoeng
- apf.isCopper(), //_copper
- apf.isFiber(), //_fiber
+ apf.getAutoneg(), //_autoeng
+ apf.getCopper(), //_copper
+ apf.getFiber(), //_fiber
false, //_fortyGbFd
false, //_hundredGbFd
- apf.is_100mbFd(), //_hundredMbFd
- apf.is_100mbHd(), //_hundredMbHd
- apf.is_1gbFd(), //_oneGbFd
- apf.is_1gbHd(), //_oneGbHd
+ apf.get_100mbFd(), //_hundredMbFd
+ apf.get_100mbHd(), //_hundredMbHd
+ apf.get_1gbFd(), //_oneGbFd
+ apf.get_1gbHd(), //_oneGbHd
false, //_oneTbFd
false, //_other
- apf.isPause(), //_pause
- apf.isPauseAsym(), //_pauseAsym
- apf.is_10gbFd(), //_tenGbFd
- apf.is_10mbFd(), //_tenMbFd
- apf.is_10mbHd()//_tenMbHd
+ apf.getPause(), //_pause
+ apf.getPauseAsym(), //_pauseAsym
+ apf.get_10gbFd(), //_tenGbFd
+ apf.get_10mbFd(), //_tenMbFd
+ apf.get_10mbHd()//_tenMbHd
);
}
return napf;
public static State translatePortState(final PortState state) {
StateBuilder nstate = new StateBuilder();
if (state != null) {
- nstate.setBlocked(state.isBlocked());
- nstate.setLinkDown(state.isLinkDown());
- nstate.setLive(state.isLive());
+ nstate.setBlocked(state.getBlocked()).setLinkDown(state.getLinkDown()).setLive(state.getLive());
}
return nstate.build();
}
public static State translatePortState(final PortStateV10 state) {
StateBuilder nstate = new StateBuilder();
if (state != null) {
- nstate.setBlocked(state.isBlocked());
- nstate.setLinkDown(state.isLinkDown());
- nstate.setLive(state.isLive());
+ nstate.setBlocked(state.getBlocked()).setLinkDown(state.getLinkDown()).setLive(state.getLive());
}
return nstate.build();
}
public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig
- translatePortConfig(
- final PortConfig pc) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig npc = null;
- if (pc != null) {
- npc = new org.opendaylight.yang.gen.v1.urn.opendaylight
- .flow.types.port.rev130925.PortConfig(pc.isNoFwd(),pc.isNoPacketIn(),pc.isNoRecv(),pc.isPortDown());
- }
- return npc;
+ translatePortConfig(final PortConfig pc) {
+ return pc == null ? null
+ : new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig(
+ pc.getNoFwd(), pc.getNoPacketIn(), pc.getNoRecv(), pc.getPortDown());
}
public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig
- translatePortConfig(
- final PortConfigV10 pc) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig npc = null;
- if (pc != null) {
- npc = new org.opendaylight.yang.gen.v1.urn.opendaylight
- .flow.types.port.rev130925.PortConfig(pc.isNoFwd(),pc.isNoPacketIn(),pc.isNoRecv(),pc.isPortDown());
- }
- return npc;
+ translatePortConfig(final PortConfigV10 pc) {
+ return pc == null ? null
+ : new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig(
+ pc.getNoFwd(), pc.getNoPacketIn(), pc.getNoRecv(), pc.getPortDown());
}
public static NodeConnectorUpdated translatePort(final Short version, final Uint64 datapathId,
MultipartRequestExperimenterCase.class);
}
- private void checkHeader(MultipartRequestInput mpRqInput, MultipartType mpType) {
- Assert.assertFalse(mpRqInput.getFlags().isOFPMPFREQMORE());
+ private void checkHeader(final MultipartRequestInput mpRqInput, final MultipartType mpType) {
+ Assert.assertFalse(mpRqInput.getFlags().getOFPMPFREQMORE());
Assert.assertEquals(ofVersion, mpRqInput.getVersion().shortValue());
Assert.assertEquals(mpType, mpRqInput.getType());
Assert.assertEquals(xid, mpRqInput.getXid().longValue());
}
- private static void checkEmptyBody(Class<? extends DataContainer> mpRqBody, Class<? extends
+ private static void checkEmptyBody(final Class<? extends DataContainer> mpRqBody, final Class<? extends
MultipartRequestBody> expectedMpRqBodyClass) {
Assert.assertTrue(expectedMpRqBodyClass.isAssignableFrom(mpRqBody));
Assert.assertEquals(expectedMpRqBodyClass, mpRqBody);
@Before
public void setUp() {
- when(config.isIsStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
- when(config.isIsFlowStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
- when(config.isIsTableStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
- when(config.isIsFlowStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
- when(config.isIsGroupStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
- when(config.isIsMeterStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
- when(config.isIsQueueStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
- when(config.isIsPortStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
+ when(config.getIsStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
+ when(config.getIsFlowStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
+ when(config.getIsTableStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
+ when(config.getIsFlowStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
+ when(config.getIsGroupStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
+ when(config.getIsMeterStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
+ when(config.getIsQueueStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
+ when(config.getIsPortStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
when(config.getBarrierCountLimit()).thenReturn(new NonZeroUint16Type(BARRIER_COUNT_LIMIT));
when(config.getBarrierIntervalTimeoutLimit()).thenReturn(new NonZeroUint32Type(BARRIER_INTERVAL_TIMEOUT_LIMIT));
when(config.getEchoReplyTimeout()).thenReturn(new NonZeroUint32Type(ECHO_REPLY_TIMEOUT));
- when(config.isEnableFlowRemovedNotification()).thenReturn(ENABLE_FLOW_REMOVED_NOTIFICATION);
- when(config.isSkipTableFeatures()).thenReturn(SKIP_TABLE_FEATURES);
+ when(config.getEnableFlowRemovedNotification()).thenReturn(ENABLE_FLOW_REMOVED_NOTIFICATION);
+ when(config.getSkipTableFeatures()).thenReturn(SKIP_TABLE_FEATURES);
when(config.getBasicTimerDelay()).thenReturn(new NonZeroUint32Type(BASIC_TIMER_DELAY));
when(config.getMaximumTimerDelay()).thenReturn(new NonZeroUint32Type(MAXIMUM_TIMER_DELAY));
- when(config.isSwitchFeaturesMandatory()).thenReturn(SWITCH_FEATURES_MANDATORY);
- when(config.isIsStatisticsRpcEnabled()).thenReturn(IS_STATISTICS_RPC_ENABLED);
- when(config.isUseSingleLayerSerialization()).thenReturn(USE_SINGLE_LAYER_SERIALIZATION);
+ when(config.getSwitchFeaturesMandatory()).thenReturn(SWITCH_FEATURES_MANDATORY);
+ when(config.getIsStatisticsRpcEnabled()).thenReturn(IS_STATISTICS_RPC_ENABLED);
+ when(config.getUseSingleLayerSerialization()).thenReturn(USE_SINGLE_LAYER_SERIALIZATION);
when(config.getRpcRequestsQuota()).thenReturn(new NonZeroUint16Type(RPC_REQUESTS_QUOTA));
when(config.getGlobalNotificationQuota()).thenReturn(GLOBAL_NOTIFICATION_QUOTA);
when(config.getThreadPoolMinThreads()).thenReturn(THREAD_POOL_MIN_THREADS);
@Test
public void isSwitchFeaturesMandatory() {
- assertEquals(SWITCH_FEATURES_MANDATORY, openflowProviderConfig.isSwitchFeaturesMandatory());
+ assertEquals(SWITCH_FEATURES_MANDATORY, openflowProviderConfig.getSwitchFeaturesMandatory());
}
@Test
@Test
public void isIsStatisticsPollingOn() {
- assertEquals(IS_STATISTICS_POLLING_ON, openflowProviderConfig.isIsStatisticsPollingOn());
+ assertEquals(IS_STATISTICS_POLLING_ON, openflowProviderConfig.getIsStatisticsPollingOn());
}
@Test
public void isIsStatisticsRpcEnabled() {
- assertEquals(IS_STATISTICS_RPC_ENABLED, openflowProviderConfig.isIsStatisticsRpcEnabled());
+ assertEquals(IS_STATISTICS_RPC_ENABLED, openflowProviderConfig.getIsStatisticsRpcEnabled());
}
@Test
@Test
public void isEnableFlowRemovedNotification() {
- assertEquals(ENABLE_FLOW_REMOVED_NOTIFICATION, openflowProviderConfig.isEnableFlowRemovedNotification());
+ assertEquals(ENABLE_FLOW_REMOVED_NOTIFICATION, openflowProviderConfig.getEnableFlowRemovedNotification());
}
@Test
public void isSkipTableFeatures() {
- assertEquals(SKIP_TABLE_FEATURES, openflowProviderConfig.isSkipTableFeatures());
+ assertEquals(SKIP_TABLE_FEATURES, openflowProviderConfig.getSkipTableFeatures());
}
@Test
@Test
public void isUseSingleLayerSerialization() {
- assertEquals(USE_SINGLE_LAYER_SERIALIZATION, openflowProviderConfig.isUseSingleLayerSerialization());
+ assertEquals(USE_SINGLE_LAYER_SERIALIZATION, openflowProviderConfig.getUseSingleLayerSerialization());
}
@Test
final byte[] vlanMask = new byte[]{16, 0};
writeHeader(in, false);
- in.writeShort(vlanVid | (1 << 12));
+ in.writeShort(vlanVid | 1 << 12);
VlanMatch vlanMatch = deserialize(in).getVlanMatch();
assertEquals(vlanVid, vlanMatch.getVlanId().getVlanId().getValue().intValue());
- assertTrue(vlanMatch.getVlanId().isVlanIdPresent());
+ assertTrue(vlanMatch.getVlanId().getVlanIdPresent());
assertEquals(0, in.readableBytes());
writeHeader(in, true);
vlanMatch = deserialize(in).getVlanMatch();
assertEquals(0, vlanMatch.getVlanId().getVlanId().getValue().intValue());
- assertTrue(vlanMatch.getVlanId().isVlanIdPresent());
+ assertTrue(vlanMatch.getVlanId().getVlanIdPresent());
assertEquals(0, in.readableBytes());
writeHeader(in, false);
vlanMatch = deserialize(in).getVlanMatch();
assertEquals(vlanVid, vlanMatch.getVlanId().getVlanId().getValue().intValue());
- assertFalse(vlanMatch.getVlanId().isVlanIdPresent());
+ assertFalse(vlanMatch.getVlanId().getVlanIdPresent());
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.deserialization.messages;
import static org.junit.Assert.assertEquals;
buffer.writeInt(OUT_PORT);
buffer.writeInt(OUT_GROUP);
buffer.writeShort(ByteBufUtils.fillBitMask(0,
- FLAGS.isSENDFLOWREM(),
- FLAGS.isCHECKOVERLAP(),
- FLAGS.isRESETCOUNTS(),
- FLAGS.isNOPKTCOUNTS(),
- FLAGS.isNOBYTCOUNTS()));
+ FLAGS.getSENDFLOWREM(),
+ FLAGS.getCHECKOVERLAP(),
+ FLAGS.getRESETCOUNTS(),
+ FLAGS.getNOPKTCOUNTS(),
+ FLAGS.getNOBYTCOUNTS()));
buffer.writeZero(PADDING);
// Match header
assertEquals(PopPbbActionCase.class, applyActions.getApplyActions().nonnullAction().values().iterator().next()
.getAction().implementedInterface());
}
-
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.deserialization.messages;
import static org.junit.Assert.assertEquals;
assertEquals(message.getXid().intValue(), XID);
assertEquals(message.getCommand().getIntValue(), COMMAND.getIntValue());
- assertEquals(message.getFlags().isMeterBurst(), IS_BURST);
- assertEquals(message.getFlags().isMeterKbps(), IS_KBPS);
- assertEquals(message.getFlags().isMeterPktps(), IS_PKTPS);
- assertEquals(message.getFlags().isMeterStats(), IS_STATS);
+ assertEquals(message.getFlags().getMeterBurst(), IS_BURST);
+ assertEquals(message.getFlags().getMeterKbps(), IS_KBPS);
+ assertEquals(message.getFlags().getMeterPktps(), IS_PKTPS);
+ assertEquals(message.getFlags().getMeterStats(), IS_STATS);
assertEquals(message.getMeterId().getValue().intValue(), ID);
final Map<MeterBandHeaderKey, MeterBandHeader> meterBandHeader =
// Drop band
final MeterBandHeader dropHeader = meterBandHeaderIt.next();
assertEquals(Drop.class, dropHeader.getBandType().implementedInterface());
- assertTrue(dropHeader.getMeterBandTypes().getFlags().isOfpmbtDrop());
+ assertTrue(dropHeader.getMeterBandTypes().getFlags().getOfpmbtDrop());
final Drop drop = (Drop) dropHeader.getBandType();
assertEquals(DROP_RATE, drop.getDropRate().intValue());
// Dscp band
final MeterBandHeader dscpHeader = meterBandHeaderIt.next();
assertEquals(DscpRemark.class, dscpHeader.getBandType().implementedInterface());
- assertTrue(dscpHeader.getMeterBandTypes().getFlags().isOfpmbtDscpRemark());
+ assertTrue(dscpHeader.getMeterBandTypes().getFlags().getOfpmbtDscpRemark());
final DscpRemark dscpRemark = (DscpRemark) dscpHeader.getBandType();
assertEquals(DSCP_RATE, dscpRemark.getDscpRemarkRate().intValue());
assertEquals(buffer.readableBytes(), 0);
}
-
}
assertEquals(ADDRESS.getValue(), message.getHardwareAddress().getValue());
// Config
- assertEquals(IS_PORTDOWN, message.getConfiguration().isPORTDOWN());
- assertEquals(IS_NORECV, message.getConfiguration().isNORECV());
- assertEquals(IS_NOFWD, message.getConfiguration().isNOFWD());
- assertEquals(IS_NOPACKETIN, message.getConfiguration().isNOPACKETIN());
+ assertEquals(IS_PORTDOWN, message.getConfiguration().getPORTDOWN());
+ assertEquals(IS_NORECV, message.getConfiguration().getNORECV());
+ assertEquals(IS_NOFWD, message.getConfiguration().getNOFWD());
+ assertEquals(IS_NOPACKETIN, message.getConfiguration().getNOPACKETIN());
// Features
- assertEquals(IS_10MBHD, message.getAdvertisedFeatures().isTenMbHd());
- assertEquals(IS_10MBFD, message.getAdvertisedFeatures().isTenMbHd());
- assertEquals(IS_100MBHD, message.getAdvertisedFeatures().isHundredMbHd());
- assertEquals(IS_100MBFD, message.getAdvertisedFeatures().isHundredMbFd());
- assertEquals(IS_1GBHD, message.getAdvertisedFeatures().isOneGbHd());
- assertEquals(IS_1GBFD, message.getAdvertisedFeatures().isOneGbFd());
- assertEquals(IS_10GBFD, message.getAdvertisedFeatures().isTenGbFd());
- assertEquals(IS_40GBFD, message.getAdvertisedFeatures().isFortyGbFd());
- assertEquals(IS_100GBFD, message.getAdvertisedFeatures().isHundredGbFd());
- assertEquals(IS_1TBFD, message.getAdvertisedFeatures().isOneTbFd());
- assertEquals(IS_OTHER, message.getAdvertisedFeatures().isOther());
- assertEquals(IS_COPPER, message.getAdvertisedFeatures().isCopper());
- assertEquals(IS_FIBER, message.getAdvertisedFeatures().isFiber());
- assertEquals(IS_AUTOENG, message.getAdvertisedFeatures().isAutoeng());
- assertEquals(IS_PAUSE, message.getAdvertisedFeatures().isPause());
- assertEquals(IS_PAUSE_ASYM, message.getAdvertisedFeatures().isPauseAsym());
+ assertEquals(IS_10MBHD, message.getAdvertisedFeatures().getTenMbHd());
+ assertEquals(IS_10MBFD, message.getAdvertisedFeatures().getTenMbHd());
+ assertEquals(IS_100MBHD, message.getAdvertisedFeatures().getHundredMbHd());
+ assertEquals(IS_100MBFD, message.getAdvertisedFeatures().getHundredMbFd());
+ assertEquals(IS_1GBHD, message.getAdvertisedFeatures().getOneGbHd());
+ assertEquals(IS_1GBFD, message.getAdvertisedFeatures().getOneGbFd());
+ assertEquals(IS_10GBFD, message.getAdvertisedFeatures().getTenGbFd());
+ assertEquals(IS_40GBFD, message.getAdvertisedFeatures().getFortyGbFd());
+ assertEquals(IS_100GBFD, message.getAdvertisedFeatures().getHundredGbFd());
+ assertEquals(IS_1TBFD, message.getAdvertisedFeatures().getOneTbFd());
+ assertEquals(IS_OTHER, message.getAdvertisedFeatures().getOther());
+ assertEquals(IS_COPPER, message.getAdvertisedFeatures().getCopper());
+ assertEquals(IS_FIBER, message.getAdvertisedFeatures().getFiber());
+ assertEquals(IS_AUTOENG, message.getAdvertisedFeatures().getAutoeng());
+ assertEquals(IS_PAUSE, message.getAdvertisedFeatures().getPause());
+ assertEquals(IS_PAUSE_ASYM, message.getAdvertisedFeatures().getPauseAsym());
assertEquals(buffer.readableBytes(), 0);
}
buffer.writeShort(IDLE_TIMEOUT);
buffer.writeShort(HARD_TIMEOUT);
buffer.writeShort(ByteBufUtils.fillBitMask(0,
- FLAGS.isSENDFLOWREM(),
- FLAGS.isCHECKOVERLAP(),
- FLAGS.isRESETCOUNTS(),
- FLAGS.isNOPKTCOUNTS(),
- FLAGS.isNOBYTCOUNTS()));
+ FLAGS.getSENDFLOWREM(),
+ FLAGS.getCHECKOVERLAP(),
+ FLAGS.getRESETCOUNTS(),
+ FLAGS.getNOPKTCOUNTS(),
+ FLAGS.getNOBYTCOUNTS()));
buffer.writeZero(PADDING_IN_FLOW_STATS_HEADER_02);
buffer.writeLong(COOKIE);
buffer.writeLong(PACKET_COUNT);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.deserialization.multipart;
import static org.junit.Assert.assertEquals;
@Override
protected void init() {
+ // No-op
}
@Test
buffer.writeShort(IDLE_TIMEOUT);
buffer.writeShort(HARD_TIMEOUT);
buffer.writeShort(ByteBufUtils.fillBitMask(0,
- FLAGS.isSENDFLOWREM(),
- FLAGS.isCHECKOVERLAP(),
- FLAGS.isRESETCOUNTS(),
- FLAGS.isNOPKTCOUNTS(),
- FLAGS.isNOBYTCOUNTS()));
+ FLAGS.getSENDFLOWREM(),
+ FLAGS.getCHECKOVERLAP(),
+ FLAGS.getRESETCOUNTS(),
+ FLAGS.getNOPKTCOUNTS(),
+ FLAGS.getNOBYTCOUNTS()));
buffer.writeZero(PADDING_IN_FLOW_STATS_HEADER_02);
buffer.writeLong(COOKIE);
buffer.writeLong(PACKET_COUNT);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.deserialization.multipart;
import static org.junit.Assert.assertEquals;
private static void writeCommonAtributes(final ByteBuf buffer) {
buffer.writeShort(ITEM_LENGTH);
buffer.writeShort(ByteBufUtils.fillBitMask(0,
- FLAGS.isMeterKbps(),
- FLAGS.isMeterPktps(),
- FLAGS.isMeterBurst(),
- FLAGS.isMeterStats()));
+ FLAGS.getMeterKbps(),
+ FLAGS.getMeterPktps(),
+ FLAGS.getMeterBurst(),
+ FLAGS.getMeterStats()));
buffer.writeInt(METER_ID);
}
}
\ No newline at end of file
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.deserialization.multipart;
import static org.junit.Assert.assertEquals;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.multipart.reply.multipart.reply.body.MultipartReplyPortDesc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.multipart.reply.multipart.reply.body.multipart.reply.port.desc.Ports;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
public class MultipartReplyPortDescDeserializerTest extends AbstractMultipartDeserializerTest {
buffer.writeZero(EncodeConstants.MAX_PORT_NAME_LENGTH);
Map<Integer, Boolean> portMap = new HashMap<>();
- portMap.put(0, PORT_CONFIG.isPORTDOWN());
- portMap.put(2, PORT_CONFIG.isNORECV());
- portMap.put(5, PORT_CONFIG.isNOFWD());
- portMap.put(6, PORT_CONFIG.isNOPACKETIN());
+ portMap.put(0, PORT_CONFIG.getPORTDOWN());
+ portMap.put(2, PORT_CONFIG.getNORECV());
+ portMap.put(5, PORT_CONFIG.getNOFWD());
+ portMap.put(6, PORT_CONFIG.getNOPACKETIN());
buffer.writeInt(ByteBufUtils.fillBitMaskFromMap(portMap));
buffer.writeInt(ByteBufUtils.fillBitMask(0, PS_BLOCKED, PS_LINK_DOWN, PS_LIVE));
buffer.writeInt(ByteBufUtils.fillBitMask(0,
- CURRENT_FEATURE.isTenMbHd(),
- CURRENT_FEATURE.isTenMbFd(),
- CURRENT_FEATURE.isHundredMbHd(),
- CURRENT_FEATURE.isHundredMbFd(),
- CURRENT_FEATURE.isOneGbHd(),
- CURRENT_FEATURE.isOneGbFd(),
- CURRENT_FEATURE.isTenGbFd(),
- CURRENT_FEATURE.isFortyGbFd(),
- CURRENT_FEATURE.isHundredGbFd(),
- CURRENT_FEATURE.isOneTbFd(),
- CURRENT_FEATURE.isOther(),
- CURRENT_FEATURE.isFiber(),
- CURRENT_FEATURE.isAutoeng(),
- CURRENT_FEATURE.isCopper(),
- CURRENT_FEATURE.isPause(),
- CURRENT_FEATURE.isPauseAsym()));
+ CURRENT_FEATURE.getTenMbHd(),
+ CURRENT_FEATURE.getTenMbFd(),
+ CURRENT_FEATURE.getHundredMbHd(),
+ CURRENT_FEATURE.getHundredMbFd(),
+ CURRENT_FEATURE.getOneGbHd(),
+ CURRENT_FEATURE.getOneGbFd(),
+ CURRENT_FEATURE.getTenGbFd(),
+ CURRENT_FEATURE.getFortyGbFd(),
+ CURRENT_FEATURE.getHundredGbFd(),
+ CURRENT_FEATURE.getOneTbFd(),
+ CURRENT_FEATURE.getOther(),
+ CURRENT_FEATURE.getFiber(),
+ CURRENT_FEATURE.getAutoeng(),
+ CURRENT_FEATURE.getCopper(),
+ CURRENT_FEATURE.getPause(),
+ CURRENT_FEATURE.getPauseAsym()));
buffer.writeInt(ADVERTISED_FEATURE);
buffer.writeInt(SUPPORTED_FEATURE);
buffer.writeInt(PEER_FEATURES);
buffer.writeInt(MAXIMUM_SPEED);
final MultipartReplyPortDesc reply = (MultipartReplyPortDesc) deserializeMultipart(buffer);
- assertEquals(PORT_NUMBER, reply.getPorts().get(0).getPortNumber().getUint32().intValue());
- assertEquals("01:02:03:04:05:06", reply.getPorts().get(0).getHardwareAddress().getValue());
- assertEquals(PORT_CONFIG, reply.getPorts().get(0).getConfiguration());
- assertEquals(PS_BLOCKED, reply.getPorts().get(0).getState().isBlocked());
- assertEquals(PS_LINK_DOWN, reply.getPorts().get(0).getState().isLinkDown());
- assertEquals(PS_LIVE, reply.getPorts().get(0).getState().isLive());
- assertEquals(CURRENT_FEATURE, reply.getPorts().get(0).getCurrentFeature());
- assertEquals(CURRENT_SPEED, reply.getPorts().get(0).getCurrentSpeed().intValue());
- assertEquals(MAXIMUM_SPEED, reply.getPorts().get(0).getMaximumSpeed().intValue());
+ final Ports ports = reply.nonnullPorts().get(0);
+ assertEquals(PORT_NUMBER, ports.getPortNumber().getUint32().intValue());
+ assertEquals("01:02:03:04:05:06", ports.getHardwareAddress().getValue());
+ assertEquals(PORT_CONFIG, ports.getConfiguration());
+ assertEquals(PS_BLOCKED, ports.getState().getBlocked());
+ assertEquals(PS_LINK_DOWN, ports.getState().getLinkDown());
+ assertEquals(PS_LIVE, ports.getState().getLive());
+ assertEquals(CURRENT_FEATURE, ports.getCurrentFeature());
+ assertEquals(CURRENT_SPEED, ports.getCurrentSpeed().intValue());
+ assertEquals(MAXIMUM_SPEED, ports.getMaximumSpeed().intValue());
}
@Override
*/
package org.opendaylight.openflowplugin.impl.services.batch;
-import com.google.common.collect.Lists;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
import java.util.Iterator;
-import org.junit.Assert;
+import java.util.List;
import org.junit.Test;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.ProcessFlatBatchOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.add.flow._case.FlatBatchAddFlow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
public void testAdaptFlatBatchAddFlow() {
final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_ADD);
planStep.setBarrierAfter(true);
- planStep.getTaskBag().addAll(Lists.newArrayList(
- createAddFlowBatch(Uint16.ONE),
- createAddFlowBatch(Uint16.TWO)));
+ planStep.getTaskBag().addAll(List.of(createAddFlowBatch(Uint16.ONE), createAddFlowBatch(Uint16.TWO)));
final AddFlowsBatchInput addFlowsBatchInput = FlatBatchFlowAdapters.adaptFlatBatchAddFlow(planStep, NODE_REF);
Iterator<BatchAddFlows> iterator = addFlowsBatchInput.nonnullBatchAddFlows().values().iterator();
- Assert.assertTrue(addFlowsBatchInput.isBarrierAfter());
- Assert.assertEquals(2, addFlowsBatchInput.getBatchAddFlows().size());
- Assert.assertEquals("1", iterator.next().getFlowId().getValue());
- Assert.assertEquals("2", iterator.next().getFlowId().getValue());
+ assertTrue(addFlowsBatchInput.getBarrierAfter());
+ assertEquals(2, addFlowsBatchInput.getBatchAddFlows().size());
+ assertEquals("1", iterator.next().getFlowId().getValue());
+ assertEquals("2", iterator.next().getFlowId().getValue());
}
private static FlatBatchAddFlow createAddFlowBatch(final Uint16 flowIdValue) {
public void testAdaptFlatBatchRemoveFlow() {
final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_REMOVE);
planStep.setBarrierAfter(true);
- planStep.getTaskBag().addAll(Lists.newArrayList(
- createRemoveFlowBatch(Uint16.ONE),
- createRemoveFlowBatch(Uint16.TWO)));
+ planStep.getTaskBag().addAll(List.of(createRemoveFlowBatch(Uint16.ONE), createRemoveFlowBatch(Uint16.TWO)));
final RemoveFlowsBatchInput removeFlowsBatchInput =
FlatBatchFlowAdapters.adaptFlatBatchRemoveFlow(planStep, NODE_REF);
Iterator<BatchRemoveFlows> iterator = removeFlowsBatchInput.nonnullBatchRemoveFlows().values().iterator();
- Assert.assertTrue(removeFlowsBatchInput.isBarrierAfter());
- Assert.assertEquals(2, removeFlowsBatchInput.getBatchRemoveFlows().size());
- Assert.assertEquals("1", iterator.next().getFlowId().getValue());
- Assert.assertEquals("2", iterator.next().getFlowId().getValue());
+ assertTrue(removeFlowsBatchInput.getBarrierAfter());
+ assertEquals(2, removeFlowsBatchInput.getBatchRemoveFlows().size());
+ assertEquals("1", iterator.next().getFlowId().getValue());
+ assertEquals("2", iterator.next().getFlowId().getValue());
}
@Test
public void testAdaptFlatBatchUpdateFlow() {
final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_UPDATE);
planStep.setBarrierAfter(true);
- planStep.getTaskBag().addAll(Lists.newArrayList(
- createUpdateFlowBatch(Uint16.ONE),
- createUpdateFlowBatch(Uint16.TWO)));
+ planStep.getTaskBag().addAll(List.of(createUpdateFlowBatch(Uint16.ONE), createUpdateFlowBatch(Uint16.TWO)));
final UpdateFlowsBatchInput updateFlowsBatchInput =
FlatBatchFlowAdapters.adaptFlatBatchUpdateFlow(planStep, NODE_REF);
Iterator<BatchUpdateFlows> iterator = updateFlowsBatchInput.nonnullBatchUpdateFlows().values().iterator();
- Assert.assertTrue(updateFlowsBatchInput.isBarrierAfter());
- Assert.assertEquals(2, updateFlowsBatchInput.getBatchUpdateFlows().size());
- Assert.assertEquals("1", iterator.next().getFlowId().getValue());
- Assert.assertEquals("2", iterator.next().getFlowId().getValue());
+ assertTrue(updateFlowsBatchInput.getBarrierAfter());
+ assertEquals(2, updateFlowsBatchInput.getBatchUpdateFlows().size());
+ assertEquals("1", iterator.next().getFlowId().getValue());
+ assertEquals("2", iterator.next().getFlowId().getValue());
}
@Test
final RpcResult<BatchFlowOutputListGrouping> input = RpcResultBuilder.<BatchFlowOutputListGrouping>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-flowError")
.withResult(new AddFlowsBatchOutputBuilder()
- .setBatchFailedFlowsOutput(Lists.newArrayList(
+ .setBatchFailedFlowsOutput(BindingMap.ordered(
createBatchFailedFlowsOutput(Uint16.ZERO, "f1"),
createBatchFailedFlowsOutput(Uint16.ONE, "f2")
))
final RpcResult<ProcessFlatBatchOutput> rpcResult = FlatBatchFlowAdapters
.convertBatchFlowResult(3).apply(input);
- Iterator<BatchFailure> iterator = rpcResult.getResult().nonnullBatchFailure().values().iterator();
- Assert.assertFalse(rpcResult.isSuccessful());
- Assert.assertEquals(1, rpcResult.getErrors().size());
- Assert.assertEquals(2, rpcResult.getResult().getBatchFailure().size());
- Assert.assertEquals(3, iterator.next()
+ assertFalse(rpcResult.isSuccessful());
+ assertEquals(1, rpcResult.getErrors().size());
+ assertEquals(2, rpcResult.getResult().getBatchFailure().size());
+ Iterator<BatchFailure> iterator = rpcResult.getResult().nonnullBatchFailure().values().iterator();
+ assertEquals(3, iterator.next()
.getBatchOrder().intValue());
BatchFailure secondBatchFailure = iterator.next();
- Assert.assertEquals(4, secondBatchFailure.getBatchOrder().intValue());
- Assert.assertEquals("f2",
+ assertEquals(4, secondBatchFailure.getBatchOrder().intValue());
+ assertEquals("f2",
((FlatBatchFailureFlowIdCase) secondBatchFailure.getBatchItemIdChoice())
.getFlowId().getValue());
}
final RpcResult<ProcessFlatBatchOutput> rpcResult = FlatBatchFlowAdapters
.convertBatchFlowResult(0).apply(input);
- Assert.assertTrue(rpcResult.isSuccessful());
- Assert.assertEquals(0, rpcResult.getErrors().size());
- Assert.assertEquals(0, rpcResult.getResult().nonnullBatchFailure().size());
+ assertTrue(rpcResult.isSuccessful());
+ assertEquals(0, rpcResult.getErrors().size());
+ assertEquals(0, rpcResult.getResult().nonnullBatchFailure().size());
}
private static BatchFailedFlowsOutput createBatchFailedFlowsOutput(final Uint16 batchOrder,
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
FlatBatchGroupAdapters.adaptFlatBatchAddGroup(planStep, NODE_REF);
Iterator<BatchAddGroups> iterator = addGroupsBatchInput.nonnullBatchAddGroups().values().iterator();
- Assert.assertTrue(addGroupsBatchInput.isBarrierAfter());
+ Assert.assertTrue(addGroupsBatchInput.getBarrierAfter());
Assert.assertEquals(2, addGroupsBatchInput.getBatchAddGroups().size());
Assert.assertEquals(1L, iterator.next().getGroupId().getValue().longValue());
Assert.assertEquals(2L, iterator.next().getGroupId().getValue().longValue());
FlatBatchGroupAdapters.adaptFlatBatchRemoveGroup(planStep, NODE_REF);
Iterator<BatchRemoveGroups> iterator = removeGroupsBatchInput.nonnullBatchRemoveGroups().values().iterator();
- Assert.assertTrue(removeGroupsBatchInput.isBarrierAfter());
+ Assert.assertTrue(removeGroupsBatchInput.getBarrierAfter());
Assert.assertEquals(2, removeGroupsBatchInput.getBatchRemoveGroups().size());
Assert.assertEquals(1L, iterator.next().getGroupId().getValue().longValue());
Assert.assertEquals(2L, iterator.next().getGroupId().getValue().longValue());
final UpdateGroupsBatchInput updateGroupsBatchInput =
FlatBatchGroupAdapters.adaptFlatBatchUpdateGroup(planStep, NODE_REF);
- Assert.assertTrue(updateGroupsBatchInput.isBarrierAfter());
+ Assert.assertTrue(updateGroupsBatchInput.getBarrierAfter());
Assert.assertEquals(2, updateGroupsBatchInput.getBatchUpdateGroups().size());
Assert.assertEquals(1L, updateGroupsBatchInput.getBatchUpdateGroups().get(0)
.getUpdatedBatchedGroup().getGroupId().getValue().longValue());
final RpcResult<BatchGroupOutputListGrouping> input = RpcResultBuilder.<BatchGroupOutputListGrouping>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-groupError")
.withResult(new AddGroupsBatchOutputBuilder()
- .setBatchFailedGroupsOutput(Lists.newArrayList(
+ .setBatchFailedGroupsOutput(BindingMap.ordered(
createBatchFailedGroupsOutput(Uint16.ZERO, Uint32.ONE),
createBatchFailedGroupsOutput(Uint16.ONE, Uint32.TWO)
))
import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.batch.meter.output.list.grouping.BatchFailedMetersOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.remove.meters.batch.input.BatchRemoveMeters;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
final AddMetersBatchInput addMetersBatchInput =
FlatBatchMeterAdapters.adaptFlatBatchAddMeter(planStep, NODE_REF);
- Assert.assertTrue(addMetersBatchInput.isBarrierAfter());
+ Assert.assertTrue(addMetersBatchInput.getBarrierAfter());
Assert.assertEquals(2, addMetersBatchInput.nonnullBatchAddMeters().size());
final Iterator<BatchAddMeters> it = addMetersBatchInput.nonnullBatchAddMeters().values().iterator();
FlatBatchMeterAdapters.adaptFlatBatchRemoveMeter(planStep, NODE_REF);
Iterator<BatchRemoveMeters> iterator = removeMetersBatchInput.nonnullBatchRemoveMeters().values().iterator();
- Assert.assertTrue(removeMetersBatchInput.isBarrierAfter());
+ Assert.assertTrue(removeMetersBatchInput.getBarrierAfter());
Assert.assertEquals(2, removeMetersBatchInput.nonnullBatchRemoveMeters().size());
Assert.assertEquals(1L, iterator.next().getMeterId().getValue().longValue());
Assert.assertEquals(2L, iterator.next().getMeterId().getValue().longValue());
final UpdateMetersBatchInput updateMetersBatchInput =
FlatBatchMeterAdapters.adaptFlatBatchUpdateMeter(planStep, NODE_REF);
- Assert.assertTrue(updateMetersBatchInput.isBarrierAfter());
+ Assert.assertTrue(updateMetersBatchInput.getBarrierAfter());
Assert.assertEquals(2, updateMetersBatchInput.getBatchUpdateMeters().size());
Assert.assertEquals(1L, updateMetersBatchInput.getBatchUpdateMeters().get(0)
.getUpdatedBatchedMeter().getMeterId().getValue().longValue());
final RpcResult<BatchMeterOutputListGrouping> input = RpcResultBuilder.<BatchMeterOutputListGrouping>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-meterError")
.withResult(new AddMetersBatchOutputBuilder()
- .setBatchFailedMetersOutput(Lists.newArrayList(
+ .setBatchFailedMetersOutput(BindingMap.ordered(
createBatchFailedMetersOutput(Uint16.ZERO, Uint32.ONE),
createBatchFailedMetersOutput(Uint16.ONE, Uint32.TWO)
))
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.services.util;
import static org.junit.Assert.assertEquals;
assertEquals(version, input.getVersion().toJava());
assertEquals(xid, input.getXid());
assertEquals(type, input.getType());
- assertFalse(input.getFlags().isOFPMPFREQMORE());
+ assertFalse(input.getFlags().getOFPMPFREQMORE());
}
}
\ No newline at end of file
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.statistics;
import static com.google.common.util.concurrent.Futures.immediateFuture;
@Before
public void setUp() {
- Mockito.when(config.isIsTableStatisticsPollingOn()).thenReturn(true);
- Mockito.when(config.isIsFlowStatisticsPollingOn()).thenReturn(true);
- Mockito.when(config.isIsGroupStatisticsPollingOn()).thenReturn(true);
- Mockito.when(config.isIsMeterStatisticsPollingOn()).thenReturn(true);
- Mockito.when(config.isIsPortStatisticsPollingOn()).thenReturn(true);
- Mockito.when(config.isIsQueueStatisticsPollingOn()).thenReturn(true);
+ Mockito.when(config.getIsTableStatisticsPollingOn()).thenReturn(true);
+ Mockito.when(config.getIsFlowStatisticsPollingOn()).thenReturn(true);
+ Mockito.when(config.getIsGroupStatisticsPollingOn()).thenReturn(true);
+ Mockito.when(config.getIsMeterStatisticsPollingOn()).thenReturn(true);
+ Mockito.when(config.getIsPortStatisticsPollingOn()).thenReturn(true);
+ Mockito.when(config.getIsQueueStatisticsPollingOn()).thenReturn(true);
Mockito.when(config.getBasicTimerDelay()).thenReturn(new NonZeroUint32Type(Uint32.valueOf(3000)));
Mockito.when(config.getMaximumTimerDelay()).thenReturn(new NonZeroUint32Type(Uint32.valueOf(50000)));
}
convertorManager = ConvertorManagerFactory.createDefaultManager();
when(mockedDeviceInfo.reserveXidForDeviceMessage()).thenReturn(TEST_XID);
Mockito.when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
- Mockito.when(config.isIsTableStatisticsPollingOn()).thenReturn(true);
- Mockito.when(config.isIsFlowStatisticsPollingOn()).thenReturn(true);
- Mockito.when(config.isIsGroupStatisticsPollingOn()).thenReturn(true);
- Mockito.when(config.isIsMeterStatisticsPollingOn()).thenReturn(true);
- Mockito.when(config.isIsPortStatisticsPollingOn()).thenReturn(true);
- Mockito.when(config.isIsQueueStatisticsPollingOn()).thenReturn(true);
+ Mockito.when(config.getIsTableStatisticsPollingOn()).thenReturn(true);
+ Mockito.when(config.getIsFlowStatisticsPollingOn()).thenReturn(true);
+ Mockito.when(config.getIsGroupStatisticsPollingOn()).thenReturn(true);
+ Mockito.when(config.getIsMeterStatisticsPollingOn()).thenReturn(true);
+ Mockito.when(config.getIsPortStatisticsPollingOn()).thenReturn(true);
+ Mockito.when(config.getIsQueueStatisticsPollingOn()).thenReturn(true);
Mockito.when(config.getBasicTimerDelay()).thenReturn(new NonZeroUint32Type(Uint32.valueOf(3000)));
Mockito.when(config.getMaximumTimerDelay()).thenReturn(new NonZeroUint32Type(Uint32.valueOf(50000)));
checkBarriersBetween(BatchStepType.FLOW_UPDATE, BatchStepType.METER_REMOVE);
}
- private void checkBarriersBetween(final BatchStepType typeOfFirst, final BatchStepType typeOfSecond) {
+ private static void checkBarriersBetween(final BatchStepType typeOfFirst, final BatchStepType typeOfSecond) {
final List<Batch> batches = Lists.newArrayList(createBatch(typeOfFirst), createBatch(typeOfSecond));
final List<BatchPlanStep> batchPlan = FlatBatchUtil.assembleBatchPlan(batches);
FlatBatchUtil.markBarriersWhereNeeded(batchPlan);
@Test
public void testMarkBarriersWhereNeeded_single() {
- final List<Batch> batches = Lists.newArrayList(
+ final List<Batch> batches = List.of(
//general part - no flush required
createBatch(BatchStepType.GROUP_REMOVE)
);
* Created by Martin Bobak mbobak@cisco.com on 7/29/14.
*/
public class PortTranslatorUtilTest {
-
private static final String MAC_ADDRESS = "00:01:02:03:04:05";
- private static final String NAME = "PortTranslatorTest";
- private final Boolean[] pfBls
- = {false, false, false, false, false, false, false, false, false, false, false, false, false, false,
- false, false};
- private final boolean[] pfV10Bls
- = {false, false, false, false, false, false, false, false, false, false, false, false};
- private final boolean[] portCfgBools = {false, false, false, false};
- private final boolean[] portCfgV10bools = {false, false, false, false, false, false, false};
- private final boolean[] portStateBools = {false, false, false, false};
- private final Uint32 currentSpeed = Uint32.valueOf(4294967295L);
private static final Uint32 MAX_SPEED = Uint32.valueOf(4294967295L);
+ private static final String NAME = "PortTranslatorTest";
+
+ private final Boolean[] pfBls = {
+ false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false
+ };
+
+ private final boolean[] pfV10Bls = {
+ false, false, false, false, false, false, false, false, false, false, false, false
+ };
+
+ private final boolean[] portCfgBools = { false, false, false, false };
+ private final boolean[] portCfgV10bools = { false, false, false, false, false, false, false };
+ private final boolean[] portStateBools = { false, false, false, false };
+ private final Uint32 currentSpeed = Uint32.MAX_VALUE;
/**
* Test method for
*/
@Test
public void testTranslatePortFeaturesV10() {
-
-
for (int i = 0; i < pfV10Bls.length; i++) {
-
pfV10Bls[i] = true;
final PortFeaturesV10 apfV10 = getPortFeaturesV10();
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures npf
= PortTranslatorUtil.translatePortFeatures(apfV10);
assertEqualsPortFeaturesV10(apfV10, npf);
pfV10Bls[i] = false;
-
}
-
}
private PortFeaturesV10 getPortFeaturesV10() {
Short version = OpenflowVersion.OF10.getVersion();
Uint64 dataPathId = Uint64.ONE;
- Uint32 portNumber = Uint32.valueOf(4294967295L);
+ Uint32 portNumber = Uint32.MAX_VALUE;
PortGrouping portGrouping = mockPortGrouping();
NodeConnectorUpdated nodeConnectorUpdated = PortTranslatorUtil
}
private static void assertEqualsPortFeaturesV10(final PortFeaturesV10 apfV10,
- final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types
- .port.rev130925.PortFeatures npf) {
- assertEquals(apfV10.is_100mbFd(), npf.isHundredMbFd());
- assertEquals(apfV10.is_100mbHd(), npf.isHundredMbHd());
-
- assertEquals(apfV10.is_10gbFd(), npf.isTenGbFd());
- assertEquals(apfV10.is_10mbFd(), npf.isTenMbFd());
- assertEquals(apfV10.is_10mbHd(), npf.isTenMbHd());
-
- assertEquals(apfV10.is_1gbFd(), npf.isOneGbFd());
- assertEquals(apfV10.is_1gbHd(), npf.isOneGbHd());
-
- assertEquals(apfV10.isAutoneg(), npf.isAutoeng());
- assertEquals(apfV10.isCopper(), npf.isCopper());
- assertEquals(apfV10.isFiber(), npf.isFiber());
- assertEquals(apfV10.isPause(), npf.isPause());
- assertEquals(apfV10.isPauseAsym(), npf.isPauseAsym());
+ final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures npf) {
+ assertEquals(apfV10.get_100mbFd(), npf.getHundredMbFd());
+ assertEquals(apfV10.get_100mbHd(), npf.getHundredMbHd());
+
+ assertEquals(apfV10.get_10gbFd(), npf.getTenGbFd());
+ assertEquals(apfV10.get_10mbFd(), npf.getTenMbFd());
+ assertEquals(apfV10.get_10mbHd(), npf.getTenMbHd());
+
+ assertEquals(apfV10.get_1gbFd(), npf.getOneGbFd());
+ assertEquals(apfV10.get_1gbHd(), npf.getOneGbHd());
+
+ assertEquals(apfV10.getAutoneg(), npf.getAutoeng());
+ assertEquals(apfV10.getCopper(), npf.getCopper());
+ assertEquals(apfV10.getFiber(), npf.getFiber());
+ assertEquals(apfV10.getPause(), npf.getPause());
+ assertEquals(apfV10.getPauseAsym(), npf.getPauseAsym());
}
private static void assertEqualsPortFeatures(final PortFeatures apf,
- final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port
- .rev130925.PortFeatures npf) {
- assertEquals(apf.is_100gbFd(), npf.isHundredGbFd());
- assertEquals(apf.is_100mbFd(), npf.isHundredMbFd());
- assertEquals(apf.is_100mbHd(), npf.isHundredMbHd());
-
- assertEquals(apf.is_10gbFd(), npf.isTenGbFd());
- assertEquals(apf.is_10mbFd(), npf.isTenMbFd());
- assertEquals(apf.is_10mbHd(), npf.isTenMbHd());
-
- assertEquals(apf.is_1gbFd(), npf.isOneGbFd());
- assertEquals(apf.is_1gbHd(), npf.isOneGbHd());
- assertEquals(apf.is_1tbFd(), npf.isOneTbFd());
-
- assertEquals(apf.is_40gbFd(), npf.isFortyGbFd());
-
- assertEquals(apf.isAutoneg(), npf.isAutoeng());
- assertEquals(apf.isCopper(), npf.isCopper());
- assertEquals(apf.isFiber(), npf.isFiber());
- assertEquals(apf.isOther(), npf.isOther());
- assertEquals(apf.isPause(), npf.isPause());
- assertEquals(apf.isPauseAsym(), npf.isPauseAsym());
+ final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures npf) {
+ assertEquals(apf.get_100gbFd(), npf.getHundredGbFd());
+ assertEquals(apf.get_100mbFd(), npf.getHundredMbFd());
+ assertEquals(apf.get_100mbHd(), npf.getHundredMbHd());
+
+ assertEquals(apf.get_10gbFd(), npf.getTenGbFd());
+ assertEquals(apf.get_10mbFd(), npf.getTenMbFd());
+ assertEquals(apf.get_10mbHd(), npf.getTenMbHd());
+
+ assertEquals(apf.get_1gbFd(), npf.getOneGbFd());
+ assertEquals(apf.get_1gbHd(), npf.getOneGbHd());
+ assertEquals(apf.get_1tbFd(), npf.getOneTbFd());
+
+ assertEquals(apf.get_40gbFd(), npf.getFortyGbFd());
+
+ assertEquals(apf.getAutoneg(), npf.getAutoeng());
+ assertEquals(apf.getCopper(), npf.getCopper());
+ assertEquals(apf.getFiber(), npf.getFiber());
+ assertEquals(apf.getOther(), npf.getOther());
+ assertEquals(apf.getPause(), npf.getPause());
+ assertEquals(apf.getPauseAsym(), npf.getPauseAsym());
}
-
}
private static final Set<Class<?>> TYPES = Collections.singleton(GroupDesc.class);
private org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.Buckets toSALBucketsDesc(
- List<BucketsList> bucketDescStats, short version) {
+ final List<BucketsList> bucketDescStats, final short version) {
final ActionResponseConvertorData data = new ActionResponseConvertorData(version);
data.setActionPath(ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION);
bucketDesc.setAction(actions);
} else {
- bucketDesc.setAction(Collections.emptyList());
+ bucketDesc.setAction(Collections.emptyMap());
}
bucketDesc.setWeight(bucketDetails.getWeight());
}
@Override
- public List<GroupDescStats> convert(List<GroupDesc> source, VersionConvertorData data) {
+ public List<GroupDescStats> convert(final List<GroupDesc> source, final VersionConvertorData data) {
List<GroupDescStats> convertedSALGroupsDesc = new ArrayList<>();
for (GroupDesc groupDesc : source) {
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor;
import java.util.ArrayList;
meterConfigStatsBuilder.withKey(new MeterConfigStatsKey(meterConfigStatsBuilder.getMeterId()));
MeterBandHeadersBuilder meterBandHeadersBuilder = new MeterBandHeadersBuilder();
- MeterFlags meterFlags = new MeterFlags(meterConfig.getFlags().isOFPMFBURST(),
- meterConfig.getFlags().isOFPMFKBPS(),
- meterConfig.getFlags().isOFPMFPKTPS(),
- meterConfig.getFlags().isOFPMFSTATS());
+ MeterFlags meterFlags = new MeterFlags(meterConfig.getFlags().getOFPMFBURST(),
+ meterConfig.getFlags().getOFPMFKBPS(), meterConfig.getFlags().getOFPMFPKTPS(),
+ meterConfig.getFlags().getOFPMFSTATS());
meterConfigStatsBuilder.setFlags(meterFlags);
List<MeterBandHeader> listBandHeaders = new ArrayList<>();
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor;
import java.util.ArrayList;
for (MeterBandHeader meterBandHeader : meterBandHeaders.nonnullMeterBandHeader().values()) {
// The band types :drop,DSCP_Remark or experimenter.
if (null != meterBandHeader.getMeterBandTypes() && null != meterBandHeader.getMeterBandTypes().getFlags()) {
- if (meterBandHeader.getMeterBandTypes().getFlags().isOfpmbtDrop()) {
+ if (meterBandHeader.getMeterBandTypes().getFlags().getOfpmbtDrop()) {
if (meterBandHeader.getBandType() != null) {
MeterBandDropBuilder meterBandDropBuilder = new MeterBandDropBuilder();
meterBandDropBuilder.setType(MeterBandType.OFPMBTDROP);
} else {
logBandTypeMissing(MeterBandType.OFPMBTDROP);
}
- } else if (meterBandHeader.getMeterBandTypes().getFlags().isOfpmbtDscpRemark()) {
+ } else if (meterBandHeader.getMeterBandTypes().getFlags().getOfpmbtDscpRemark()) {
if (meterBandHeader.getBandType() != null) {
MeterBandDscpRemarkBuilder meterBandDscpRemarkBuilder = new MeterBandDscpRemarkBuilder();
meterBandDscpRemarkBuilder.setType(MeterBandType.OFPMBTDSCPREMARK);
} else {
logBandTypeMissing(MeterBandType.OFPMBTDSCPREMARK);
}
- } else if (meterBandHeader.getMeterBandTypes().getFlags().isOfpmbtExperimenter()) {
+ } else if (meterBandHeader.getMeterBandTypes().getFlags().getOfpmbtExperimenter()) {
if (meterBandHeader.getBandType() != null) {
MeterBandExperimenterBuilder meterBandExperimenterBuilder = new MeterBandExperimenterBuilder();
meterBandExperimenterBuilder.setType(MeterBandType.OFPMBTEXPERIMENTER);
}
meterModInputBuilder.setMeterId(new MeterId(source.getMeterId().getValue()));
-
- if (null != source.getFlags()) {
- meterModInputBuilder.setFlags(new MeterFlags(source.getFlags().isMeterBurst(), source.getFlags()
- .isMeterKbps(), source.getFlags().isMeterPktps(), source.getFlags().isMeterStats()));
- } else {
-
+ final var sourceFlags = source.getFlags();
+ if (sourceFlags == null) {
/*
* As per 0F1.3.1,The rate field indicates the rate value above
* which the corresponding band may apply to packets (see 5.7.1).
* includes OFPMF_PKTPS, in which case the rate is in packets per
* seconds.
*/
-
meterModInputBuilder.setFlags(new MeterFlags(false, false, true, false));
+ } else {
+ meterModInputBuilder.setFlags(new MeterFlags(sourceFlags.getMeterBurst(), sourceFlags.getMeterKbps(),
+ sourceFlags.getMeterPktps(), sourceFlags.getMeterStats()));
}
if (source.getMeterBandHeaders() != null) {
* @param version Openflow version
* @return default empty port mod input
*/
- public static PortModInput defaultResult(short version) {
+ public static PortModInput defaultResult(final short version) {
return new PortModInputBuilder()
.setVersion(version)
.build();
}
private static PortConfig maskPortConfigFields(
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig configData) {
-
+ final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig configData) {
if (configData == null) {
return null;
}
-
- Boolean portDown = configData.isPORTDOWN();
- Boolean noRecv = configData.isNORECV();
- Boolean noFwd = configData.isNOFWD();
- Boolean noPacketIn = configData.isNOPACKETIN();
-
- return new PortConfig(noFwd, noPacketIn, noRecv, portDown);
-
+ return new PortConfig(configData.getNOFWD(), configData.getNOPACKETIN(), configData.getNORECV(),
+ configData.getPORTDOWN());
}
private static PortConfigV10 maskPortConfigV10Fields(
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig configData) {
-
+ final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig configData) {
if (configData == null) {
return null;
}
-
- Boolean portDown = configData.isPORTDOWN();
- Boolean noRecv = configData.isNORECV();
- Boolean noFwd = configData.isNOFWD();
- Boolean noPacketIn = configData.isNOPACKETIN();
-
- return new PortConfigV10(false, noFwd, noPacketIn, noRecv, true, true, portDown);
+ return new PortConfigV10(false, configData.getNOFWD(), configData.getNOPACKETIN(), configData.getNORECV(), true,
+ true, configData.getPORTDOWN());
}
- private static PortFeatures getPortFeatures(
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures salPortFeatures) {
-
- return new PortFeatures(salPortFeatures.isHundredGbFd(), salPortFeatures.isHundredMbFd(),
- salPortFeatures.isHundredMbHd(), salPortFeatures.isTenGbFd(), salPortFeatures.isTenMbFd(),
- salPortFeatures.isTenMbHd(), salPortFeatures.isOneGbFd(), salPortFeatures.isOneGbHd(),
- salPortFeatures.isOneTbFd(), salPortFeatures.isFortyGbFd(), salPortFeatures.isAutoeng(),
- salPortFeatures.isCopper(), salPortFeatures.isFiber(), salPortFeatures.isOther(),
- salPortFeatures.isPause(), salPortFeatures.isPauseAsym());
+ private static PortFeatures getPortFeatures(final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port
+ .rev130925.PortFeatures salPortFeatures) {
+ return new PortFeatures(salPortFeatures.getHundredGbFd(), salPortFeatures.getHundredMbFd(),
+ salPortFeatures.getHundredMbHd(), salPortFeatures.getTenGbFd(), salPortFeatures.getTenMbFd(),
+ salPortFeatures.getTenMbHd(), salPortFeatures.getOneGbFd(), salPortFeatures.getOneGbHd(),
+ salPortFeatures.getOneTbFd(), salPortFeatures.getFortyGbFd(), salPortFeatures.getAutoeng(),
+ salPortFeatures.getCopper(), salPortFeatures.getFiber(), salPortFeatures.getOther(),
+ salPortFeatures.getPause(), salPortFeatures.getPauseAsym());
}
- private static PortFeaturesV10 getPortFeaturesV10(
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures salPortFeatures) {
-
- return new PortFeaturesV10(salPortFeatures.isHundredMbFd(), salPortFeatures.isHundredMbHd(),
- salPortFeatures.isTenGbFd(), salPortFeatures.isTenMbFd(), salPortFeatures.isTenMbHd(),
- salPortFeatures.isOneGbFd(), salPortFeatures.isOneGbHd(), salPortFeatures.isAutoeng(),
- salPortFeatures.isCopper(), salPortFeatures.isFiber(), salPortFeatures.isPause(),
- salPortFeatures.isPauseAsym());
+ private static PortFeaturesV10 getPortFeaturesV10(final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types
+ .port.rev130925.PortFeatures salPortFeatures) {
+ return new PortFeaturesV10(salPortFeatures.getHundredMbFd(), salPortFeatures.getHundredMbHd(),
+ salPortFeatures.getTenGbFd(), salPortFeatures.getTenMbFd(), salPortFeatures.getTenMbHd(),
+ salPortFeatures.getOneGbFd(), salPortFeatures.getOneGbHd(), salPortFeatures.getAutoeng(),
+ salPortFeatures.getCopper(), salPortFeatures.getFiber(), salPortFeatures.getPause(),
+ salPortFeatures.getPauseAsym());
}
/**
*/
@VisibleForTesting
static Ports toPortDesc(
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.FlowCapablePort source,
- short version) {
+ final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.FlowCapablePort source,
+ final short version) {
PortsBuilder ofPortDescDataBuilder = new PortsBuilder();
}
private static PortState getPortState(
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortState state) {
-
- boolean isLinkDown = state.isLinkDown();
- boolean isBlocked = state.isBlocked();
- boolean isLive = state.isLive();
-
- return new PortState(isLinkDown, isBlocked, isLive);
-
+ final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortState state) {
+ return new PortState(state.getLinkDown(), state.getBlocked(), state.getLive());
}
@Override
}
@Override
- public PortModInput convert(Port source, VersionConvertorData data) {
+ public PortModInput convert(final Port source, final VersionConvertorData data) {
PortConfig config = maskPortConfigFields(source.getConfiguration());
PortConfigV10 configV10 = maskPortConfigV10Fields(source.getConfiguration());
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField>
ofTableFeatureClass = SAL_TO_OF_TABLE_FEATURES.get(currMatchType);
- setMatchEntry(matchEntryBuilder, ofTableFeatureClass, currMatch.isHasMask());
+ setMatchEntry(matchEntryBuilder, ofTableFeatureClass, currMatch.getHasMask());
matchEntriesList.add(matchEntryBuilder.build());
}
ofTableFeatures.setMaxEntries(salTableFeatures.getMaxEntries());
if (salTableFeatures.getConfig() != null) {
- ofTableFeatures.setConfig(new TableConfig(salTableFeatures.getConfig().isDEPRECATEDMASK()));
+ ofTableFeatures.setConfig(new TableConfig(salTableFeatures.getConfig().getDEPRECATEDMASK()));
}
ofTableFeatures.setTableFeatureProperties(toTableProperties(salTableFeatures.getTableProperties()));
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor;
import com.google.common.collect.ImmutableMap;
Class<? extends MatchField> ofMatchField = currMatch.getOxmMatchField();
if (setHasMask) {
- setFieldMatchBuilder.setHasMask(currMatch.isHasMask());
+ setFieldMatchBuilder.setHasMask(currMatch.getHasMask());
}
setFieldMatchBuilder.setMatchType(OF_TO_SAL_TABLE_FEATURE_PROPERTIES.get(ofMatchField));
}
if (ofTableFeatures.getConfig() != null) {
- salTableFeatures.setConfig(new TableConfig(ofTableFeatures.getConfig().isOFPTCDEPRECATEDMASK()));
+ salTableFeatures.setConfig(new TableConfig(ofTableFeatures.getConfig().getOFPTCDEPRECATEDMASK()));
}
salTableFeatures.setMaxEntries(ofTableFeatures.getMaxEntries());
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow;
import com.google.common.base.MoreObjects;
if (flow instanceof AddFlowInput || flow instanceof UpdatedFlow) {
flowMod.setCommand(FlowModCommand.OFPFCADD);
} else if (flow instanceof RemoveFlowInput) {
- if (MoreObjects.firstNonNull(flow.isStrict(), Boolean.FALSE)) {
+ if (MoreObjects.firstNonNull(flow.getStrict(), Boolean.FALSE)) {
flowMod.setCommand(FlowModCommand.OFPFCDELETESTRICT);
} else {
flowMod.setCommand(FlowModCommand.OFPFCDELETE);
// match on vlan tag or vlanid with no mask
VlanMatchBuilder vlanMatchBuilder = new VlanMatchBuilder(srcVlanMatch);
VlanIdBuilder vlanIdBuilder = new VlanIdBuilder();
- vlanIdBuilder.setVlanIdPresent(srcVlanMatch.getVlanId().isVlanIdPresent());
+ vlanIdBuilder.setVlanIdPresent(srcVlanMatch.getVlanId().getVlanIdPresent());
vlanIdBuilder.setVlanId(srcVlanMatch.getVlanId().getVlanId());
vlanMatchBuilder.setVlanId(vlanIdBuilder.build());
Match match = new MatchBuilder(srcMatch).setVlanMatch(vlanMatchBuilder.build()).build();
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow;
import java.util.Collection;
private static final List<Class<?>> TYPES = Collections.singletonList(
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags.class);
-
/**
* Create default empty flow flags
* Use this method, if result from converter is empty.
final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags source,
final VersionConvertorData data) {
return new FlowModFlags(
- source.isCHECKOVERLAP(), source.isNOBYTCOUNTS(), source.isNOPKTCOUNTS(),
- source.isRESETCOUNTS(), source.isSENDFLOWREM());
+ source.getCHECKOVERLAP(), source.getNOBYTCOUNTS(), source.getNOPKTCOUNTS(),
+ source.getRESETCOUNTS(), source.getSENDFLOWREM());
}
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow;
import java.util.Collection;
@Override
public FlowModFlagsV10 convert(final FlowModFlags source, final VersionConvertorData data) {
return new FlowModFlagsV10(
- source.isCHECKOVERLAP(), FlowConvertor.DEFAULT_OFPFF_EMERGENCY, source.isSENDFLOWREM());
+ source.getCHECKOVERLAP(), FlowConvertor.DEFAULT_OFPFF_EMERGENCY, source.getSENDFLOWREM());
}
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow;
import java.util.ArrayList;
salFlowStatsBuilder.setFlags(
- new FlowModFlags(flowStats.getFlags().isOFPFFCHECKOVERLAP(),
- flowStats.getFlags().isOFPFFRESETCOUNTS(),
- flowStats.getFlags().isOFPFFNOPKTCOUNTS(),
- flowStats.getFlags().isOFPFFNOBYTCOUNTS(),
- flowStats.getFlags().isOFPFFSENDFLOWREM()));
+ new FlowModFlags(flowStats.getFlags().getOFPFFCHECKOVERLAP(),
+ flowStats.getFlags().getOFPFFRESETCOUNTS(),
+ flowStats.getFlags().getOFPFFNOPKTCOUNTS(),
+ flowStats.getFlags().getOFPFFNOBYTCOUNTS(),
+ flowStats.getFlags().getOFPFFSENDFLOWREM()));
}
if (flowStats.getInstruction() != null) {
flowStats.getInstruction(), simpleConvertorData);
salFlowStatsBuilder.setInstructions(instructions.orElse(new InstructionsBuilder()
- .setInstruction(Collections.emptyList()).build()));
+ .setInstruction(Collections.emptyMap()).build()));
}
result.add(salFlowStatsBuilder.build());
Uint16 vidEntryValue = Uint16.ZERO;
boolean hasmask = false;
- if (Boolean.TRUE.equals(vlanId.isVlanIdPresent())) {
+ if (Boolean.TRUE.equals(vlanId.getVlanIdPresent())) {
setCfiBit = true;
if (vlanId.getVlanId() != null) {
vidEntryValue = vlanId.getVlanId().getValue();
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
* @return integer containing lower 9 bits filled with corresponding flags
*/
public static Integer ipv6ExthdrFlagsToInt(final Ipv6ExthdrFlags flags) {
+ // FIXME: this should be 'int'
Integer bitmap = 0;
- bitmap |= flags.isNonext() ? 1 : 0;
- bitmap |= flags.isEsp() ? 1 << 1 : 0;
- bitmap |= flags.isAuth() ? 1 << 2 : 0;
- bitmap |= flags.isDest() ? 1 << 3 : 0;
- bitmap |= flags.isFrag() ? 1 << 4 : 0;
- bitmap |= flags.isRouter() ? 1 << 5 : 0;
- bitmap |= flags.isHop() ? 1 << 6 : 0;
- bitmap |= flags.isUnrep() ? 1 << 7 : 0;
- bitmap |= flags.isUnseq() ? 1 << 8 : 0;
+ // FIXME: use explicit if (flags) { bitmap |= 1 << 2; }
+ bitmap |= flags.getNonext() ? 1 : 0;
+ bitmap |= flags.getEsp() ? 1 << 1 : 0;
+ bitmap |= flags.getAuth() ? 1 << 2 : 0;
+ bitmap |= flags.getDest() ? 1 << 3 : 0;
+ bitmap |= flags.getFrag() ? 1 << 4 : 0;
+ bitmap |= flags.getRouter() ? 1 << 5 : 0;
+ bitmap |= flags.getHop() ? 1 << 6 : 0;
+ bitmap |= flags.getUnrep() ? 1 << 7 : 0;
+ bitmap |= flags.getUnseq() ? 1 << 8 : 0;
return bitmap;
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match;
import java.util.Collection;
OpenflowVersion ofVersion = OpenflowVersion.get(datapathIdConvertorData.getVersion());
Uint64 datapathid = datapathIdConvertorData.getDatapathId();
- if (!source.getWildcards().isINPORT() && source.getInPort() != null) {
+ if (!source.getWildcards().getINPORT() && source.getInPort() != null) {
matchBuilder.setInPort(InventoryDataServiceUtil.nodeConnectorIdfromDatapathPortNo(datapathid,
Uint32.valueOf(source.getInPort()), ofVersion));
}
- if (!source.getWildcards().isDLSRC() && source.getDlSrc() != null) {
+ if (!source.getWildcards().getDLSRC() && source.getDlSrc() != null) {
EthernetSourceBuilder ethSrcBuilder = new EthernetSourceBuilder();
ethSrcBuilder.setAddress(source.getDlSrc());
ethMatchBuilder.setEthernetSource(ethSrcBuilder.build());
matchBuilder.setEthernetMatch(ethMatchBuilder.build());
}
- if (!source.getWildcards().isDLDST() && source.getDlDst() != null) {
+ if (!source.getWildcards().getDLDST() && source.getDlDst() != null) {
EthernetDestinationBuilder ethDstBuilder = new EthernetDestinationBuilder();
ethDstBuilder.setAddress(source.getDlDst());
ethMatchBuilder.setEthernetDestination(ethDstBuilder.build());
matchBuilder.setEthernetMatch(ethMatchBuilder.build());
}
- if (!source.getWildcards().isDLTYPE() && source.getDlType() != null) {
+ if (!source.getWildcards().getDLTYPE() && source.getDlType() != null) {
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType(
Uint32.valueOf(source.getDlType())));
ethMatchBuilder.setEthernetType(ethTypeBuilder.build());
matchBuilder.setEthernetMatch(ethMatchBuilder.build());
}
- if (!source.getWildcards().isDLVLAN() && source.getDlVlan() != null) {
+ if (!source.getWildcards().getDLVLAN() && source.getDlVlan() != null) {
VlanIdBuilder vlanIdBuilder = new VlanIdBuilder();
int vlanId = source.getDlVlan().toJava() == 0xffff ? 0 : source.getDlVlan().toJava();
vlanIdBuilder.setVlanId(
vlanMatchBuilder.setVlanId(vlanIdBuilder.build());
matchBuilder.setVlanMatch(vlanMatchBuilder.build());
}
- if (!source.getWildcards().isDLVLANPCP() && source.getDlVlanPcp() != null) {
+ if (!source.getWildcards().getDLVLANPCP() && source.getDlVlanPcp() != null) {
vlanMatchBuilder.setVlanPcp(new org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp(
source.getDlVlanPcp()));
matchBuilder.setVlanMatch(vlanMatchBuilder.build());
}
- if (!source.getWildcards().isDLTYPE() && source.getNwSrc() != null) {
+ if (!source.getWildcards().getDLTYPE() && source.getNwSrc() != null) {
final Ipv4Prefix prefix;
if (source.getNwSrcMask() != null) {
prefix = IetfInetUtil.INSTANCE.ipv4PrefixFor(source.getNwSrc(), source.getNwSrcMask().toJava());
matchBuilder.setLayer3Match(ipv4MatchBuilder.build());
}
}
- if (!source.getWildcards().isDLTYPE() && source.getNwDst() != null) {
+ if (!source.getWildcards().getDLTYPE() && source.getNwDst() != null) {
final Ipv4Prefix prefix;
if (source.getNwDstMask() != null) {
prefix = IetfInetUtil.INSTANCE.ipv4PrefixFor(source.getNwDst(), source.getNwDstMask().toJava());
matchBuilder.setLayer3Match(ipv4MatchBuilder.build());
}
}
- if (!source.getWildcards().isNWPROTO() && source.getNwProto() != null) {
+ if (!source.getWildcards().getNWPROTO() && source.getNwProto() != null) {
Uint8 nwProto = source.getNwProto();
ipMatchBuilder.setIpProtocol(nwProto);
matchBuilder.setIpMatch(ipMatchBuilder.build());
if (proto == PROTO_TCP) {
TcpMatchBuilder tcpMatchBuilder = new TcpMatchBuilder();
boolean hasTcp = false;
- if (!source.getWildcards().isTPSRC() && source.getTpSrc() != null) {
+ if (!source.getWildcards().getTPSRC() && source.getTpSrc() != null) {
tcpMatchBuilder.setTcpSourcePort(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf
.inet.types.rev130715.PortNumber(source.getTpSrc()));
hasTcp = true;
}
- if (!source.getWildcards().isTPDST() && source.getTpDst() != null) {
+ if (!source.getWildcards().getTPDST() && source.getTpDst() != null) {
tcpMatchBuilder.setTcpDestinationPort(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
.ietf.inet.types.rev130715.PortNumber(source.getTpDst()));
hasTcp = true;
} else if (proto == PROTO_UDP) {
UdpMatchBuilder udpMatchBuilder = new UdpMatchBuilder();
boolean hasUdp = false;
- if (!source.getWildcards().isTPSRC() && source.getTpSrc() != null) {
+ if (!source.getWildcards().getTPSRC() && source.getTpSrc() != null) {
udpMatchBuilder.setUdpSourcePort(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf
.inet.types.rev130715.PortNumber(source.getTpSrc()));
hasUdp = true;
}
- if (!source.getWildcards().isTPDST() && source.getTpDst() != null) {
+ if (!source.getWildcards().getTPDST() && source.getTpDst() != null) {
udpMatchBuilder.setUdpDestinationPort(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
.ietf.inet.types.rev130715.PortNumber(source.getTpDst()));
hasUdp = true;
} else if (proto == PROTO_ICMPV4) {
Icmpv4MatchBuilder icmpv4MatchBuilder = new Icmpv4MatchBuilder();
boolean hasIcmpv4 = false;
- if (!source.getWildcards().isTPSRC()) {
+ if (!source.getWildcards().getTPSRC()) {
Uint16 type = source.getTpSrc();
if (type != null) {
- icmpv4MatchBuilder.setIcmpv4Type(type.shortValue());
+ icmpv4MatchBuilder.setIcmpv4Type(type.toUint8());
hasIcmpv4 = true;
}
}
- if (!source.getWildcards().isTPDST()) {
+ if (!source.getWildcards().getTPDST()) {
Uint16 code = source.getTpDst();
if (code != null) {
- icmpv4MatchBuilder.setIcmpv4Code(code.shortValue());
+ icmpv4MatchBuilder.setIcmpv4Code(code.toUint8());
hasIcmpv4 = true;
}
}
}
}
}
- if (!source.getWildcards().isNWTOS() && source.getNwTos() != null) {
+ if (!source.getWildcards().getNWTOS() && source.getNwTos() != null) {
ipMatchBuilder.setIpDscp(new Dscp(ActionUtil.tosToDscp(source.getNwTos())));
matchBuilder.setIpMatch(ipMatchBuilder.build());
}
}
@Override
- public Optional<MatchBuilder> process(@NonNull MplsBosCase source, MatchResponseConvertorData data,
- ConvertorExecutor convertorExecutor) {
+ public Optional<MatchBuilder> process(@NonNull final MplsBosCase source, final MatchResponseConvertorData data,
+ final ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final ProtocolMatchFieldsBuilder protocolMatchFieldsBuilder = data.getProtocolMatchFieldsBuilder();
MplsBos mplsBos = source.getMplsBos();
if (mplsBos != null) {
- protocolMatchFieldsBuilder.setMplsBos(mplsBos.isBos() ? Uint8.ONE : Uint8.ZERO);
+ protocolMatchFieldsBuilder.setMplsBos(mplsBos.getBos() ? Uint8.ONE : Uint8.ZERO);
matchBuilder.setProtocolMatchFields(protocolMatchFieldsBuilder.build());
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.cases;
import java.util.Optional;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.data.MatchResponseConvertorData;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanVidCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.vlan.vid._case.VlanVid;
}
@Override
- public Optional<MatchBuilder> process(@NonNull VlanVidCase source, MatchResponseConvertorData data,
- ConvertorExecutor convertorExecutor) {
+ public Optional<MatchBuilder> process(@NonNull final VlanVidCase source, final MatchResponseConvertorData data,
+ final ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
- final VlanMatchBuilder vlanMatchBuilder = data.getVlanMatchBuilder();
-
final VlanVid vlanVid = source.getVlanVid();
-
if (vlanVid != null) {
- VlanIdBuilder vlanBuilder = new VlanIdBuilder();
- vlanBuilder.setVlanId(new VlanId(vlanVid.getVlanVid()));
- vlanBuilder.setVlanIdPresent(vlanVid.isCfiBit());
- vlanMatchBuilder.setVlanId(vlanBuilder.build());
- matchBuilder.setVlanMatch(vlanMatchBuilder.build());
+ matchBuilder.setVlanMatch(data.getVlanMatchBuilder()
+ .setVlanId(new VlanIdBuilder()
+ .setVlanId(new VlanId(vlanVid.getVlanVid()))
+ .setVlanIdPresent(vlanVid.getCfiBit())
+ .build())
+ .build());
}
return Optional.of(matchBuilder);
int cnt = 0;
for (MeterConfigStats meterConfigStats: meterConfigs) {
assertEquals(cnt, meterConfigStats.getMeterId().getValue().toJava());
- assertTrue(meterConfigStats.getFlags().isMeterBurst());
- assertFalse(meterConfigStats.getFlags().isMeterKbps());
- assertTrue(meterConfigStats.getFlags().isMeterPktps());
- assertFalse(meterConfigStats.getFlags().isMeterStats());
+ assertTrue(meterConfigStats.getFlags().getMeterBurst());
+ assertFalse(meterConfigStats.getFlags().getMeterKbps());
+ assertTrue(meterConfigStats.getFlags().getMeterPktps());
+ assertFalse(meterConfigStats.getFlags().getMeterStats());
cnt++;
}
MeterModInputBuilder outMeterModInput = convert(meterInputCommand, new VersionConvertorData((short) 0X4));
assertEquals(MeterModCommand.OFPMCADD, outMeterModInput.getCommand());
- assertTrue(outMeterModInput.getFlags().isOFPMFBURST());
+ assertTrue(outMeterModInput.getFlags().getOFPMFBURST());
assertEquals(Uint32.valueOf(10L), outMeterModInput.getMeterId().getValue());
// BandInformation starts here:
MeterModInputBuilder outMeterModInput = convert(meterInputCommand, new VersionConvertorData((short) 0X4));
assertEquals(MeterModCommand.OFPMCADD, outMeterModInput.getCommand());
- assertFalse(outMeterModInput.getFlags().isOFPMFBURST());
- assertTrue(outMeterModInput.getFlags().isOFPMFPKTPS());
+ assertFalse(outMeterModInput.getFlags().getOFPMFBURST());
+ assertTrue(outMeterModInput.getFlags().getOFPMFPKTPS());
assertEquals(Uint32.TEN, outMeterModInput.getMeterId().getValue());
// BandInformation starts here:
MeterModInputBuilder outMeterModInput = convert(meterInputCommand, new VersionConvertorData((short) 0X4));
assertEquals(MeterModCommand.OFPMCADD, outMeterModInput.getCommand());
- assertTrue(outMeterModInput.getFlags().isOFPMFBURST());
+ assertTrue(outMeterModInput.getFlags().getOFPMFBURST());
assertEquals(Uint32.valueOf(10L), outMeterModInput.getMeterId().getValue());
}
MeterModInputBuilder outMeterModInput = convert(meterInputCommand, new VersionConvertorData((short) 0X4));
assertEquals(MeterModCommand.OFPMCADD, outMeterModInput.getCommand());
- assertTrue(outMeterModInput.getFlags().isOFPMFBURST());
+ assertTrue(outMeterModInput.getFlags().getOFPMFBURST());
assertEquals(Uint32.valueOf(10L), outMeterModInput.getMeterId().getValue());
// BandInformation starts here:
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor;
import java.util.ArrayList;
Assert.assertEquals("Wrong name", "Aloha", feature.getName());
Assert.assertEquals("Wrong metadata match", Uint64.valueOf("0001020304050607", 16), feature.getMetadataMatch());
Assert.assertEquals("Wrong metadata write", Uint64.valueOf("08090A0B0C0D0E0F", 16), feature.getMetadataWrite());
- Assert.assertEquals("Wrong config", false, feature.getConfig().isDEPRECATEDMASK());
+ Assert.assertEquals("Wrong config", false, feature.getConfig().getDEPRECATEDMASK());
Assert.assertEquals("Wrong max-entries", 42, feature.getMaxEntries().intValue());
Assert.assertEquals("Wrong properties", 0, feature.getTableProperties().nonnullTableFeatureProperties().size());
}
Assert.assertEquals("Wrong name", "Aloha", feature.getName());
Assert.assertEquals("Wrong metadata match", Uint64.valueOf("0001020304050607", 16), feature.getMetadataMatch());
Assert.assertEquals("Wrong metadata write",Uint64.valueOf("08090A0B0C0D0E0F", 16), feature.getMetadataWrite());
- Assert.assertEquals("Wrong config", false, feature.getConfig().isDEPRECATEDMASK());
+ Assert.assertEquals("Wrong config", false, feature.getConfig().getDEPRECATEDMASK());
Assert.assertEquals("Wrong max-entries", 42, feature.getMaxEntries().intValue());
Assert.assertEquals("Wrong properties", 4, feature.getTableProperties().nonnullTableFeatureProperties().size());
Assert.assertEquals("Wrong name", "Mahalo", feature.getName());
Assert.assertEquals("Wrong metadata match", Uint64.valueOf("08090A0B0C0D0E0F", 16), feature.getMetadataMatch());
Assert.assertEquals("Wrong metadata write", Uint64.valueOf("0001020304050607", 16), feature.getMetadataWrite());
- Assert.assertEquals("Wrong config", false, feature.getConfig().isDEPRECATEDMASK());
+ Assert.assertEquals("Wrong config", false, feature.getConfig().getDEPRECATEDMASK());
Assert.assertEquals("Wrong max-entries", 24, feature.getMaxEntries().intValue());
Assert.assertEquals("Wrong properties", 12, feature.getTableProperties().getTableFeatureProperties().size());
featProps = feature.getTableProperties().nonnullTableFeatureProperties().values().iterator();
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action;
import java.util.ArrayList;
org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanVid.class, false);
Assert.assertEquals("Wrong vlan vid", 0, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid().getVlanVid()
.intValue());
- Assert.assertEquals("Wrong cfi bit", true, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid().isCfiBit());
+ Assert.assertEquals("Wrong cfi bit", true, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid().getCfiBit());
action = actions.get(2);
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
Assert.assertEquals("Wrong vlan id", 22, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid()
.getVlanVid().intValue());
Assert.assertEquals("Wrong cfi bit", true, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid()
- .isCfiBit());
+ .getCfiBit());
action = actions.get(10);
setFieldCase = (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping
final boolean hasMask) {
Assert.assertEquals("Wrong oxm class", OpenflowBasicClass.class, entry.getOxmClass());
Assert.assertEquals("Wrong oxm field", field, entry.getOxmMatchField());
- Assert.assertEquals("Wrong hasMask", hasMask, entry.isHasMask());
+ Assert.assertEquals("Wrong hasMask", hasMask, entry.getHasMask());
}
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.Optional;
import org.junit.Assert;
import org.junit.Before;
instructionBuilder = new InstructionBuilder();
WriteActionsCaseBuilder writeCaseBuilder = new WriteActionsCaseBuilder();
WriteActionsBuilder writeBuilder = new WriteActionsBuilder();
- List<Action> actions = new ArrayList<>();
- writeBuilder.setAction(actions);
+ writeBuilder.setAction(Map.of());
writeCaseBuilder.setWriteActions(writeBuilder.build());
instructionBuilder.setInstruction(writeCaseBuilder.build());
instructionBuilder.setOrder(2);
instructionBuilder = new InstructionBuilder();
ApplyActionsCaseBuilder applyCaseBuilder = new ApplyActionsCaseBuilder();
ApplyActionsBuilder applyBuilder = new ApplyActionsBuilder();
- actions = new ArrayList<>();
- applyBuilder.setAction(actions);
+ applyBuilder.setAction(Map.of());
applyCaseBuilder.setApplyActions(applyBuilder.build());
instructionBuilder.setInstruction(applyCaseBuilder.build());
instructionBuilder.setOrder(3);
instructionBuilder = new InstructionBuilder();
ClearActionsCaseBuilder clearCaseBuilder = new ClearActionsCaseBuilder();
ClearActionsBuilder clearBuilder = new ClearActionsBuilder();
- actions = new ArrayList<>();
- clearBuilder.setAction(actions);
+ clearBuilder.setAction(Map.of());
clearCaseBuilder.setClearActions(clearBuilder.build());
instructionBuilder.setInstruction(clearCaseBuilder.build());
instructionBuilder.setOrder(4);
*/
package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+
import java.util.List;
import java.util.Optional;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.openflowplugin.api.OFConstants;
Optional<List<MatchEntry>> entriesOptional =
converterManager.convert(match, new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
- Assert.assertEquals("Wrong entries size", 24, entries.size());
+ assertEquals("Wrong entries size", 24, entries.size());
MatchEntry entry = entries.get(0);
checkEntryHeader(entry, InPort.class, false);
- Assert.assertEquals("Wrong in port", 1, ((InPortCase) entry.getMatchEntryValue()).getInPort()
+ assertEquals("Wrong in port", 1, ((InPortCase) entry.getMatchEntryValue()).getInPort()
.getPortNumber().getValue().intValue());
entry = entries.get(1);
checkEntryHeader(entry, InPhyPort.class, false);
- Assert.assertEquals("Wrong in phy port", 2, ((InPhyPortCase) entry.getMatchEntryValue())
+ assertEquals("Wrong in phy port", 2, ((InPhyPortCase) entry.getMatchEntryValue())
.getInPhyPort().getPortNumber().getValue().intValue());
entry = entries.get(2);
checkEntryHeader(entry, Metadata.class, false);
- Assert.assertArrayEquals("Wrong metadata", new byte[]{0, 0, 0, 0, 0, 0, 0, 3},
+ assertArrayEquals("Wrong metadata", new byte[]{0, 0, 0, 0, 0, 0, 0, 3},
((MetadataCase) entry.getMatchEntryValue()).getMetadata().getMetadata());
entry = entries.get(3);
checkEntryHeader(entry, EthDst.class, false);
- Assert.assertEquals("Wrong eth dst", new MacAddress("00:00:00:00:00:06"),
+ assertEquals("Wrong eth dst", new MacAddress("00:00:00:00:00:06"),
((EthDstCase) entry.getMatchEntryValue()).getEthDst().getMacAddress());
entry = entries.get(4);
checkEntryHeader(entry, EthSrc.class, false);
- Assert.assertEquals("Wrong eth src", new MacAddress("00:00:00:00:00:05"),
+ assertEquals("Wrong eth src", new MacAddress("00:00:00:00:00:05"),
((EthSrcCase) entry.getMatchEntryValue()).getEthSrc().getMacAddress());
entry = entries.get(5);
checkEntryHeader(entry, EthType.class, false);
- Assert.assertEquals("Wrong eth type", 4, ((EthTypeCase) entry.getMatchEntryValue())
+ assertEquals("Wrong eth type", 4, ((EthTypeCase) entry.getMatchEntryValue())
.getEthType().getEthType().getValue().intValue());
entry = entries.get(6);
checkEntryHeader(entry, VlanVid.class, false);
- Assert.assertEquals("Wrong vlan id", 7, ((VlanVidCase) entry.getMatchEntryValue())
+ assertEquals("Wrong vlan id", 7, ((VlanVidCase) entry.getMatchEntryValue())
.getVlanVid().getVlanVid().intValue());
- Assert.assertEquals("Wrong cfi bit", true, ((VlanVidCase) entry.getMatchEntryValue())
- .getVlanVid().isCfiBit());
+ assertEquals("Wrong cfi bit", true, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid().getCfiBit());
entry = entries.get(7);
checkEntryHeader(entry,
org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanPcp.class, false);
- Assert.assertEquals("Wrong vlan pcp", 7, ((VlanPcpCase) entry.getMatchEntryValue())
+ assertEquals("Wrong vlan pcp", 7, ((VlanPcpCase) entry.getMatchEntryValue())
.getVlanPcp().getVlanPcp().intValue());
entry = entries.get(8);
checkEntryHeader(entry, IpDscp.class, false);
- Assert.assertEquals("Wrong ip dscp", 8, ((IpDscpCase) entry.getMatchEntryValue())
+ assertEquals("Wrong ip dscp", 8, ((IpDscpCase) entry.getMatchEntryValue())
.getIpDscp().getDscp().getValue().intValue());
entry = entries.get(9);
checkEntryHeader(entry, IpEcn.class, false);
- Assert.assertEquals("Wrong ip ecn", 9, ((IpEcnCase) entry.getMatchEntryValue())
+ assertEquals("Wrong ip ecn", 9, ((IpEcnCase) entry.getMatchEntryValue())
.getIpEcn().getEcn().intValue());
entry = entries.get(10);
checkEntryHeader(entry, IpProto.class, false);
- Assert.assertEquals("Wrong ip proto", 10, ((IpProtoCase) entry.getMatchEntryValue())
+ assertEquals("Wrong ip proto", 10, ((IpProtoCase) entry.getMatchEntryValue())
.getIpProto().getProtocolNumber().intValue());
entry = entries.get(11);
checkEntryHeader(entry, TcpSrc.class, false);
- Assert.assertEquals("Wrong tcp src", 11, ((TcpSrcCase) entry.getMatchEntryValue())
+ assertEquals("Wrong tcp src", 11, ((TcpSrcCase) entry.getMatchEntryValue())
.getTcpSrc().getPort().getValue().intValue());
entry = entries.get(12);
checkEntryHeader(entry, TcpDst.class, false);
- Assert.assertEquals("Wrong tcp dst", 12, ((TcpDstCase) entry.getMatchEntryValue())
+ assertEquals("Wrong tcp dst", 12, ((TcpDstCase) entry.getMatchEntryValue())
.getTcpDst().getPort().getValue().intValue());
entry = entries.get(13);
checkEntryHeader(entry, Icmpv4Type.class, false);
- Assert.assertEquals("Wrong icmpv4 type", 13, ((Icmpv4TypeCase) entry.getMatchEntryValue())
+ assertEquals("Wrong icmpv4 type", 13, ((Icmpv4TypeCase) entry.getMatchEntryValue())
.getIcmpv4Type().getIcmpv4Type().intValue());
entry = entries.get(14);
checkEntryHeader(entry, Icmpv4Code.class, false);
- Assert.assertEquals("Wrong icmpv4 code", 14, ((Icmpv4CodeCase) entry.getMatchEntryValue())
+ assertEquals("Wrong icmpv4 code", 14, ((Icmpv4CodeCase) entry.getMatchEntryValue())
.getIcmpv4Code().getIcmpv4Code().intValue());
entry = entries.get(15);
checkEntryHeader(entry, Icmpv6Type.class, false);
- Assert.assertEquals("Wrong icmpv6 type", 15, ((Icmpv6TypeCase) entry.getMatchEntryValue())
+ assertEquals("Wrong icmpv6 type", 15, ((Icmpv6TypeCase) entry.getMatchEntryValue())
.getIcmpv6Type().getIcmpv6Type().intValue());
entry = entries.get(16);
checkEntryHeader(entry, Icmpv6Code.class, false);
- Assert.assertEquals("Wrong icmpv6 code", 16, ((Icmpv6CodeCase) entry.getMatchEntryValue())
+ assertEquals("Wrong icmpv6 code", 16, ((Icmpv6CodeCase) entry.getMatchEntryValue())
.getIcmpv6Code().getIcmpv6Code().intValue());
entry = entries.get(17);
checkEntryHeader(entry, Ipv4Src.class, false);
- Assert.assertEquals("Wrong ipv4 src", "10.0.0.1", ((Ipv4SrcCase) entry.getMatchEntryValue())
+ assertEquals("Wrong ipv4 src", "10.0.0.1", ((Ipv4SrcCase) entry.getMatchEntryValue())
.getIpv4Src().getIpv4Address().getValue());
entry = entries.get(18);
checkEntryHeader(entry, Ipv4Dst.class, false);
- Assert.assertEquals("Wrong ipv4 dst", "10.0.0.2", ((Ipv4DstCase) entry.getMatchEntryValue())
+ assertEquals("Wrong ipv4 dst", "10.0.0.2", ((Ipv4DstCase) entry.getMatchEntryValue())
.getIpv4Dst().getIpv4Address().getValue());
entry = entries.get(19);
checkEntryHeader(entry, MplsLabel.class, false);
- Assert.assertEquals("Wrong mpls label", 17, ((MplsLabelCase) entry.getMatchEntryValue())
+ assertEquals("Wrong mpls label", 17, ((MplsLabelCase) entry.getMatchEntryValue())
.getMplsLabel().getMplsLabel().intValue());
entry = entries.get(20);
checkEntryHeader(entry, MplsBos.class, false);
- Assert.assertEquals("Wrong mpls bos", true, ((MplsBosCase) entry.getMatchEntryValue()).getMplsBos().isBos());
+ assertEquals("Wrong mpls bos", true, ((MplsBosCase) entry.getMatchEntryValue()).getMplsBos().getBos());
entry = entries.get(21);
checkEntryHeader(entry, MplsTc.class, false);
- Assert.assertEquals("Wrong mpls tc", 18, ((MplsTcCase) entry.getMatchEntryValue())
+ assertEquals("Wrong mpls tc", 18, ((MplsTcCase) entry.getMatchEntryValue())
.getMplsTc().getTc().intValue());
entry = entries.get(22);
checkEntryHeader(entry, PbbIsid.class, false);
- Assert.assertEquals("Wrong pbb isid", 20, ((PbbIsidCase) entry.getMatchEntryValue())
+ assertEquals("Wrong pbb isid", 20, ((PbbIsidCase) entry.getMatchEntryValue())
.getPbbIsid().getIsid().intValue());
entry = entries.get(23);
checkEntryHeader(entry, TunnelId.class, false);
- Assert.assertArrayEquals("Wrong tunnel id", new byte[]{0, 0, 0, 0, 0, 0, 0, 21},
+ assertArrayEquals("Wrong tunnel id", new byte[]{0, 0, 0, 0, 0, 0, 0, 21},
((TunnelIdCase) entry.getMatchEntryValue()).getTunnelId().getTunnelId());
}
- private static void checkEntryHeader(MatchEntry entry, Class<? extends MatchField> field, boolean hasMask) {
- Assert.assertEquals("Wrong oxm class", OpenflowBasicClass.class, entry.getOxmClass());
- Assert.assertEquals("Wrong oxm field", field, entry.getOxmMatchField());
- Assert.assertEquals("Wrong hasMask", hasMask, entry.isHasMask());
+ private static void checkEntryHeader(final MatchEntry entry, final Class<? extends MatchField> field,
+ final boolean hasMask) {
+ assertEquals("Wrong oxm class", OpenflowBasicClass.class, entry.getOxmClass());
+ assertEquals("Wrong oxm field", field, entry.getOxmMatchField());
+ assertEquals("Wrong hasMask", hasMask, entry.getHasMask());
}
@Test
Optional<List<MatchEntry>> entriesOptional = converterManager.convert(match,
new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
- Assert.assertEquals("Wrong entries size", 2, entries.size());
+ assertEquals("Wrong entries size", 2, entries.size());
MatchEntry entry = entries.get(0);
checkEntryHeader(entry, Ipv4Src.class, false);
- Assert.assertEquals("wrong Ipv4Address source", "10.2.2.2",
+ assertEquals("wrong Ipv4Address source", "10.2.2.2",
((Ipv4SrcCase) entry.getMatchEntryValue()).getIpv4Src().getIpv4Address().getValue());
entry = entries.get(1);
checkEntryHeader(entry, Ipv4Dst.class, false);
- Assert.assertEquals("wrong Ipv4Address destination", "10.1.1.1",
+ assertEquals("wrong Ipv4Address destination", "10.1.1.1",
((Ipv4DstCase) entry.getMatchEntryValue()).getIpv4Dst().getIpv4Address().getValue());
}
Optional<List<MatchEntry>> entriesOptional = converterManager.convert(match,
new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
- Assert.assertEquals("Wrong entries size", 2, entries.size());
+ assertEquals("Wrong entries size", 2, entries.size());
MatchEntry entry = entries.get(0);
checkEntryHeader(entry, Ipv4Src.class, true);
- Assert.assertEquals("wrong Ipv4Address source", "10.2.2.2",
+ assertEquals("wrong Ipv4Address source", "10.2.2.2",
((Ipv4SrcCase) entry.getMatchEntryValue()).getIpv4Src().getIpv4Address().getValue());
entry = entries.get(1);
checkEntryHeader(entry, Ipv4Dst.class, true);
- Assert.assertEquals("wrong Ipv4Adress destination", "10.1.1.1",
+ assertEquals("wrong Ipv4Adress destination", "10.1.1.1",
((Ipv4DstCase) entry.getMatchEntryValue()).getIpv4Dst().getIpv4Address().getValue());
}
Optional<List<MatchEntry>> entriesOptional =
converterManager.convert(match, new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
- Assert.assertEquals("Wrong entries size", 2, entries.size());
+ assertEquals("Wrong entries size", 2, entries.size());
MatchEntry entry = entries.get(0);
checkEntryHeader(entry, UdpSrc.class, false);
- Assert.assertEquals("Wrong udp src", 11, ((UdpSrcCase) entry.getMatchEntryValue()).getUdpSrc()
+ assertEquals("Wrong udp src", 11, ((UdpSrcCase) entry.getMatchEntryValue()).getUdpSrc()
.getPort().getValue().intValue());
entry = entries.get(1);
checkEntryHeader(entry, UdpDst.class, false);
- Assert.assertEquals("Wrong udp dst", 12, ((UdpDstCase) entry.getMatchEntryValue())
+ assertEquals("Wrong udp dst", 12, ((UdpDstCase) entry.getMatchEntryValue())
.getUdpDst().getPort().getValue().intValue());
}
Optional<List<MatchEntry>> entriesOptional =
converterManager.convert(match, new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
- Assert.assertEquals("Wrong entries size", 2, entries.size());
+ assertEquals("Wrong entries size", 2, entries.size());
MatchEntry entry = entries.get(0);
checkEntryHeader(entry, Ipv4Src.class, false);
- Assert.assertEquals("Wrong ipv4 tunnel src", "10.0.0.1", ((Ipv4SrcCase) entry.getMatchEntryValue()).getIpv4Src()
+ assertEquals("Wrong ipv4 tunnel src", "10.0.0.1", ((Ipv4SrcCase) entry.getMatchEntryValue()).getIpv4Src()
.getIpv4Address().getValue());
entry = entries.get(1);
checkEntryHeader(entry, Ipv4Dst.class, false);
- Assert.assertEquals("Wrong ipv4 tunnel dst", "10.0.0.2", ((Ipv4DstCase) entry.getMatchEntryValue()).getIpv4Dst()
+ assertEquals("Wrong ipv4 tunnel dst", "10.0.0.2", ((Ipv4DstCase) entry.getMatchEntryValue()).getIpv4Dst()
.getIpv4Address().getValue());
}
Optional<List<MatchEntry>> entriesOptional =
converterManager.convert(match, new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
- Assert.assertEquals("Wrong entries size", 2, entries.size());
+ assertEquals("Wrong entries size", 2, entries.size());
MatchEntry entry = entries.get(0);
checkEntryHeader(entry, SctpSrc.class, false);
- Assert.assertEquals("Wrong sctp src", 11, ((SctpSrcCase) entry.getMatchEntryValue()).getSctpSrc()
+ assertEquals("Wrong sctp src", 11, ((SctpSrcCase) entry.getMatchEntryValue()).getSctpSrc()
.getPort().getValue().intValue());
entry = entries.get(1);
checkEntryHeader(entry, SctpDst.class, false);
- Assert.assertEquals("Wrong sctp dst", 12, ((SctpDstCase) entry.getMatchEntryValue())
+ assertEquals("Wrong sctp dst", 12, ((SctpDstCase) entry.getMatchEntryValue())
.getSctpDst().getPort().getValue().intValue());
}
Optional<List<MatchEntry>> entriesOptional =
converterManager.convert(match, new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
- Assert.assertEquals("Wrong entries size", 5, entries.size());
+ assertEquals("Wrong entries size", 5, entries.size());
MatchEntry entry = entries.get(0);
checkEntryHeader(entry, ArpOp.class, false);
- Assert.assertEquals("Wrong arp op", 5, ((ArpOpCase) entry.getMatchEntryValue())
+ assertEquals("Wrong arp op", 5, ((ArpOpCase) entry.getMatchEntryValue())
.getArpOp().getOpCode().intValue());
entry = entries.get(1);
checkEntryHeader(entry, ArpSpa.class, false);
- Assert.assertEquals("Wrong arp spa", "10.0.0.3", ((ArpSpaCase) entry.getMatchEntryValue())
+ assertEquals("Wrong arp spa", "10.0.0.3", ((ArpSpaCase) entry.getMatchEntryValue())
.getArpSpa().getIpv4Address().getValue());
entry = entries.get(2);
checkEntryHeader(entry, ArpTpa.class, false);
- Assert.assertEquals("Wrong arp tpa", "10.0.0.4", ((ArpTpaCase) entry.getMatchEntryValue())
+ assertEquals("Wrong arp tpa", "10.0.0.4", ((ArpTpaCase) entry.getMatchEntryValue())
.getArpTpa().getIpv4Address().getValue());
entry = entries.get(3);
checkEntryHeader(entry, ArpSha.class, false);
- Assert.assertEquals("Wrong arp sha", "00:00:00:00:00:05", ((ArpShaCase) entry.getMatchEntryValue())
+ assertEquals("Wrong arp sha", "00:00:00:00:00:05", ((ArpShaCase) entry.getMatchEntryValue())
.getArpSha().getMacAddress().getValue());
entry = entries.get(4);
checkEntryHeader(entry, ArpTha.class, false);
- Assert.assertEquals("Wrong arp tha", "00:00:00:00:00:06", ((ArpThaCase) entry.getMatchEntryValue())
+ assertEquals("Wrong arp tha", "00:00:00:00:00:06", ((ArpThaCase) entry.getMatchEntryValue())
.getArpTha().getMacAddress().getValue());
}
Optional<List<MatchEntry>> entriesOptional =
converterManager.convert(match, new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
- Assert.assertEquals("Wrong entries size", 4, entries.size());
+ assertEquals("Wrong entries size", 4, entries.size());
MatchEntry entry = entries.get(0);
entry = entries.get(0);
checkEntryHeader(entry, ArpSpa.class, true);
- Assert.assertEquals("Wrong arp spa", "10.0.0.0", ((ArpSpaCase) entry.getMatchEntryValue())
+ assertEquals("Wrong arp spa", "10.0.0.0", ((ArpSpaCase) entry.getMatchEntryValue())
.getArpSpa().getIpv4Address().getValue());
- Assert.assertArrayEquals("Wrong arp spa mask", new byte[]{(byte) 255, 0, 0, 0},
+ assertArrayEquals("Wrong arp spa mask", new byte[]{(byte) 255, 0, 0, 0},
((ArpSpaCase) entry.getMatchEntryValue()).getArpSpa().getMask());
entry = entries.get(1);
checkEntryHeader(entry, ArpTpa.class, true);
- Assert.assertEquals("Wrong arp tpa", "10.0.0.4", ((ArpTpaCase) entry.getMatchEntryValue()).getArpTpa()
+ assertEquals("Wrong arp tpa", "10.0.0.4", ((ArpTpaCase) entry.getMatchEntryValue()).getArpTpa()
.getIpv4Address().getValue());
- Assert.assertArrayEquals("Wrong arp tpa mask", new byte[]{(byte) 255, (byte) 255, (byte) 255, (byte) 254},
+ assertArrayEquals("Wrong arp tpa mask", new byte[]{(byte) 255, (byte) 255, (byte) 255, (byte) 254},
((ArpTpaCase) entry.getMatchEntryValue()).getArpTpa().getMask());
entry = entries.get(2);
checkEntryHeader(entry, ArpSha.class, true);
- Assert.assertEquals("Wrong arp sha", "00:00:00:00:00:05", ((ArpShaCase) entry.getMatchEntryValue())
+ assertEquals("Wrong arp sha", "00:00:00:00:00:05", ((ArpShaCase) entry.getMatchEntryValue())
.getArpSha().getMacAddress().getValue());
- Assert.assertArrayEquals("Wrong arp sha mask", new byte[]{0, 0, 0, 0, 0, 8},
+ assertArrayEquals("Wrong arp sha mask", new byte[]{0, 0, 0, 0, 0, 8},
((ArpShaCase) entry.getMatchEntryValue()).getArpSha().getMask());
entry = entries.get(3);
checkEntryHeader(entry, ArpTha.class, true);
- Assert.assertEquals("Wrong arp tha", "00:00:00:00:00:06", ((ArpThaCase) entry.getMatchEntryValue()).getArpTha()
+ assertEquals("Wrong arp tha", "00:00:00:00:00:06", ((ArpThaCase) entry.getMatchEntryValue()).getArpTha()
.getMacAddress().getValue());
- Assert.assertArrayEquals("Wrong arp tha mask", new byte[]{0, 0, 0, 0, 0, 9},
+ assertArrayEquals("Wrong arp tha mask", new byte[]{0, 0, 0, 0, 0, 9},
((ArpThaCase) entry.getMatchEntryValue()).getArpTha().getMask());
}
Optional<List<MatchEntry>> entriesOptional =
converterManager.convert(match, new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
- Assert.assertEquals("Wrong entries size", 7, entries.size());
+ assertEquals("Wrong entries size", 7, entries.size());
MatchEntry entry = entries.get(0);
/* Due to conversion ambiguities, we always get "has mask" because
* an ip with no mask and prefix with /128 (or 32 in v4) cannot
* be distinguished */
checkEntryHeader(entry, Ipv6Src.class, false);
- Assert.assertEquals("Wrong ipv6 src", "::1",
+ assertEquals("Wrong ipv6 src", "::1",
((Ipv6SrcCase) entry.getMatchEntryValue()).getIpv6Src().getIpv6Address().getValue());
entry = entries.get(1);
checkEntryHeader(entry, Ipv6Dst.class, false);
- Assert.assertEquals("Wrong ipv6 dst", "::2",
+ assertEquals("Wrong ipv6 dst", "::2",
((Ipv6DstCase) entry.getMatchEntryValue()).getIpv6Dst().getIpv6Address().getValue());
entry = entries.get(2);
checkEntryHeader(entry, Ipv6Flabel.class, false);
- Assert.assertEquals("Wrong ipv6 flabel", 3,
+ assertEquals("Wrong ipv6 flabel", 3,
((Ipv6FlabelCase) entry.getMatchEntryValue()).getIpv6Flabel().getIpv6Flabel().getValue().intValue());
entry = entries.get(3);
checkEntryHeader(entry, Ipv6NdTarget.class, false);
- Assert.assertEquals("Wrong ipv6 nd target", "::4",
+ assertEquals("Wrong ipv6 nd target", "::4",
((Ipv6NdTargetCase) entry.getMatchEntryValue()).getIpv6NdTarget().getIpv6Address().getValue());
entry = entries.get(4);
checkEntryHeader(entry, Ipv6NdSll.class, false);
- Assert.assertEquals("Wrong ipv6 nd sll", "00:00:00:00:00:05",
+ assertEquals("Wrong ipv6 nd sll", "00:00:00:00:00:05",
((Ipv6NdSllCase) entry.getMatchEntryValue()).getIpv6NdSll().getMacAddress().getValue());
entry = entries.get(5);
checkEntryHeader(entry, Ipv6NdTll.class, false);
- Assert.assertEquals("Wrong ipv6 nd tll", "00:00:00:00:00:06",
+ assertEquals("Wrong ipv6 nd tll", "00:00:00:00:00:06",
((Ipv6NdTllCase) entry.getMatchEntryValue()).getIpv6NdTll().getMacAddress().getValue());
entry = entries.get(6);
checkEntryHeader(entry, Ipv6Exthdr.class, false);
- Assert.assertEquals("Wrong ipv6 ext hdr", new Ipv6ExthdrFlags(false, true, false, true, false,
+ assertEquals("Wrong ipv6 ext hdr", new Ipv6ExthdrFlags(false, true, false, true, false,
true, false, true, false), ((Ipv6ExthdrCase) entry.getMatchEntryValue()).getIpv6Exthdr().getPseudoField());
}
Optional<List<MatchEntry>> entriesOptional =
converterManager.convert(match, new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
- Assert.assertEquals("Wrong entries size", 2, entries.size());
+ assertEquals("Wrong entries size", 2, entries.size());
MatchEntry entry = entries.get(0);
checkEntryHeader(entry, Ipv6Src.class, true);
- Assert.assertEquals("Wrong ipv6 src", "::",
+ assertEquals("Wrong ipv6 src", "::",
((Ipv6SrcCase) entry.getMatchEntryValue()).getIpv6Src().getIpv6Address().getValue());
- Assert.assertArrayEquals("Wrong ipv6 src mask", new byte[]{(byte) 255, (byte) 255, (byte) 255, 0, 0, 0, 0,
+ assertArrayEquals("Wrong ipv6 src mask", new byte[]{(byte) 255, (byte) 255, (byte) 255, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0}, ((Ipv6SrcCase) entry.getMatchEntryValue()).getIpv6Src().getMask());
entry = entries.get(1);
checkEntryHeader(entry, Ipv6Dst.class, true);
- Assert.assertEquals("Wrong ipv6 dst", "::",
+ assertEquals("Wrong ipv6 dst", "::",
((Ipv6DstCase) entry.getMatchEntryValue()).getIpv6Dst().getIpv6Address().getValue());
- Assert.assertArrayEquals("Wrong ipv6 src mask", new byte[]{(byte) 255, (byte) 255, (byte) 255, (byte) 255,
+ assertArrayEquals("Wrong ipv6 src mask", new byte[]{(byte) 255, (byte) 255, (byte) 255, (byte) 255,
(byte) 255, (byte) 255, (byte) 255, (byte) 255, 0, 0, 0, 0, 0, 0, 0, 0},
((Ipv6DstCase) entry.getMatchEntryValue()).getIpv6Dst().getMask());
}
Optional<List<MatchEntry>> entriesOptional =
converterManager.convert(match, new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
- Assert.assertEquals("Wrong entries size", 1, entries.size());
+ assertEquals("Wrong entries size", 1, entries.size());
MatchEntry entry = entries.get(0);
checkEntryHeader(entry, Ipv6Exthdr.class, true);
- Assert.assertEquals("Wrong ipv6 ext hdr", new Ipv6ExthdrFlags(true, false, true, false, true, false,
+ assertEquals("Wrong ipv6 ext hdr", new Ipv6ExthdrFlags(true, false, true, false, true, false,
true, false, true), ((Ipv6ExthdrCase) entry.getMatchEntryValue()).getIpv6Exthdr().getPseudoField());
- Assert.assertArrayEquals("Wrong ipv6 ext hdr mask", new byte[]{1, 2},
+ assertArrayEquals("Wrong ipv6 ext hdr mask", new byte[]{1, 2},
((Ipv6ExthdrCase) entry.getMatchEntryValue()).getIpv6Exthdr().getMask());
}
Optional<List<MatchEntry>> entriesOptional =
converterManager.convert(match, new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
- Assert.assertEquals("Wrong entries size", 8, entries.size());
+ assertEquals("Wrong entries size", 8, entries.size());
MatchEntry entry = entries.get(0);
checkEntryHeader(entry, Metadata.class, true);
- Assert.assertArrayEquals("Wrong metadata", new byte[]{0, 0, 0, 0, 0, 0, 0, 3},
+ assertArrayEquals("Wrong metadata", new byte[]{0, 0, 0, 0, 0, 0, 0, 3},
((MetadataCase) entry.getMatchEntryValue()).getMetadata().getMetadata());
- Assert.assertArrayEquals("Wrong metadata mask", new byte[]{0, 0, 0, 0, 0, 0, 0, 15},
+ assertArrayEquals("Wrong metadata mask", new byte[]{0, 0, 0, 0, 0, 0, 0, 15},
((MetadataCase) entry.getMatchEntryValue()).getMetadata().getMask());
entry = entries.get(1);
checkEntryHeader(entry, EthDst.class, true);
- Assert.assertEquals("Wrong eth dst", new MacAddress("00:00:00:00:00:06"),
+ assertEquals("Wrong eth dst", new MacAddress("00:00:00:00:00:06"),
((EthDstCase) entry.getMatchEntryValue()).getEthDst().getMacAddress());
- Assert.assertArrayEquals("Wrong eth dst mask", new byte[]{0, 0, 0, 0, 0, 9},
+ assertArrayEquals("Wrong eth dst mask", new byte[]{0, 0, 0, 0, 0, 9},
((EthDstCase) entry.getMatchEntryValue()).getEthDst().getMask());
entry = entries.get(2);
checkEntryHeader(entry, EthSrc.class, true);
- Assert.assertEquals("Wrong eth src", new MacAddress("00:00:00:00:00:05"),
+ assertEquals("Wrong eth src", new MacAddress("00:00:00:00:00:05"),
((EthSrcCase) entry.getMatchEntryValue()).getEthSrc().getMacAddress());
- Assert.assertArrayEquals("Wrong eth src mask", new byte[]{0, 0, 0, 0, 0, 8},
+ assertArrayEquals("Wrong eth src mask", new byte[]{0, 0, 0, 0, 0, 8},
((EthSrcCase) entry.getMatchEntryValue()).getEthSrc().getMask());
entry = entries.get(3);
checkEntryHeader(entry, VlanVid.class, true);
- Assert.assertEquals("Wrong vlan id", 0, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid()
+ assertEquals("Wrong vlan id", 0, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid()
.getVlanVid().intValue());
- Assert.assertEquals("Wrong cfi bit", true, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid()
- .isCfiBit());
- Assert.assertArrayEquals("Wrong vlanId mask", new byte[]{16, 0},
+ assertEquals("Wrong cfi bit", true, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid().getCfiBit());
+ assertArrayEquals("Wrong vlanId mask", new byte[]{16, 0},
((VlanVidCase) entry.getMatchEntryValue()).getVlanVid().getMask());
entry = entries.get(4);
checkEntryHeader(entry, Ipv4Src.class, true);
- Assert.assertEquals("Wrong ipv4 src", "10.0.0.0", ((Ipv4SrcCase) entry.getMatchEntryValue())
+ assertEquals("Wrong ipv4 src", "10.0.0.0", ((Ipv4SrcCase) entry.getMatchEntryValue())
.getIpv4Src().getIpv4Address().getValue());
- Assert.assertArrayEquals("Wrong ipv4 src mask", new byte[]{(byte) 255, (byte) 255, (byte) 255, 0},
+ assertArrayEquals("Wrong ipv4 src mask", new byte[]{(byte) 255, (byte) 255, (byte) 255, 0},
((Ipv4SrcCase) entry.getMatchEntryValue()).getIpv4Src().getMask());
entry = entries.get(5);
checkEntryHeader(entry, Ipv4Dst.class, true);
- Assert.assertEquals("Wrong ipv4 dst", "10.0.0.0", ((Ipv4DstCase) entry.getMatchEntryValue())
+ assertEquals("Wrong ipv4 dst", "10.0.0.0", ((Ipv4DstCase) entry.getMatchEntryValue())
.getIpv4Dst().getIpv4Address().getValue());
- Assert.assertArrayEquals("Wrong ipv4 dst mask", new byte[]{(byte) 255, 0, 0, 0},
+ assertArrayEquals("Wrong ipv4 dst mask", new byte[]{(byte) 255, 0, 0, 0},
((Ipv4DstCase) entry.getMatchEntryValue()).getIpv4Dst().getMask());
entry = entries.get(6);
checkEntryHeader(entry, PbbIsid.class, true);
- Assert.assertEquals("Wrong pbb isid", 20, ((PbbIsidCase) entry.getMatchEntryValue())
+ assertEquals("Wrong pbb isid", 20, ((PbbIsidCase) entry.getMatchEntryValue())
.getPbbIsid().getIsid().intValue());
- Assert.assertArrayEquals("Wrong pbb isid mask", new byte[]{0, 0, 8},
+ assertArrayEquals("Wrong pbb isid mask", new byte[]{0, 0, 8},
((PbbIsidCase) entry.getMatchEntryValue()).getPbbIsid().getMask());
entry = entries.get(7);
checkEntryHeader(entry, TunnelId.class, true);
- Assert.assertArrayEquals("Wrong tunnel id", new byte[]{0, 0, 0, 0, 0, 0, 0, 21},
+ assertArrayEquals("Wrong tunnel id", new byte[]{0, 0, 0, 0, 0, 0, 0, 21},
((TunnelIdCase) entry.getMatchEntryValue()).getTunnelId().getTunnelId());
- Assert.assertArrayEquals("Wrong tunnel id mask", new byte[]{0, 0, 0, 0, 0, 0, 0, 14},
+ assertArrayEquals("Wrong tunnel id mask", new byte[]{0, 0, 0, 0, 0, 0, 0, 14},
((TunnelIdCase) entry.getMatchEntryValue()).getTunnelId().getMask());
}
Optional<List<MatchEntry>> entriesOptional = converterManager.convert(match,
new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
- Assert.assertEquals("Wrong entries size", 2, entries.size());
+ assertEquals("Wrong entries size", 2, entries.size());
MatchEntry entry = entries.get(0);
checkEntryHeader(entry, Ipv6Src.class, true);
- Assert.assertEquals("wrong Ipv6Adress source", "fbA0:FFB6:FFF0:FFF0:FFF0:FFF0:FFF0:AFF0",
+ assertEquals("wrong Ipv6Adress source", "fbA0:FFB6:FFF0:FFF0:FFF0:FFF0:FFF0:AFF0",
((Ipv6SrcCase) entry.getMatchEntryValue()).getIpv6Src().getIpv6Address().getValue());
entry = entries.get(1);
checkEntryHeader(entry, Ipv6Dst.class, true);
- Assert.assertEquals("wrong Ipv6Adress destination", "fbA0:FFB6:FFF0:FFF0:FFF0:FFF0:FFF0:AFF0",
+ assertEquals("wrong Ipv6Adress destination", "fbA0:FFB6:FFF0:FFF0:FFF0:FFF0:FFF0:AFF0",
((Ipv6DstCase) entry.getMatchEntryValue()).getIpv6Dst().getIpv6Address().getValue());
}
Optional<List<MatchEntry>> entriesOptional =
converterManager.convert(match, new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
- Assert.assertEquals("Wrong entries size", 1, entries.size());
+ assertEquals("Wrong entries size", 1, entries.size());
MatchEntry entry = entries.get(0);
checkEntryHeader(entry, PacketType.class, false);
- Assert.assertEquals("Wrong in port", 0x1894f,
+ assertEquals("Wrong in port", 0x1894f,
((PacketTypeCase) entry.getMatchEntryValue()).getPacketType().getPacketType().longValue());
}
}
builtMatch.getEthernetMatch().getEthernetType().getType().getValue().intValue());
Assert.assertEquals("Wrong vlan id", 4,
builtMatch.getVlanMatch().getVlanId().getVlanId().getValue().intValue());
- Assert.assertEquals("Wrong vlan id entries", true, builtMatch.getVlanMatch().getVlanId().isVlanIdPresent());
+ Assert.assertEquals("Wrong vlan id entries", true, builtMatch.getVlanMatch().getVlanId().getVlanIdPresent());
Assert.assertEquals("Wrong vlan pcp", 5, builtMatch.getVlanMatch().getVlanPcp().getValue().intValue());
Assert.assertEquals("Wrong ip dscp", 6, builtMatch.getIpMatch().getIpDscp().getValue().intValue());
Assert.assertEquals("Wrong ip ecn", 7, builtMatch.getIpMatch().getIpEcn().intValue());
builtMatch.getEthernetMatch().getEthernetSource().getMask());
Assert.assertEquals("Wrong vlan id", 4,
builtMatch.getVlanMatch().getVlanId().getVlanId().getValue().intValue());
- Assert.assertEquals("Wrong vlan id entries", true, builtMatch.getVlanMatch().getVlanId().isVlanIdPresent());
+ Assert.assertEquals("Wrong vlan id entries", true, builtMatch.getVlanMatch().getVlanId().getVlanIdPresent());
final Ipv4Match ipv4Match = (Ipv4Match) builtMatch.getLayer3Match();
Assert.assertEquals("Wrong ipv4 src address", "10.0.0.0/24", ipv4Match.getIpv4Source().getValue());
Assert.assertEquals("Wrong ipv4 dst address", "10.0.0.0/20", ipv4Match.getIpv4Destination().getValue());
int expectedVid = vid < 0 ? 0 : vid;
Boolean expectedCfi = vid != 0;
assertEquals(expectedVid, vlanMatch.getVlanId().getVlanId().getValue().intValue());
- assertEquals(expectedCfi, vlanMatch.getVlanId().isVlanIdPresent());
+ assertEquals(expectedCfi, vlanMatch.getVlanId().getVlanIdPresent());
assertEquals(null, vlanMatch.getVlanPcp());
}
}
private static void checkDefaultV10(final Match match, final FlowWildcardsV10 wc, final int vid) {
EthernetMatch ethMatch = match.getEthernetMatch();
- if (wc.isDLSRC()) {
+ if (wc.getDLSRC()) {
if (ethMatch != null) {
assertEquals(null, ethMatch.getEthernetSource());
}
}
if (ethMatch != null) {
- if (wc.isDLDST()) {
+ if (wc.getDLDST()) {
assertEquals(null, ethMatch.getEthernetDestination());
} else {
assertNotEquals(null, ethMatch.getEthernetDestination());
}
}
- if (wc.isDLTYPE()) {
+ if (wc.getDLTYPE()) {
if (ethMatch != null) {
assertEquals(null, ethMatch.getEthernetType());
}
}
VlanMatch vlanMatch = match.getVlanMatch();
- if (wc.isDLVLAN()) {
+ if (wc.getDLVLAN()) {
assertEquals(null, vlanMatch);
} else {
int expectedVid;
expectedCfi = Boolean.TRUE;
}
assertEquals(expectedVid, vlanMatch.getVlanId().getVlanId().getValue().intValue());
- assertEquals(expectedCfi, vlanMatch.getVlanId().isVlanIdPresent());
+ assertEquals(expectedCfi, vlanMatch.getVlanId().getVlanIdPresent());
- if (wc.isDLVLANPCP()) {
+ if (wc.getDLVLANPCP()) {
assertEquals(null, vlanMatch.getVlanPcp());
} else {
assertEquals(VLAN_PCP, vlanMatch.getVlanPcp().getValue());