import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION;
import java.util.Optional;
-import javax.annotation.concurrent.NotThreadSafe;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.netvirt.aclservice.tests.infra.DataTreeIdentifierDataObjectPairBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.AccessLists;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.SecurityRuleAttr;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.SecurityRuleAttrBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Empty;
-@NotThreadSafe
+/**
+ * This class is not ThreadSafe.
+ */
public class IdentifiedAceBuilder implements DataTreeIdentifierDataObjectPairBuilder<Ace> {
private String sgUuid;
.setMatches(matches)
.setActions(new ActionsBuilder()
.setPacketHandling(new PermitBuilder()
- .setPermit(true).build()
+ .setPermit(Empty.getInstance()).build()
).build()
)
.addAugmentation(SecurityRuleAttr.class, new SecurityRuleAttrBuilder()
import java.util.ArrayList;
import java.util.List;
-import javax.annotation.concurrent.NotThreadSafe;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.netvirt.aclservice.tests.infra.DataTreeIdentifierDataObjectPairBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev170119.L2vlan;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.interfaces._interface.SubnetInfo;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-@NotThreadSafe
+/**
+ * This class is not ThreadSafe.
+ */
public class IdentifiedInterfaceWithAclBuilder implements DataTreeIdentifierDataObjectPairBuilder<Interface> {
private String interfaceName;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.MoreExecutors;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Collection;
LOG.error("withdrwaPrefixIfPresent: Failed to retrieve ebgp networks for rd {} prefix {}",
rd, prefix, throwable);
}
- });
+ }, MoreExecutors.directExecutor());
}
}
<groupId>org.opendaylight.serviceutils</groupId>
<artifactId>tools-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ <optional>true</optional>
+ </dependency>
<dependency>
<groupId>org.apache.aries.blueprint</groupId>
<artifactId>blueprint-maven-plugin-annotation</artifactId>
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.DirectionIngress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.SecurityRuleAttr;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.SecurityRuleAttrBuilder;
+import org.opendaylight.yangtools.yang.common.Empty;
public final class AceNetworkPolicyUtils {
private AceNetworkPolicyUtils() {}
MatchesBuilder matchesBuilder = new MatchesBuilder();
matchesBuilder.setAceType(aceIpBuilder.build());
ActionsBuilder actionsBuilder = new ActionsBuilder();
- actionsBuilder.setPacketHandling(new PermitBuilder().setPermit(true).build());
+ actionsBuilder.setPacketHandling(new PermitBuilder().setPermit(Empty.getInstance()).build());
AceBuilder aceBuilder = new AceBuilder();
aceBuilder.setRuleName(ruleName);
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>3.0.6</version>
+ <version>4.0.0</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.serviceutils</groupId>
<artifactId>tools-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ <optional>true</optional>
+ </dependency>
</dependencies>
<build>
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import javax.inject.Inject;
import javax.inject.Singleton;
+
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
public void onFailure(Throwable error) {
LOG.debug("Error {} while removing macEntry {} from Operational Datastore", error, srcMacAddress);
}
- });
+ }, MoreExecutors.directExecutor());
}
@Override
@Override
public void onFailure(Throwable throwable) {
}
- });
+ }, MoreExecutors.directExecutor());
return;
}
NodeBuilder dstPsNodeBuilder = HwvtepHAUtil.getNodeBuilderForPath(dstPsPath);
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>3.0.6</version>
+ <version>4.0.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Consumer;
-import javax.annotation.concurrent.GuardedBy;
+
+import org.checkerframework.checker.lock.qual.GuardedBy;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<artifactId>org.apache.karaf.shell.commands</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ <optional>true</optional>
+ </dependency>
<dependency>
<groupId>org.apache.karaf.shell</groupId>
<artifactId>org.apache.karaf.shell.console</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<artifactId>ipv6util-api</artifactId>
<version>${genius.version}</version>
</dependency>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ <optional>true</optional>
+ </dependency>
</dependencies>
<build>
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.rules.attributes.SecurityRules;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.rules.attributes.security.rules.SecurityRule;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Empty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
matchesBuilder.setAceType(aceIpBuilder.build());
// set acl action as permit for the security rule
ActionsBuilder actionsBuilder = new ActionsBuilder();
- actionsBuilder.setPacketHandling(new PermitBuilder().setPermit(true).build());
+ actionsBuilder.setPacketHandling(new PermitBuilder().setPermit(Empty.getInstance()).build());
AceBuilder aceBuilder = new AceBuilder();
aceBuilder.withKey(new AceKey(securityRule.getUuid().getValue()));
import java.math.BigInteger;
import java.util.function.Supplier;
-import javax.annotation.concurrent.NotThreadSafe;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.QosPolicy;
import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@NotThreadSafe
+/**
+ * This class is ThreadSafe.
+ */
public class QosAlertPortData {
private static final Logger LOG = LoggerFactory.getLogger(QosAlertPortData.class);
private static final BigInteger BIG_HUNDRED = new BigInteger("100");
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import java.util.regex.Pattern;
-import javax.annotation.concurrent.ThreadSafe;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
/**
* Utility for {@link Uuid}.
- *
+ * This class is ThreadSafe.
* @author Michael Vorburger.ch
*/
-@ThreadSafe
class UuidUtil {
private Pattern uuidPattern;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.reg.grouping.NxmNxRegBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.tun.id.grouping.NxmNxTunIdBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.tun.ipv4.dst.grouping.NxmNxTunIpv4DstBuilder;
+import org.opendaylight.yangtools.yang.common.Empty;
public final class OpenFlow13Utils {
public static final long ETHERTYPE_NSH = 0x894f;
public static Action createActionNxLoadTunIpv4Dst(long value, int order) {
ActionBuilder ab = createActionBuilder(order);
- ab.setAction(nxLoadRegAction(new DstNxTunIpv4DstCaseBuilder().setNxTunIpv4Dst(Boolean.TRUE).build(),
+ ab.setAction(nxLoadRegAction(new DstNxTunIpv4DstCaseBuilder().setNxTunIpv4Dst(Empty.getInstance()).build(),
BigInteger.valueOf(value), 0,31, false));
return ab.build();
public static Action createActionNxLoadTunId(long value, int order) {
ActionBuilder ab = createActionBuilder(order);
- ab.setAction(nxLoadRegAction(new DstNxTunIdCaseBuilder().setNxTunId(Boolean.TRUE).build(),
+ ab.setAction(nxLoadRegAction(new DstNxTunIdCaseBuilder().setNxTunId(Empty.getInstance()).build(),
BigInteger.valueOf(value), 0,31, false));
return ab.build();
public static Action createActionNxMoveTunIdToNsc2Register(int order) {
ActionBuilder ab = createActionBuilder(order);
- ab.setAction(nxMoveRegAction(new SrcNxTunIdCaseBuilder().setNxTunId(Boolean.TRUE).build(), 0, 31,
- new DstNxNshc2CaseBuilder().setNxNshc2Dst(Boolean.TRUE).build(), 0, 31,
+ ab.setAction(nxMoveRegAction(new SrcNxTunIdCaseBuilder().setNxTunId(Empty.getInstance()).build(), 0, 31,
+ new DstNxNshc2CaseBuilder().setNxNshc2Dst(Empty.getInstance()).build(), 0, 31,
false));
return ab.build();
ActionBuilder ab = createActionBuilder(order);
ab.setAction(nxMoveRegAction(
new SrcNxRegCaseBuilder().setNxReg(NxmNxReg0.class).build(), 0, 31,
- new DstNxNshc1CaseBuilder().setNxNshc1Dst(Boolean.TRUE).build(), 0,31,
+ new DstNxNshc1CaseBuilder().setNxNshc1Dst(Empty.getInstance()).build(), 0,31,
false));
return ab.build();
public static Action createActionNxMoveReg6ToNsc4Register(int order) {
ActionBuilder ab = createActionBuilder(order);
ab.setAction(nxMoveRegAction(new SrcNxRegCaseBuilder().setNxReg(NxmNxReg6.class).build(), 0, 31,
- new DstNxNshc4CaseBuilder().setNxNshc4Dst(Boolean.TRUE).build(), 0, 31,
+ new DstNxNshc4CaseBuilder().setNxNshc4Dst(Empty.getInstance()).build(), 0, 31,
false));
return ab.build();
public static Action createActionNxMoveNsc4ToReg6Register(int order) {
ActionBuilder ab = createActionBuilder(order);
- ab.setAction(nxMoveRegAction(new SrcNxNshc4CaseBuilder().setNxNshc4Dst(Boolean.TRUE).build(), 0, 31,
+ ab.setAction(nxMoveRegAction(new SrcNxNshc4CaseBuilder().setNxNshc4Dst(Empty.getInstance()).build(), 0, 31,
new DstNxRegCaseBuilder().setNxReg(NxmNxReg6.class).build(), 0, 31,
false));
ab.setAction(nxMoveRegAction(
// Move NSP from the 3 most significant bytes
new SrcNxRegCaseBuilder().setNxReg(NxmNxReg2.class).build(), 8, 31,
- new DstNxNspCaseBuilder().setNxNspDst(true).build(), 0, 23,
+ new DstNxNspCaseBuilder().setNxNspDst(Empty.getInstance()).build(), 0, 23,
false));
return ab.build();
ab.setAction(nxMoveRegAction(
// Move NSI from the least significant byte
new SrcNxRegCaseBuilder().setNxReg(NxmNxReg2.class).build(), 0, 7,
- new DstNxNsiCaseBuilder().setNxNsiDst(true).build(), 0, 7,
+ new DstNxNsiCaseBuilder().setNxNsiDst(Empty.getInstance()).build(), 0, 7,
false));
return ab.build();
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.src.choice.grouping.src.choice.SrcNxRegCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.src.choice.grouping.src.choice.SrcNxTunIdCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow;
+import org.opendaylight.yangtools.yang.common.Empty;
public class OpenFlow13ProviderTest {
NxActionRegLoadNodesNodeTableFlowApplyActionsCase regLoad =
(NxActionRegLoadNodesNodeTableFlowApplyActionsCase) action.getAction();
DstNxTunIpv4DstCase tunDstTypeCase = (DstNxTunIpv4DstCase) regLoad.getNxRegLoad().getDst().getDstChoice();
- assertTrue(tunDstTypeCase.isNxTunIpv4Dst());
+ assertEquals(Empty.getInstance(), tunDstTypeCase.getNxTunIpv4Dst());
assertEquals(regLoad.getNxRegLoad().getValue().longValue(), ipl);
}
NxActionRegLoadNodesNodeTableFlowApplyActionsCase regLoad =
(NxActionRegLoadNodesNodeTableFlowApplyActionsCase) action.getAction();
DstNxTunIdCase mdTypeCase = (DstNxTunIdCase) regLoad.getNxRegLoad().getDst().getDstChoice();
- assertTrue(mdTypeCase.isNxTunId());
+ assertEquals(Empty.getInstance(), mdTypeCase.getNxTunId());
assertEquals(regLoad.getNxRegLoad().getValue().longValue(), tunId);
}
NxActionRegMoveNodesNodeTableFlowApplyActionsCase regMove =
(NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
if (checkSrc) {
- assertTrue(((SrcNxNspCase) regMove.getNxRegMove().getSrc().getSrcChoice()).isNxNspDst());
+ assertEquals(Empty.getInstance(), ((SrcNxNspCase) regMove.getNxRegMove()
+ .getSrc().getSrcChoice()).getNxNspDst());
} else {
- assertTrue(((DstNxNspCase) regMove.getNxRegMove().getDst().getDstChoice()).isNxNspDst());
+ assertEquals(Empty.getInstance(), ((DstNxNspCase) regMove.getNxRegMove()
+ .getDst().getDstChoice()).getNxNspDst());
}
}
NxActionRegMoveNodesNodeTableFlowApplyActionsCase regMove =
(NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
if (checkSrc) {
- assertTrue(((SrcNxNsiCase) regMove.getNxRegMove().getSrc().getSrcChoice()).isNxNsiDst());
+ assertEquals(Empty.getInstance(), ((SrcNxNsiCase) regMove.getNxRegMove()
+ .getSrc().getSrcChoice()).getNxNsiDst());
} else {
- assertTrue(((DstNxNsiCase) regMove.getNxRegMove().getDst().getDstChoice()).isNxNsiDst());
+ assertEquals(Empty.getInstance(), ((DstNxNsiCase) regMove.getNxRegMove()
+ .getDst().getDstChoice()).getNxNsiDst());
}
}
(NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
if (checkSrc) {
SrcNxNshc1Case src = (SrcNxNshc1Case) regMove.getNxRegMove().getSrc().getSrcChoice();
- assertTrue(src.isNxNshc1Dst());
+ assertEquals(Empty.getInstance(), src.getNxNshc1Dst());
} else {
DstNxNshc1Case dst = (DstNxNshc1Case) regMove.getNxRegMove().getDst().getDstChoice();
- assertTrue(dst.isNxNshc1Dst());
+ assertEquals(Empty.getInstance(), dst.getNxNshc1Dst());
}
}
(NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
if (checkSrc) {
SrcNxNshc2Case src = (SrcNxNshc2Case) regMove.getNxRegMove().getSrc().getSrcChoice();
- assertTrue(src.isNxNshc2Dst());
+ assertEquals(Empty.getInstance(), src.getNxNshc2Dst());
} else {
DstNxNshc2Case dst = (DstNxNshc2Case) regMove.getNxRegMove().getDst().getDstChoice();
- assertTrue(dst.isNxNshc2Dst());
+ assertEquals(Empty.getInstance(), dst.getNxNshc2Dst());
}
}
(NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
if (checkSrc) {
SrcNxNshc4Case src = (SrcNxNshc4Case) regMove.getNxRegMove().getSrc().getSrcChoice();
- assertTrue(src.isNxNshc4Dst());
+ assertEquals(Empty.getInstance(), src.getNxNshc4Dst());
} else {
DstNxNshc4Case dst = (DstNxNshc4Case) regMove.getNxRegMove().getDst().getDstChoice();
- assertTrue(dst.isNxNshc4Dst());
+ assertEquals(Empty.getInstance(), dst.getNxNshc4Dst());
}
}
(NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
if (checkSrc) {
SrcNxTunIdCase src = (SrcNxTunIdCase) regMove.getNxRegMove().getSrc().getSrcChoice();
- assertTrue(src.isNxTunId());
+ assertEquals(Empty.getInstance(), src.getNxTunId());
} else {
DstNxTunIdCase dst = (DstNxTunIdCase) regMove.getNxRegMove().getDst().getDstChoice();
- assertTrue(dst.isNxTunId());
+ assertEquals(Empty.getInstance(), dst.getNxTunId());
}
}
futures.add(configFuture);
//TODO: Allow immediateFailedFuture from writeCfgTxn to cancel writeInvTxn as well.
Futures.addCallback(configFuture, new PostVpnInterfaceThreadWorker(intrf.getName(), true,
- "Operational"));
+ "Operational"), MoreExecutors.directExecutor());
}));
return futures;
});
})))));
futures.add(configFuture);
Futures.addCallback(configFuture, new PostVpnInterfaceThreadWorker(intrf.getName(), false,
- "Operational"));
+ "Operational"), MoreExecutors.directExecutor());
return futures;
}, DJC_MAX_RETRIES);
}
interfaceName, vpnInterface.getDpnId(), vpnName);
})))));
futures.add(configFuture);
- Futures.addCallback(configFuture, new PostVpnInterfaceWorker(interfaceName, false, "Config"));
+ Futures.addCallback(configFuture, new PostVpnInterfaceWorker(
+ interfaceName, false, "Config"), MoreExecutors.directExecutor());
return futures;
}, DJC_MAX_RETRIES);
}