import static org.opendaylight.controller.md.sal.binding.api.WriteTransaction.CREATE_MISSING_PARENTS;
import com.google.common.base.Optional;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.math.BigInteger;
import java.net.InetAddress;
import java.net.UnknownHostException;
private DhcpServiceUtils() { }
- // TODO skitt Fix the exception handling here
- @SuppressWarnings("checkstyle:IllegalCatch")
- @SuppressFBWarnings("REC_CATCH_EXCEPTION")
public static void setupDhcpFlowEntry(@Nullable BigInteger dpId, short tableId, @Nullable String vmMacAddress,
int addOrRemove,
IMdsalApiManager mdsalUtil, DhcpServiceCounters dhcpServiceCounters,
- TypedReadWriteTransaction<Configuration> tx) {
+ TypedReadWriteTransaction<Configuration> tx)
+ throws ExecutionException, InterruptedException {
if (dpId == null || dpId.equals(DhcpMConstants.INVALID_DPID) || vmMacAddress == null) {
return;
}
if (addOrRemove == NwConstants.DEL_FLOW) {
LOG.trace("Removing DHCP Flow DpId {}, vmMacAddress {}", dpId, vmMacAddress);
dhcpServiceCounters.removeDhcpFlow();
- try {
- mdsalUtil.removeFlow(tx, dpId, getDhcpFlowRef(dpId, tableId, vmMacAddress), tableId);
- } catch (Exception e) {
- LOG.error("Error removing flow", e);
- throw new RuntimeException("Error removing flow", e);
- }
+ mdsalUtil.removeFlow(tx, dpId, getDhcpFlowRef(dpId, tableId, vmMacAddress), tableId);
} else {
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, tableId,
getDhcpFlowRef(dpId, tableId, vmMacAddress), DhcpMConstants.DEFAULT_DHCP_FLOW_PRIORITY,
.append(ipAddress).toString();
}
- // TODO skitt Fix the exception handling here
- @SuppressWarnings("checkstyle:IllegalCatch")
- @SuppressFBWarnings("REC_CATCH_EXCEPTION")
public static void setupDhcpDropAction(BigInteger dpId, short tableId, String vmMacAddress, int addOrRemove,
IMdsalApiManager mdsalUtil, DhcpServiceCounters dhcpServiceCounters,
- TypedReadWriteTransaction<Configuration> tx) {
+ TypedReadWriteTransaction<Configuration> tx)
+ throws ExecutionException, InterruptedException {
if (dpId == null || dpId.equals(DhcpMConstants.INVALID_DPID) || vmMacAddress == null) {
return;
}
if (addOrRemove == NwConstants.DEL_FLOW) {
LOG.trace("Removing DHCP Drop Flow DpId {}, vmMacAddress {}", dpId, vmMacAddress);
dhcpServiceCounters.removeDhcpDropFlow();
- try {
- mdsalUtil.removeFlow(tx, dpId, getDhcpFlowRef(dpId, tableId, vmMacAddress), tableId);
- } catch (Exception e) {
- LOG.error("Error removing flow", e);
- throw new RuntimeException("Error removing flow", e);
- }
+ mdsalUtil.removeFlow(tx, dpId, getDhcpFlowRef(dpId, tableId, vmMacAddress), tableId);
} else {
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, tableId,
getDhcpFlowRef(dpId, tableId, vmMacAddress), DhcpMConstants.DEFAULT_DHCP_FLOW_PRIORITY,
}
}
- @SuppressWarnings("checkstyle:IllegalCatch")
public static void setupDhcpArpRequest(BigInteger dpId, short tableId, BigInteger vni, String dhcpIpAddress,
int lportTag, Long elanTag, boolean add, IMdsalApiManager mdsalUtil) {
List<MatchInfo> matches = getDhcpArpMatch(vni, dhcpIpAddress);