<propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <configuration>
+ <failOnError>true</failOnError>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
package org.opendaylight.sfc.scfofrenderer.flowgenerators;
import com.google.common.collect.Iterables;
-
import java.util.List;
import java.util.Optional;
-
import org.opendaylight.sfc.ovs.provider.SfcOvsUtil;
import org.opendaylight.sfc.provider.api.SfcProviderRenderedPathAPI;
import org.opendaylight.sfc.provider.api.SfcProviderServiceForwarderAPI;
public class MacChainingClassifier {
- private ServiceFunctionForwarder sff;
+ private ServiceFunctionForwarder serviceFunctionForwarder;
private final ClassifierHandler classifierHandler;
public MacChainingClassifier(ServiceFunctionForwarder theSff) {
this();
- sff = theSff;
+ serviceFunctionForwarder = theSff;
}
public MacChainingClassifier setSff(ServiceFunctionForwarder theSff) {
- sff = theSff;
+ serviceFunctionForwarder = theSff;
return this;
}
public Optional<String> getNodeName(String theInterfaceName) {
- return Optional.ofNullable(sff)
+ return Optional.ofNullable(serviceFunctionForwarder)
.filter(theSff -> theSff.getAugmentation(SffOvsBridgeAugmentation.class) != null)
.map(SfcOvsUtil::getOpenFlowNodeIdForSff);
}
}
@Override
- public void close() throws Exception {
+ public void close() {
listenerRegistration.close();
}
}
}
@Override
- public void close() throws Exception {
+ public void close() {
LOG.debug("Closing listener...");
if (listenerRegistration != null) {
listenerRegistration.close();
ClassifierProcessorInterface classifierProcessor;
- Optional<String> nodeName = Optional.empty();
+ final Optional<String> nodeName;
if (rsp.getSfcEncapsulation() == MacChaining.class) {
nodeName = Optional.of(theSff.getServiceNode().getValue());
classifierProcessor = new MacChainingProcessor(
package org.opendaylight.sfc.scfofrenderer.renderers;
-import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
* Implemented from the AutoCloseable interface.
*/
@Override
- @SuppressWarnings("checkstyle:IllegalCatch")
- public void close() throws ExecutionException, InterruptedException {
+ public void close() {
LOG.info("SfcScfOfRenderer auto-closed");
- try {
- sfcScfDataListener.close();
- classifierRspsUpdateListener.close();
- } catch (Exception e) {
- LOG.error("SfcScfOfRenderer auto-closed exception {}", e.getMessage());
- }
+ sfcScfDataListener.close();
+ classifierRspsUpdateListener.close();
}
}
Ipv4Prefix src = ipv4.getSourceIpv4Network();
if (src != null) {
String[] source = src.getValue().split("/");
- SfcOpenflowUtils.addMatchSrcIpv4(mb, source[0], Integer.valueOf(source[1]));
+ SfcOpenflowUtils.addMatchSrcIpv4(mb, source[0], Integer.parseInt(source[1]));
}
Ipv4Prefix dst = ipv4.getDestinationIpv4Network();
if (dst != null) {
String[] destination = dst.getValue().split("/");
- SfcOpenflowUtils.addMatchDstIpv4(mb, destination[0], Integer.valueOf(destination[1]));
+ SfcOpenflowUtils.addMatchDstIpv4(mb, destination[0], Integer.parseInt(destination[1]));
}
}
if (aceip.getAceIpVersion() instanceof AceIpv6) {
Ipv6Prefix src = ipv6.getSourceIpv6Network();
if (src != null) {
String[] source = src.getValue().split("/");
- SfcOpenflowUtils.addMatchSrcIpv6(mb, source[0], Integer.valueOf(source[1]));
+ SfcOpenflowUtils.addMatchSrcIpv6(mb, source[0], Integer.parseInt(source[1]));
}
Ipv6Prefix dst = ipv6.getDestinationIpv6Network();
if (dst != null) {
String[] destination = dst.getValue().split("/");
- SfcOpenflowUtils.addMatchDstIpv6(mb, destination[0], Integer.valueOf(destination[1]));
+ SfcOpenflowUtils.addMatchDstIpv6(mb, destination[0], Integer.parseInt(destination[1]));
}
}
}
public static final short NSH_MDTYPE_ONE = 0x1;
public static final short NSH_NP_ETH = 0x3;
+ private SfcScfOfUtils() {
+ }
+
/**
* Get a FlowBuilder object that install the table-miss in the classifier
* table.
VirtualMacAddress vmac = VirtualMacAddress.getForwardAddress(pathId, 0);
- if ((nodeName == null) || (flowKey == null)) {
+ if (nodeName == null || flowKey == null) {
return null;
}
Action macDst = SfcOpenflowUtils.createActionSetDlDst(vmac.getHop(startIndex).getValue(), order++);
- Action out = SfcOpenflowUtils.createActionOutPort(Integer.parseInt(outPort), order++);
+ Action out = SfcOpenflowUtils.createActionOutPort(Integer.parseInt(outPort), order);
FlowBuilder flowb = new FlowBuilder();
.createActionsInstructionBuilder(macDst, out))
.build());
return flowb;
- //return SfcOpenflowUtils.writeFlowToDataStore(nodeName, flowb);
}
/**
VirtualMacAddress vmac = VirtualMacAddress.getForwardAddress(pathId, 0);
- if ((nodeName == null) || (flowKey == null)) {
+ if (nodeName == null || flowKey == null) {
return null;
}
Action macDst = SfcOpenflowUtils.createActionSetDlDst(vmac.getHop(startIndex).getValue(), order++);
- Action out = SfcOpenflowUtils.createActionOutPort(Integer.parseInt(outPort), order++);
+ Action out = SfcOpenflowUtils.createActionOutPort(Integer.parseInt(outPort), order);
FlowBuilder flowb = new FlowBuilder();
flowb.setId(new FlowId(flowKey))
.build());
return flowb;
- //return SfcOpenflowUtils.writeFlowToDataStore(nodeName, flowb);
-
}
-
-
/**
* create classifier out flow for MAC Chaining.
* The function returns true if successful.
VirtualMacAddress vmac = VirtualMacAddress.getForwardAddress(pathId, 0);
- if ((nodeName == null) || (flowKey == null)) {
+ if (nodeName == null || flowKey == null) {
return null;
}
//set here the gateway MAC to end the chain
Action macDst = SfcOpenflowUtils.createActionSetDlDst(gwMac, order++);
- Action out = SfcOpenflowUtils.createActionOutPort(Integer.parseInt(outPort), order++);
+ Action out = SfcOpenflowUtils.createActionOutPort(Integer.parseInt(outPort), order);
FlowBuilder flowb = new FlowBuilder();
flowb.setId(new FlowId(flowKey))
.build());
return flowb;
- //return SfcOpenflowUtils.writeFlowToDataStore(nodeName, flowb);
}
-
}