*/
package org.opendaylight.genius.alivenessmonitor.protocols.internal;
+import static java.util.Objects.requireNonNull;
import static org.opendaylight.genius.alivenessmonitor.protocols.AlivenessMonitorAndProtocolsConstants.SEPERATOR;
-import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
return;
}
EndpointType source = monitorInfo.getSource().getEndpointType();
- final String sourceInterface = Preconditions.checkNotNull(AlivenessMonitorUtil.getInterfaceName(source),
+ final String sourceInterface = requireNonNull(AlivenessMonitorUtil.getInterfaceName(source),
"Source interface is required to send ARP Packet for monitoring");
- final String srcIp = Preconditions.checkNotNull(AlivenessMonitorUtil.getIpAddress(source),
+ final String srcIp = requireNonNull(AlivenessMonitorUtil.getIpAddress(source),
"Source Ip address is required to send ARP Packet for monitoring");
final Optional<PhysAddress> srcMacAddressOptional = getMacAddress(source);
if (srcMacAddressOptional.isPresent()) {
PhysAddress srcMacAddress = srcMacAddressOptional.get();
EndpointType target = monitorInfo.getDestination().getEndpointType();
- final String targetIp = Preconditions.checkNotNull(AlivenessMonitorUtil.getIpAddress(target),
+ final String targetIp = requireNonNull(AlivenessMonitorUtil.getIpAddress(target),
"Target Ip address is required to send ARP Packet for monitoring");
if (LOG.isTraceEnabled()) {
LOG.trace("sendArpRequest interface {}, senderIPAddress {}, targetAddress {}", sourceInterface, srcIp,
*/
package org.opendaylight.genius.alivenessmonitor.protocols.internal;
+import static java.util.Objects.requireNonNull;
import static org.opendaylight.genius.alivenessmonitor.protocols.AlivenessMonitorAndProtocolsConstants.SEPERATOR;
-import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
@Override
public void startMonitoringTask(MonitoringInfo monitorInfo) {
EndpointType source = monitorInfo.getSource().getEndpointType();
- final String sourceInterface = Preconditions.checkNotNull(AlivenessMonitorUtil.getInterfaceName(source),
+ final String sourceInterface = requireNonNull(AlivenessMonitorUtil.getInterfaceName(source),
"Source interface is required to send Ipv6 ND Packet for monitoring");
- final String srcIp = Preconditions.checkNotNull(AlivenessMonitorUtil.getIpAddress(source),
+ final String srcIp = requireNonNull(AlivenessMonitorUtil.getIpAddress(source),
"Source IP address is required to send Ipv6 ND Packet for monitoring");
- final PhysAddress srcMacAddress = Preconditions.checkNotNull(AlivenessMonitorUtil.getMacAddress(source),
+ final PhysAddress srcMacAddress = requireNonNull(AlivenessMonitorUtil.getMacAddress(source),
"Source MAC address is required to send Ipv6 ND Packet for monitoring");
EndpointType target = monitorInfo.getDestination().getEndpointType();
- final String targetIp = Preconditions.checkNotNull(AlivenessMonitorUtil.getIpAddress(target),
+ final String targetIp = requireNonNull(AlivenessMonitorUtil.getIpAddress(target),
"Target Ip address is required to send ipv6 ND Packet for monitoring");
LOG.trace("sendNA interface {}, senderIPAddress {}, targetAddress {}", sourceInterface, srcIp, targetIp);
public void testMonitorProfileCreate()
throws InterruptedException, ExecutionException {
MonitorProfileCreateInput input = new MonitorProfileCreateInputBuilder()
- .setProfile(new ProfileBuilder().setFailureThreshold(10L)
- .setMonitorInterval(10000L).setMonitorWindow(10L)
+ .setProfile(new ProfileBuilder().setFailureThreshold(Uint32.TEN)
+ .setMonitorInterval(10000L).setMonitorWindow(Uint32.TEN)
.setProtocolType(MonitorProtocolType.Arp).build())
.build();
doReturn(FluentFutures.immediateFluentFuture(Optional.empty()))
public void testMonitorProfileCreateAlreadyExist()
throws InterruptedException, ExecutionException {
MonitorProfileCreateInput input = new MonitorProfileCreateInputBuilder()
- .setProfile(new ProfileBuilder().setFailureThreshold(10L)
- .setMonitorInterval(10000L).setMonitorWindow(10L)
+ .setProfile(new ProfileBuilder().setFailureThreshold(Uint32.TEN)
+ .setMonitorInterval(10000L).setMonitorWindow(Uint32.TEN)
.setProtocolType(MonitorProtocolType.Arp).build())
.build();
doReturn(FluentFutures.immediateFluentFuture(Optional.of(input))).when(readWriteTx).read(
public void testMonitorPause()
throws InterruptedException, ExecutionException {
MonitorPauseInput input = new MonitorPauseInputBuilder()
- .setMonitorId(2L).build();
+ .setMonitorId(Uint32.TWO).build();
Optional<MonitorProfile> optProfile = Optional
.of(getTestMonitorProfile());
when(readTx.read(eq(LogicalDatastoreType.OPERATIONAL),
argThat(isType(MonitoringInfo.class))))
.thenReturn(FluentFutures.immediateFluentFuture(optInfo));
Optional<MonitoringState> optState = Optional
- .of(new MonitoringStateBuilder()
+ .of(new MonitoringStateBuilder().setMonitorKey("foo")
.setStatus(MonitorStatus.Started).build());
when(readWriteTx.read(eq(LogicalDatastoreType.OPERATIONAL),
argThat(isType(MonitoringState.class))))
.thenReturn(FluentFutures.immediateFluentFuture(optState));
Optional<MonitoridKeyEntry> optMap = Optional
- .of(new MonitoridKeyEntryBuilder().setMonitorId(2L)
+ .of(new MonitoridKeyEntryBuilder().setMonitorId(Uint32.TWO)
.setMonitorKey("Test monitor Key").build());
when(readTx.read(eq(LogicalDatastoreType.OPERATIONAL),
argThat(isType(MonitoridKeyEntry.class))))
public void testMonitorUnpause()
throws InterruptedException, ExecutionException {
MonitorUnpauseInput input = new MonitorUnpauseInputBuilder()
- .setMonitorId(2L).build();
+ .setMonitorId(Uint32.TWO).build();
Optional<MonitoringState> optState = Optional
- .of(new MonitoringStateBuilder().setStatus(MonitorStatus.Paused)
+ .of(new MonitoringStateBuilder().setMonitorKey("foo").setStatus(MonitorStatus.Paused)
.build());
when(readWriteTx.read(eq(LogicalDatastoreType.OPERATIONAL),
argThat(isType(MonitoringState.class))))
.thenReturn(FluentFutures.immediateFluentFuture(optState));
Optional<MonitoringInfo> optInfo = Optional.of(
- new MonitoringInfoBuilder().setId(2L).setProfileId(1L).build());
+ new MonitoringInfoBuilder().setId(Uint32.TWO).setProfileId(Uint32.ONE).build());
when(readTx.read(eq(LogicalDatastoreType.OPERATIONAL),
argThat(isType(MonitoringInfo.class))))
.thenReturn(FluentFutures.immediateFluentFuture(optInfo));
argThat(isType(MonitorProfile.class))))
.thenReturn(FluentFutures.immediateFluentFuture(optProfile));
Optional<MonitoridKeyEntry> optMap = Optional
- .of(new MonitoridKeyEntryBuilder().setMonitorId(2L)
+ .of(new MonitoridKeyEntryBuilder().setMonitorId(Uint32.TWO)
.setMonitorKey("Test monitor Key").build());
when(readTx.read(eq(LogicalDatastoreType.OPERATIONAL),
argThat(isType(MonitoridKeyEntry.class))))
@Test
public void testMonitorStop()
throws InterruptedException, ExecutionException {
- MonitorStopInput input = new MonitorStopInputBuilder().setMonitorId(2L)
+ MonitorStopInput input = new MonitorStopInputBuilder().setMonitorId(Uint32.TWO)
.build();
Optional<MonitoringInfo> optInfo = Optional
- .of(new MonitoringInfoBuilder().setSource(new SourceBuilder()
- .setEndpointType(
- getInterface("testInterface", "10.1.1.1"))
- .build()).build());
+ .of(new MonitoringInfoBuilder().setId(Uint32.MAX_VALUE).setSource(new SourceBuilder()
+ .setEndpointType(getInterface("testInterface", "10.1.1.1"))
+ .build()).setProfileId(Uint32.ZERO).build());
FluentFuture<Optional<MonitoringInfo>> outFuture = FluentFutures.immediateFluentFuture(optInfo);
when(readTx.read(eq(LogicalDatastoreType.OPERATIONAL),
argThat(isType(MonitoringInfo.class)))).thenReturn(outFuture);
Optional<MonitoridKeyEntry> optMap = Optional
- .of(new MonitoridKeyEntryBuilder().setMonitorId(2L)
+ .of(new MonitoridKeyEntryBuilder().setMonitorId(Uint32.TWO)
.setMonitorKey("Test monitor Key").build());
when(readTx.read(eq(LogicalDatastoreType.OPERATIONAL),
argThat(isType(MonitoridKeyEntry.class))))
public void testMonitorProfileDelete()
throws InterruptedException, ExecutionException {
MonitorProfileDeleteInput input = new MonitorProfileDeleteInputBuilder()
- .setProfileId(1L).build();
+ .setProfileId(Uint32.ONE).build();
Optional<MonitorProfile> optProfile = Optional
.of(getTestMonitorProfile());
when(readWriteTx.read(eq(LogicalDatastoreType.OPERATIONAL),
private long createProfile()
throws InterruptedException, ExecutionException {
MonitorProfileCreateInput input = new MonitorProfileCreateInputBuilder()
- .setProfile(new ProfileBuilder().setFailureThreshold(10L)
- .setMonitorInterval(10000L).setMonitorWindow(10L)
+ .setProfile(new ProfileBuilder().setFailureThreshold(Uint32.TEN)
+ .setMonitorInterval(10000L).setMonitorWindow(Uint32.TEN)
.setProtocolType(MonitorProtocolType.Arp).build())
.build();
doReturn(FluentFutures.immediateFluentFuture(Optional.empty()))
}
private MonitorProfile getTestMonitorProfile() {
- return new MonitorProfileBuilder().setFailureThreshold(10L)
- .setMonitorInterval(10000L).setMonitorWindow(10L)
+ return new MonitorProfileBuilder().setId(Uint32.MAX_VALUE).setFailureThreshold(Uint32.TEN)
+ .setMonitorInterval(10000L).setMonitorWindow(Uint32.TEN)
.setProtocolType(MonitorProtocolType.Arp).build();
}
*/
package org.opendaylight.genius.alivenessmonitor.internal;
+import static java.util.Objects.requireNonNull;
import static org.opendaylight.genius.alivenessmonitor.utils.AlivenessMonitorUtil.getInterfaceMonitorMapId;
import static org.opendaylight.genius.alivenessmonitor.utils.AlivenessMonitorUtil.getMonitorMapId;
import static org.opendaylight.genius.alivenessmonitor.utils.AlivenessMonitorUtil.getMonitorProfileId;
import static org.opendaylight.genius.alivenessmonitor.utils.AlivenessMonitorUtil.getMonitoringInfoId;
import static org.opendaylight.mdsal.binding.util.Datastore.OPERATIONAL;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Predicate;
import com.google.common.base.Strings;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
+import java.util.function.Predicate;
import javax.annotation.PreDestroy;
import javax.inject.Inject;
import javax.inject.Singleton;
}
}
- Preconditions.checkNotNull(monitorKey, "Monitor Key required to process the state");
+ requireNonNull(monitorKey, "Monitor Key required to process the state");
LOG.debug("Processing monitorKey: {} for received packet", monitorKey);
FluentFuture<? extends CommitInfo> writeResult = readResult.transformAsync(optState -> {
if (optState.isPresent()) {
MonitoringState state = optState.get();
- if (isValidStatus.apply(state.getStatus())) {
+ if (isValidStatus.test(state.getStatus())) {
MonitoringState updatedState = new MonitoringStateBuilder().setMonitorKey(monitorKey)
.setStatus(newStatus).build();
tx.merge(LogicalDatastoreType.OPERATIONAL, getMonitorStateId(monitorKey), updatedState);
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
import static org.opendaylight.mdsal.binding.util.Datastore.OPERATIONAL;
import com.google.common.util.concurrent.FutureCallback;
srcIpBytes = getIpAddressBytes(interfaceAddress.getIpAddress());
GetPortFromInterfaceOutput portResult = getPortFromInterface(interfaceName);
- checkNotNull(portResult);
+ requireNonNull(portResult);
dpnId = portResult.getDpid();
Long portid = portResult.getPortno().toJava();
checkArgument(null != dpnId && !Uint64.ZERO.equals(dpnId),
try {
String interfaceName = input.getInterface();
GetPortFromInterfaceOutput portResult = getPortFromInterface(interfaceName);
- checkNotNull(portResult);
+ requireNonNull(portResult);
dpnId = portResult.getDpid();
Long portid = portResult.getPortno().toJava();
NodeConnectorRef ref = MDSALUtil.getNodeConnRef(dpnId, portid.toString());
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>6.0.5</version>
+ <version>7.0.0</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>controller-artifacts</artifactId>
- <version>2.0.4</version>
+ <version>3.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>infrautils-artifacts</artifactId>
- <version>1.8.1</version>
+ <version>1.9.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>parent</artifactId>
- <version>1.8.1</version>
+ <version>1.9.0</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>5.0.6</version>
+ <version>6.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>controller-artifacts</artifactId>
- <version>2.0.4</version>
+ <version>3.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>6.0.5</version>
+ <version>7.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
*/
package org.opendaylight.genius.fcapsapp;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.inject.Inject;
@Reference final NotificationService notificationService,
final PacketInCounterHandler packetInCounterHandler,
final NodeEventListener nodeEventListener) {
- this.dataBroker = Preconditions.checkNotNull(dataBroker, "DataBroker can not be null!");
+ this.dataBroker = requireNonNull(dataBroker, "DataBroker can not be null!");
LOG.info("FcapsProvider dataBroker is set");
- this.notificationService = Preconditions.checkNotNull(notificationService,
- "notificationService can not be null!");
+ this.notificationService = requireNonNull(notificationService, "notificationService can not be null!");
LOG.info("FcapsProvider notificationProviderService is set");
this.packetInCounterHandler = packetInCounterHandler;
*/
package org.opendaylight.genius.fcapsapp.performancecounter;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Multimap;
public FlowNodeConnectorInventoryTranslatorImpl(@Reference final DataBroker dataBroker,
final EntityOwnershipUtils entityOwnershipUtils,
@Reference MetricProvider metricProvider) {
- Preconditions.checkNotNull(dataBroker, "DataBroker can not be null!");
+ requireNonNull(dataBroker, "DataBroker can not be null!");
this.entityOwnershipUtils = entityOwnershipUtils;
packetInCounter = metricProvider.newCounter(MetricDescriptor.builder().anchor(this)
.project("genius").module("fcapsapplication")
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>6.0.5</version>
+ <version>7.0.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>infrautils-artifacts</artifactId>
- <version>1.8.1</version>
+ <version>1.9.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
-->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-genius-api">
<feature name="odl-genius-api">
- <feature version="[7,8)">odl-apache-commons-net</feature>
- <feature version="[6,7)">odl-mdsal-model-rfc7224</feature>
+ <feature version="[8,9)">odl-apache-commons-net</feature>
+ <feature version="[7,8)">odl-mdsal-model-rfc7224</feature>
</feature>
</features>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>infrautils-artifacts</artifactId>
- <version>1.8.1</version>
+ <version>1.9.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>infrautils-artifacts</artifactId>
- <version>1.8.1</version>
+ <version>1.9.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>infrautils-artifacts</artifactId>
- <version>1.8.1</version>
+ <version>1.9.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
* 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.genius.interfacemanager;
+import static java.util.Objects.requireNonNull;
import static org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION;
-import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.ExecutionException;
ReconciliationManager reconciliationManager) {
this.dataBroker = dataBroker;
this.txRunner = new ManagedNewTransactionRunnerImpl(dataBroker);
- reconciliationManager = Preconditions.checkNotNull(reconciliationManager,
- "ReconciliationManager cannot be null!");
+ reconciliationManager = requireNonNull(reconciliationManager, "ReconciliationManager cannot be null!");
reconciliationManager.registerService(this);
LOGGER.info("FrmNodeAndTablesBuilder has started successfully.");
}
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
* 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.genius.ipv6util.api;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.net.InetAddresses;
import java.net.InetAddress;
import java.net.UnknownHostException;
* @return the formatted IP address
*/
public static String getFormattedIpAddress(IpAddress ipAddress) {
- Preconditions.checkNotNull(ipAddress, "ipAddress is null");
+ requireNonNull(ipAddress, "ipAddress is null");
if (ipAddress.getIpv4Address() != null) {
// No formatting required for IPv4 address.
return ipAddress.getIpv4Address().getValue();
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.ExecutionException;
srcIpv6Address = interfaceAddress.getSrcIpAddress();
GetPortFromInterfaceOutput portResult = getPortFromInterface(interfaceName);
- checkNotNull(portResult);
+ requireNonNull(portResult);
dpnId = portResult.getDpid();
Long portid = portResult.getPortno().toJava();
checkArgument(null != dpnId && Uint64.ZERO != dpnId, DPN_NOT_FOUND_ERROR, interfaceName);
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
import static org.opendaylight.serviceutils.tools.rpc.FutureRpcResults.fromListenableFuture;
import static org.opendaylight.yangtools.yang.common.RpcResultBuilder.failed;
-import com.google.common.base.Objects;
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
long retVal;
if (!dcGatewayIpList.isEmpty()
- && dcGatewayIpList.values().stream().anyMatch(gwIp -> Objects.equal(gwIp.getIpAddress(), dcgwIpAddr))) {
+ && dcGatewayIpList.values().stream().anyMatch(gwIp -> dcgwIpAddr.equals(gwIp.getIpAddress()))) {
//Match found
retVal = 1;
IsDcgwPresentOutputBuilder output = new IsDcgwPresentOutputBuilder().setRetVal(retVal);
.setNodeId(sourceDevice).setTopologyId(destinationDevice).build();
vteps = new VtepsBuilder().setDpnId(dpId2)
.setIpAddress(ipAddress1).withKey(new VtepsKey(dpId2)).build();
- vtepsTest = new VtepsBuilder().build();
+ vtepsTest = new VtepsBuilder().setDpnId(Uint64.TEN).build();
deviceVtepsList.add(deviceVteps);
vtepsList.add(vteps);
transportZone = new TransportZoneBuilder().setZoneName(transportZone1).setTunnelType(tunnelType1).withKey(new
.setOperState(TunnelOperStatus.Up).build();
stateTunnelList.add(stateTunnelListTest);
lowerLayerIfList.add(dpId1.toString());
- interfaceTest = new InterfaceBuilder().setOperStatus(Interface.OperStatus.Up)
+ interfaceTest = new InterfaceBuilder().setName("foo").setOperStatus(Interface.OperStatus.Up)
.setAdminStatus(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508
.interfaces.state.Interface.AdminStatus.Up)
.setPhysAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715
List<DPNTEPsInfo> cfgdDpnListVxlan = new ArrayList<>() ;
List<TunnelEndPoints> tunnelEndPointsListVxlan = new ArrayList<>();
List<TunnelEndPoints> tunnelEndPointsListVxlanNew = new ArrayList<>();
- java.lang.Class<? extends TunnelTypeBase> tunnelType1 = TunnelTypeVxlan.class;
+ Class<? extends TunnelTypeBase> tunnelType1 = TunnelTypeVxlan.class;
TunnelMonitorParams tunnelMonitorParams = null;
TunnelMonitorInterval tunnelMonitorInterval = null;
- InternalTunnel internalTunnel = new InternalTunnelBuilder().build();
+ InternalTunnel internalTunnel = new InternalTunnelBuilder()
+ .setDestinationDPN(Uint64.ONE)
+ .setSourceDPN(Uint64.TWO)
+ .setTransportType(tunnelType1)
+ .build();
InstanceIdentifier<TunnelMonitorParams> tunnelMonitorParamsInstanceIdentifier =
InstanceIdentifier.create(TunnelMonitorParams.class);
InstanceIdentifier<TunnelMonitorInterval> tunnelMonitorIntervalIdentifier =
InstanceIdentifier.create(TunnelMonitorInterval.class);
Class<? extends TunnelMonitoringTypeBase> monitorProtocol = TunnelMonitoringTypeBfd.class;
InstanceIdentifier<InternalTunnel> internalTunnelIdentifier = InstanceIdentifier.builder(TunnelList.class)
- .child(InternalTunnel.class, new InternalTunnelKey(Uint64.ONE, Uint64.valueOf(2), tunnelType1))
+ .child(InternalTunnel.class, new InternalTunnelKey(Uint64.ONE, Uint64.TWO, tunnelType1))
.build();
@Mock DataBroker dataBroker;
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
@Test
public void testEternalTransactionCommitFailedExceptionOnLock()
throws InterruptedException, ExecutionException, TimeoutException {
- logCaptureRule.expectError("RPC lock() failed; input = LockInput{_lockName=testLock, augmentation=[]}");
+ logCaptureRule.expectError("RPC lock() failed; input = LockInput{lockName=testLock, augmentation=[]}");
dbFailureSimulator.failSubmits(new TransactionCommitFailedException("bada boum bam!"));
LockInput lockInput = new LockInputBuilder().setLockName("testLock").build();
assertRpcErrorCause(lockManager.lock(lockInput), TransactionCommitFailedException.class, "bada boum bam!");
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Future;
import java.util.function.Function;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.infrautils.utils.function.CheckedConsumer;
import org.opendaylight.infrautils.utils.function.InterruptibleCheckedConsumer;
import org.opendaylight.infrautils.utils.function.InterruptibleCheckedFunction;
* or pending;
* calling code therefore <b>must</b> handle the returned future, e.g. by passing it onwards (return),
* or by itself adding callback listeners to it using {@link Futures}' methods, or by transforming it into a
- * {@link CompletionStage} using {@link ListenableFutures#toCompletionStage(ListenableFuture)} and chaining on
- * that, or at the very least simply by using
- * {@link ListenableFutures#addErrorLogging(ListenableFuture, org.slf4j.Logger, String)}
+ * {@link CompletionStage} and chaining on that, or at the very least simply by using
+ * {@link LoggingFutures#addErrorLogging(ListenableFuture, org.slf4j.Logger, String)}
* (but better NOT by using the blocking {@link Future#get()} on it).
*
* @param txConsumer the {@link CheckedConsumer} that needs a new write only transaction
* or pending;
* calling code therefore <b>must</b> handle the returned future, e.g. by passing it onwards (return),
* or by itself adding callback listeners to it using {@link Futures}' methods, or by transforming it into a
- * {@link CompletionStage} using {@link ListenableFutures#toCompletionStage(ListenableFuture)} and chaining on
- * that, or at the very least simply by using
- * {@link ListenableFutures#addErrorLogging(ListenableFuture, org.slf4j.Logger, String)}
+ * {@link CompletionStage} and chaining on that, or at the very least simply by using
+ * {@link LoggingFutures#addErrorLogging(ListenableFuture, org.slf4j.Logger, String)}
* (but better NOT by using the blocking {@link Future#get()} on it).
*
* @param txConsumer the {@link CheckedConsumer} that needs a new read-write transaction
import edu.umd.cs.findbugs.annotations.CheckReturnValue;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Future;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.infrautils.utils.function.InterruptibleCheckedConsumer;
import org.opendaylight.infrautils.utils.function.InterruptibleCheckedFunction;
import org.opendaylight.mdsal.binding.api.DataBroker;
* or pending;
* calling code therefore <b>must</b> handle the returned future, e.g. by passing it onwards (return),
* or by itself adding callback listeners to it using {@link Futures}' methods, or by transforming it into a
- * {@link CompletionStage} using {@link ListenableFutures#toCompletionStage(ListenableFuture)} and chaining on
- * that, or at the very least simply by using
- * {@link ListenableFutures#addErrorLogging(ListenableFuture, org.slf4j.Logger, String)}
+ * {@link CompletionStage} and chaining on that, or at the very least simply by using
+ * {@link LoggingFutures#addErrorLogging(ListenableFuture, org.slf4j.Logger, String)}
* (but better NOT by using the blocking {@link Future#get()} on it).
*
* @param datastoreType the {@link Datastore} type that will be accessed
* or pending;
* calling code therefore <b>must</b> handle the returned future, e.g. by passing it onwards (return),
* or by itself adding callback listeners to it using {@link Futures}' methods, or by transforming it into a
- * {@link CompletionStage} using {@link ListenableFutures#toCompletionStage(ListenableFuture)} and chaining on
- * that, or at the very least simply by using
- * {@link ListenableFutures#addErrorLogging(ListenableFuture, org.slf4j.Logger, String)}
+ * {@link CompletionStage} and chaining on that, or at the very least simply by using
+ * {@link LoggingFutures#addErrorLogging(ListenableFuture, org.slf4j.Logger, String)}
* (but better NOT by using the blocking {@link Future#get()} on it).
*
* @param datastoreType the {@link Datastore} type that will be accessed
* or pending;
* calling code therefore <b>must</b> handle the returned future, e.g. by passing it onwards (return),
* or by itself adding callback listeners to it using {@link Futures}' methods, or by transforming it into a
- * {@link CompletionStage} using {@link ListenableFutures#toCompletionStage(ListenableFuture)} and chaining on
- * that, or at the very least simply by using
- * {@link ListenableFutures#addErrorLogging(ListenableFuture, org.slf4j.Logger, String)}
+ * {@link CompletionStage} using and chaining on that, or at the very least simply by using
+ * {@link LoggingFutures#addErrorLogging(ListenableFuture, org.slf4j.Logger, String)}
* (but better NOT by using the blocking {@link Future#get()} on it).
*
* @param datastoreType the {@link Datastore} type that will be accessed
*/
package org.opendaylight.genius.utils.batching;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
public void registerBatchableResource(final String resourceType,
final BlockingQueue<ActionableResource<?>> resQueue, final ResourceHandler resHandler) {
- Preconditions.checkNotNull(resQueue, "ResourceQueue to use for batching cannot not be null.");
- Preconditions.checkNotNull(resHandler, "ResourceHandler cannot not be null.");
+ requireNonNull(resQueue, "ResourceQueue to use for batching cannot not be null.");
+ requireNonNull(resHandler, "ResourceHandler cannot not be null.");
resourceHandlerMapper.put(resourceType, new ImmutablePair<>(resQueue, resHandler));
ScheduledExecutorService resDelegatorService =
* 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.genius.utils.hwvtep;
import static java.util.Objects.requireNonNull;
-import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableBiMap;
import java.util.ArrayList;
import java.util.List;
}
public static Class<? extends EncapsulationTypeBase> createEncapsulationType(String type) {
- Preconditions.checkNotNull(type);
+ requireNonNull(type);
if (type.isEmpty()) {
return EncapsulationTypeVxlanOverIpv4.class;
} else {
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>