<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</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.dsbenchmark.simpletx;
+import static java.util.Objects.requireNonNull;
+
import java.util.List;
import java.util.concurrent.ExecutionException;
import org.opendaylight.dsbenchmark.BaListBuilder;
import org.opendaylight.dsbenchmark.DatastoreAbstractWriter;
import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.WriteTransaction;
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.StartTestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.StartTestInput.DataStore;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExec;
public class SimpletxBaWrite extends DatastoreAbstractWriter {
private static final Logger LOG = LoggerFactory.getLogger(SimpletxBaWrite.class);
+
private final DataBroker dataBroker;
- private List<OuterList> list;
+ private List<OuterList> list = null;
public SimpletxBaWrite(final DataBroker dataBroker, final StartTestInput.Operation oper,
final int outerListElem, final int innerListElem, final long writesPerTx, final DataStore dataStore) {
super(oper, outerListElem, innerListElem, writesPerTx, dataStore);
- this.dataBroker = dataBroker;
+ this.dataBroker = requireNonNull(dataBroker);
LOG.debug("Created SimpletxBaWrite");
}
@Override
public void createList() {
- list = BaListBuilder.buildOuterList(this.outerListElem, this.innerListElem);
+ list = BaListBuilder.buildOuterList(outerListElem, innerListElem);
}
@Override
public void executeList() {
- final LogicalDatastoreType dsType = getDataStoreType();
+ final var dsType = getDataStoreType();
- WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
+ var tx = dataBroker.newWriteOnlyTransaction();
long writeCnt = 0;
- for (OuterList element : this.list) {
- InstanceIdentifier<OuterList> iid = InstanceIdentifier.create(TestExec.class)
- .child(OuterList.class, element.key());
+ for (var element : list) {
+ final var iid = InstanceIdentifier.create(TestExec.class).child(OuterList.class, element.key());
if (oper == StartTestInput.Operation.PUT) {
tx.put(dsType, iid, element);
} else {
}
}
}
-
}
* 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.dsbenchmark.simpletx;
+import static java.util.Objects.requireNonNull;
+
import java.util.List;
import java.util.concurrent.ExecutionException;
import org.opendaylight.dsbenchmark.DatastoreAbstractWriter;
import org.opendaylight.dsbenchmark.DomListBuilder;
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.StartTestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.StartTestInput.DataStore;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExec;
public class SimpletxDomWrite extends DatastoreAbstractWriter {
private static final Logger LOG = LoggerFactory.getLogger(SimpletxDomWrite.class);
- private final DOMDataBroker domDataBroker;
- private List<MapEntryNode> list;
- public SimpletxDomWrite(final DOMDataBroker domDataBroker, final StartTestInput.Operation oper,
+ private final DOMDataBroker dataBroker;
+ private List<MapEntryNode> list = null;
+
+ public SimpletxDomWrite(final DOMDataBroker dataBroker, final StartTestInput.Operation oper,
final int outerListElem, final int innerListElem, final long putsPerTx, final DataStore dataStore) {
super(oper, outerListElem, innerListElem, putsPerTx, dataStore);
- this.domDataBroker = domDataBroker;
+ this.dataBroker = requireNonNull(dataBroker);
LOG.debug("Created SimpletxDomWrite");
}
@Override
public void createList() {
- list = DomListBuilder.buildOuterList(this.outerListElem, this.innerListElem);
+ list = DomListBuilder.buildOuterList(outerListElem, innerListElem);
}
@Override
public void executeList() {
- final LogicalDatastoreType dsType = getDataStoreType();
- final YangInstanceIdentifier pid =
- YangInstanceIdentifier.builder().node(TestExec.QNAME).node(OuterList.QNAME).build();
+ final var dsType = getDataStoreType();
+ final var pid = YangInstanceIdentifier.of(TestExec.QNAME, OuterList.QNAME);
- DOMDataTreeWriteTransaction tx = domDataBroker.newWriteOnlyTransaction();
+ var tx = dataBroker.newWriteOnlyTransaction();
long writeCnt = 0;
- for (MapEntryNode element : this.list) {
- YangInstanceIdentifier yid =
- pid.node(NodeIdentifierWithPredicates.of(OuterList.QNAME, element.getIdentifier().asMap()));
+ for (var element : list) {
+ final var yid = pid.node(NodeIdentifierWithPredicates.of(OuterList.QNAME, element.name().asMap()));
if (oper == StartTestInput.Operation.PUT) {
tx.put(dsType, yid, element);
LOG.error("Transaction failed", e);
txError++;
}
- tx = domDataBroker.newWriteOnlyTransaction();
+ tx = dataBroker.newWriteOnlyTransaction();
writeCnt = 0;
}
}
*/
package org.opendaylight.dsbenchmark.txchain;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.MoreExecutors;
import java.util.List;
import org.opendaylight.mdsal.binding.api.Transaction;
import org.opendaylight.mdsal.binding.api.TransactionChain;
import org.opendaylight.mdsal.binding.api.TransactionChainListener;
-import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.mdsal.common.api.CommitInfo;
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.StartTestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.StartTestInput.DataStore;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.StartTestInput.Operation;
public class TxchainBaWrite extends DatastoreAbstractWriter implements TransactionChainListener {
private static final Logger LOG = LoggerFactory.getLogger(TxchainBaWrite.class);
- private final DataBroker bindingDataBroker;
- private List<OuterList> list;
- public TxchainBaWrite(final DataBroker bindingDataBroker, final Operation oper,
- final int outerListElem, final int innerListElem, final long writesPerTx, final DataStore dataStore) {
+ private final DataBroker dataBroker;
+ private List<OuterList> list = null;
+
+ public TxchainBaWrite(final DataBroker dataBroker, final Operation oper, final int outerListElem,
+ final int innerListElem, final long writesPerTx, final DataStore dataStore) {
super(oper, outerListElem, innerListElem, writesPerTx, dataStore);
- this.bindingDataBroker = bindingDataBroker;
+ this.dataBroker = requireNonNull(dataBroker);
LOG.debug("Created TxchainBaWrite");
}
@Override
public void createList() {
- list = BaListBuilder.buildOuterList(this.outerListElem, this.innerListElem);
+ list = BaListBuilder.buildOuterList(outerListElem, innerListElem);
}
@Override
public void executeList() {
- final TransactionChain chain = bindingDataBroker.createMergingTransactionChain(this);
- final LogicalDatastoreType dsType = getDataStoreType();
+ final var chain = dataBroker.createMergingTransactionChain(this);
+ final var dsType = getDataStoreType();
- WriteTransaction tx = chain.newWriteOnlyTransaction();
+ var tx = chain.newWriteOnlyTransaction();
int txSubmitted = 0;
int writeCnt = 0;
- for (OuterList element : this.list) {
- InstanceIdentifier<OuterList> iid = InstanceIdentifier.create(TestExec.class)
- .child(OuterList.class, element.key());
+ for (var element : list) {
+ final var iid = InstanceIdentifier.create(TestExec.class).child(OuterList.class, element.key());
if (oper == StartTestInput.Operation.PUT) {
tx.put(dsType, iid, element);
import org.opendaylight.dsbenchmark.DatastoreAbstractWriter;
import org.opendaylight.dsbenchmark.DomListBuilder;
import org.opendaylight.mdsal.common.api.CommitInfo;
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.mdsal.dom.api.DOMDataTreeTransaction;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
import org.opendaylight.mdsal.dom.api.DOMTransactionChainListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.StartTestInput;
public class TxchainDomWrite extends DatastoreAbstractWriter implements DOMTransactionChainListener {
private static final Logger LOG = LoggerFactory.getLogger(TxchainDomWrite.class);
- private final DOMDataBroker domDataBroker;
- private List<MapEntryNode> list;
- public TxchainDomWrite(final DOMDataBroker domDataBroker, final StartTestInput.Operation oper,
+ private final DOMDataBroker dataBroker;
+ private List<MapEntryNode> list = null;
+
+ public TxchainDomWrite(final DOMDataBroker dataBroker, final StartTestInput.Operation oper,
final int outerListElem, final int innerListElem, final long writesPerTx, final DataStore dataStore) {
super(oper, outerListElem, innerListElem, writesPerTx, dataStore);
- this.domDataBroker = domDataBroker;
+ this.dataBroker = dataBroker;
LOG.debug("Created TxchainDomWrite");
}
@Override
public void createList() {
- list = DomListBuilder.buildOuterList(this.outerListElem, this.innerListElem);
+ list = DomListBuilder.buildOuterList(outerListElem, innerListElem);
}
@Override
public void executeList() {
- final LogicalDatastoreType dsType = getDataStoreType();
- final YangInstanceIdentifier pid =
- YangInstanceIdentifier.builder().node(TestExec.QNAME).node(OuterList.QNAME).build();
- final DOMTransactionChain chain = domDataBroker.createMergingTransactionChain(this);
+ final var dsType = getDataStoreType();
+ final var pid = YangInstanceIdentifier.of(TestExec.QNAME, OuterList.QNAME);
+ final var chain = dataBroker.createMergingTransactionChain(this);
- DOMDataTreeWriteTransaction tx = chain.newWriteOnlyTransaction();
+ var tx = chain.newWriteOnlyTransaction();
int txSubmitted = 0;
int writeCnt = 0;
- for (MapEntryNode element : this.list) {
- YangInstanceIdentifier yid =
- pid.node(NodeIdentifierWithPredicates.of(OuterList.QNAME, element.getIdentifier().asMap()));
+ for (var element : list) {
+ var yid = pid.node(NodeIdentifierWithPredicates.of(OuterList.QNAME, element.name().asMap()));
if (oper == StartTestInput.Operation.PUT) {
tx.put(dsType, yid, element);
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>dom-parent</artifactId>
- <version>12.0.3</version>
+ <version>12.0.4</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<link>https://netty.io/4.1/api/</link>
<link>https://commons.apache.org/proper/commons-lang/javadocs/api-release/</link>
- <link>https://www.javadoc.io/doc/org.opendaylight.odlparent/odlparent-docs/13.0.7/</link>
- <link>https://www.javadoc.io/doc/org.opendaylight.yangtools/yangtools-docs/11.0.4/</link>
- <link>https://www.javadoc.io/doc/org.opendaylight.mdsal/mdsal-docs/12.0.3/</link>
+ <link>https://www.javadoc.io/doc/org.opendaylight.odlparent/odlparent-docs/13.0.10/</link>
+ <link>https://www.javadoc.io/doc/org.opendaylight.yangtools/yangtools-docs/11.0.5/</link>
+ <link>https://www.javadoc.io/doc/org.opendaylight.mdsal/mdsal-docs/12.0.4/</link>
</links>
<groups>
<group>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>11.0.4</version>
+ <version>11.0.5</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>12.0.3</version>
+ <version>12.0.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableSet;
-import java.util.Collection;
import java.util.Objects;
-import java.util.Set;
import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
import org.opendaylight.mdsal.dom.api.DOMRpcImplementationNotAvailableException;
import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.RpcService;
-import org.opendaylight.yangtools.yang.common.QName;
import org.osgi.framework.Bundle;
import org.osgi.service.blueprint.container.ComponentDefinitionException;
import org.slf4j.Logger;
private static final Logger LOG = LoggerFactory.getLogger(ActionProviderBean.class);
- private DOMRpcProviderService domRpcProvider;
- private RpcProviderService bindingRpcProvider;
- private DOMSchemaService schemaService;
- private RpcService implementation;
- private String interfaceName;
+ private DOMRpcProviderService domRpcProvider = null;
+ private RpcProviderService bindingRpcProvider = null;
+ private DOMSchemaService schemaService = null;
+ private RpcService implementation = null;
+ private String interfaceName = null;
private Registration reg;
- private Bundle bundle;
+ private Bundle bundle = null;
public void setBundle(final Bundle bundle) {
this.bundle = bundle;
}
private void registerFallback(final Class<RpcService> interfaceClass) {
- final Collection<QName> paths = RpcUtil.decomposeRpcService(interfaceClass,
- schemaService.getGlobalContext(), Objects::nonNull);
+ final var paths = RpcUtil.decomposeRpcService(interfaceClass, schemaService.getGlobalContext(),
+ Objects::nonNull);
if (paths.isEmpty()) {
LOG.warn("{}: interface {} has no actions defined", ACTION_PROVIDER, interfaceClass);
return;
}
- final Set<DOMRpcIdentifier> rpcs = ImmutableSet.copyOf(Collections2.transform(paths, DOMRpcIdentifier::create));
+ final var rpcs = ImmutableSet.copyOf(Collections2.transform(paths, DOMRpcIdentifier::create));
reg = domRpcProvider.registerRpcImplementation(
(rpc, input) -> FluentFutures.immediateFailedFluentFuture(new DOMRpcImplementationNotAvailableException(
"Action %s has no instance matching %s", rpc, input)), rpcs);
import org.osgi.framework.Constants;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.blueprint.reflect.BeanProperty;
-import org.osgi.service.blueprint.reflect.ComponentMetadata;
import org.osgi.service.blueprint.reflect.ValueMetadata;
import org.osgi.service.cm.ManagedService;
import org.slf4j.Logger;
private static final String CM_PERSISTENT_ID_PROPERTY = "persistentId";
private final List<ServiceRegistration<?>> managedServiceRegs = new ArrayList<>();
- private Bundle bundle;
- private BlueprintContainerRestartService blueprintContainerRestartService;
+ private Bundle bundle = null;
+ private BlueprintContainerRestartService blueprintContainerRestartService = null;
private boolean restartDependentsOnUpdates;
private boolean useDefaultForReferenceTypes;
}
public void destroy() {
- for (ServiceRegistration<?> reg: managedServiceRegs) {
- AriesFrameworkUtil.safeUnregisterService(reg);
- }
+ managedServiceRegs.forEach(AriesFrameworkUtil::safeUnregisterService);
}
@Override
public void process(final ComponentDefinitionRegistry registry) {
LOG.debug("{}: In process", logName());
- for (String name : registry.getComponentDefinitionNames()) {
- ComponentMetadata component = registry.getComponentDefinition(name);
- if (component instanceof MutableBeanMetadata) {
- processMutableBeanMetadata((MutableBeanMetadata) component);
- } else if (component instanceof MutableServiceReferenceMetadata) {
- processServiceReferenceMetadata((MutableServiceReferenceMetadata)component);
+ for (var name : registry.getComponentDefinitionNames()) {
+ final var component = registry.getComponentDefinition(name);
+ if (component instanceof MutableBeanMetadata bean) {
+ processMutableBeanMetadata(bean);
+ } else if (component instanceof MutableServiceReferenceMetadata serviceRef) {
+ processServiceReferenceMetadata(serviceRef);
}
}
}
LOG.debug("{}: Found PropertyPlaceholder bean: {}, runtime {}", logName(), bean.getId(),
bean.getRuntimeClass());
- for (BeanProperty prop : bean.getProperties()) {
+ for (var prop : bean.getProperties()) {
if (CM_PERSISTENT_ID_PROPERTY.equals(prop.getName())) {
- if (prop.getValue() instanceof ValueMetadata) {
- ValueMetadata persistentId = (ValueMetadata)prop.getValue();
-
- LOG.debug("{}: Found {} property, value : {}", logName(),
- CM_PERSISTENT_ID_PROPERTY, persistentId.getStringValue());
-
+ if (prop.getValue() instanceof ValueMetadata persistentId) {
+ LOG.debug("{}: Found {} property, value : {}", logName(), CM_PERSISTENT_ID_PROPERTY,
+ persistentId.getStringValue());
registerManagedService(persistentId.getStringValue());
} else {
- LOG.debug("{}: {} property metadata {} is not instanceof ValueMetadata",
- logName(), CM_PERSISTENT_ID_PROPERTY, prop.getValue());
+ LOG.debug("{}: {} property metadata {} is not instanceof ValueMetadata", logName(),
+ CM_PERSISTENT_ID_PROPERTY, prop.getValue());
}
break;
private void registerManagedService(final String persistentId) {
// Register a ManagedService so we get updates from the ConfigAdmin when the cfg file corresponding
// to the persistentId changes.
- final ManagedService managedService = new ManagedService() {
+ final var managedService = new ManagedService() {
private final AtomicBoolean initialUpdate = new AtomicBoolean(true);
private volatile Dictionary<String, ?> previousProperties;
private static final Logger LOG = LoggerFactory.getLogger(NotificationListenerBean.class);
static final String NOTIFICATION_LISTENER = "notification-listener";
- private Bundle bundle;
- private NotificationService notificationService;
- private NotificationListener notificationListener;
- private ListenerRegistration<?> registration;
+ private Bundle bundle = null;
+ private NotificationService notificationService = null;
+ private NotificationListener notificationListener = null;
+ private ListenerRegistration<?> registration = null;
public void setNotificationService(final NotificationService notificationService) {
this.notificationService = notificationService;
private static final Logger LOG = LoggerFactory.getLogger(RpcImplementationBean.class);
static final String RPC_IMPLEMENTATION = "rpc-implementation";
- private RpcProviderService rpcProvider;
- private Bundle bundle;
- private String interfaceName;
- private RpcService implementation;
private final List<ObjectRegistration<RpcService>> rpcRegistrations = new ArrayList<>();
+ private RpcProviderService rpcProvider = null;
+ private Bundle bundle = null;
+ private String interfaceName = null;
+ private RpcService implementation = null;
public void setRpcProvider(final RpcProviderService rpcProvider) {
this.rpcProvider = rpcProvider;
@SuppressWarnings("checkstyle:IllegalCatch")
public void init() {
try {
- List<Class<RpcService>> rpcInterfaces = getImplementedRpcServiceInterfaces(interfaceName,
+ final var rpcInterfaces = getImplementedRpcServiceInterfaces(interfaceName,
implementation.getClass(), bundle, RPC_IMPLEMENTATION);
LOG.debug("{}: init - adding implementation {} for RpcService interface(s) {}", bundle.getSymbolicName(),
implementation, rpcInterfaces);
- for (Class<RpcService> rpcInterface : rpcInterfaces) {
+ for (var rpcInterface : rpcInterfaces) {
rpcRegistrations.add(rpcProvider.registerRpcImplementation(rpcInterface, implementation));
}
} catch (final ComponentDefinitionException e) {
return Collections.singletonList((Class<RpcService>)rpcInterface);
}
- List<Class<RpcService>> rpcInterfaces = new ArrayList<>();
- for (Class<?> intface : implementationClass.getInterfaces()) {
+ final var rpcInterfaces = new ArrayList<Class<RpcService>>();
+ for (var intface : implementationClass.getInterfaces()) {
if (RpcService.class.isAssignableFrom(intface)) {
rpcInterfaces.add((Class<RpcService>) intface);
}
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
import static com.google.common.base.Verify.verify;
import static com.google.common.base.Verify.verifyNotNull;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.concurrent.CountDownLatch;
private final StampedLock lock = new StampedLock();
+ @SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD",
+ justification = "https://github.com/spotbugs/spotbugs/issues/2749")
private volatile CountDownLatch latch;
/**
}
public void unlockWrite(final long stamp) {
- final CountDownLatch local = (CountDownLatch) LATCH.getAndSet(this, null);
- verifyNotNull(local);
+ final var local = verifyNotNull((CountDownLatch) LATCH.getAndSet(this, null));
lock.unlockWrite(stamp);
local.countDown();
}
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>12.0.3</version>
+ <version>12.0.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>12.0.3</version>
+ <version>12.0.4</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
+import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.Map;
private final @NonNull Object identifier;
private final Map<LogicalDatastoreType, ? extends DOMStoreTransactionFactory> storeTxFactories;
+ @SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD",
+ justification = "https://github.com/spotbugs/spotbugs/issues/2749")
private volatile Entry<LogicalDatastoreType, T> backingTx;
/**
* @param identifier Identifier of transaction.
*/
protected AbstractDOMBrokerTransaction(final Object identifier,
- Map<LogicalDatastoreType, ? extends DOMStoreTransactionFactory> storeTxFactories) {
+ final Map<LogicalDatastoreType, ? extends DOMStoreTransactionFactory> storeTxFactories) {
this.identifier = requireNonNull(identifier, "Identifier should not be null");
this.storeTxFactories = requireNonNull(storeTxFactories, "Store Transaction Factories should not be null");
checkArgument(!storeTxFactories.isEmpty(), "Store Transaction Factories should not be empty");
/**
* Returns sub-transaction if initialized.
*/
+ @VisibleForTesting
protected T getSubtransaction() {
final Entry<LogicalDatastoreType, T> entry;
return (entry = backingTx) == null ? null : entry.getValue();
@SuppressWarnings("checkstyle:IllegalCatch")
protected void closeSubtransaction() {
- if (backingTx != null) {
+ final var local = backingTx;
+ if (local != null) {
try {
- backingTx.getValue().close();
+ local.getValue().close();
} catch (Exception e) {
throw new IllegalStateException("Uncaught exception occurred during closing transaction", e);
}
}
}
- protected DOMStoreTransactionFactory getTxFactory(LogicalDatastoreType type) {
+ protected DOMStoreTransactionFactory getTxFactory(final LogicalDatastoreType type) {
return storeTxFactories.get(type);
}
import akka.actor.Props;
import com.google.common.annotations.VisibleForTesting;
import java.util.concurrent.TimeUnit;
+import org.eclipse.jdt.annotation.NonNullByDefault;
import org.opendaylight.controller.cluster.common.actor.AbstractUntypedActor;
import org.opendaylight.controller.cluster.datastore.messages.CloseDataTreeNotificationListenerRegistration;
import org.opendaylight.controller.cluster.datastore.messages.CloseDataTreeNotificationListenerRegistrationReply;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
import scala.concurrent.duration.FiniteDuration;
/**
@VisibleForTesting
static long killDelay = TimeUnit.MILLISECONDS.convert(5, TimeUnit.SECONDS);
- private ListenerRegistration<?> registration;
- private Runnable onClose;
+ private SetRegistration registration = null;
+ private Cancellable killSchedule = null;
private boolean closed;
- private Cancellable killSchedule;
@Override
protected void handleReceive(final Object message) {
if (isValidSender(getSender())) {
getSender().tell(CloseDataTreeNotificationListenerRegistrationReply.getInstance(), getSelf());
}
- } else if (message instanceof SetRegistration) {
- registration = ((SetRegistration)message).registration;
- onClose = ((SetRegistration)message).onClose;
+ } else if (message instanceof SetRegistration setRegistration) {
+ registration = setRegistration;
if (closed) {
closeListenerRegistration();
}
private void closeListenerRegistration() {
closed = true;
- if (registration != null) {
- registration.close();
- onClose.run();
+
+ final var reg = registration;
+ if (reg != null) {
registration = null;
+ reg.registration.close();
+ reg.onClose.run();
if (killSchedule == null) {
killSchedule = getContext().system().scheduler().scheduleOnce(FiniteDuration.create(killDelay,
return Props.create(DataTreeNotificationListenerRegistrationActor.class);
}
- public static class SetRegistration {
- private final ListenerRegistration<?> registration;
- private final Runnable onClose;
-
- public SetRegistration(final ListenerRegistration<?> registration, final Runnable onClose) {
- this.registration = requireNonNull(registration);
- this.onClose = requireNonNull(onClose);
+ @NonNullByDefault
+ public record SetRegistration(Registration registration, Runnable onClose) {
+ public SetRegistration {
+ requireNonNull(registration);
+ requireNonNull(onClose);
}
}
}
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
private final RpcProviderService rpcProviderRegistry;
private final Registration singletonRegistration;
- private ObjectRegistration<?> rpcRegistration;
+ private ObjectRegistration<?> rpcRegistration = null;
@Inject
@Activate
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import org.opendaylight.mdsal.dom.api.ClusteredDOMDataTreeChangeListener;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
private static final Logger LOG = LoggerFactory.getLogger(IdIntsListener.class);
private static final long SECOND_AS_NANO = 1000000000;
- private volatile NormalizedNode localCopy;
private final AtomicLong lastNotifTimestamp = new AtomicLong(0);
- private ScheduledExecutorService executorService;
- private ScheduledFuture<?> scheduledFuture;
+ private ScheduledExecutorService executorService = null;
+ private ScheduledFuture<?> scheduledFuture = null;
+
+ private volatile NormalizedNode localCopy;
@Override
public void onInitialData() {
public Future<Void> tryFinishProcessing() {
executorService = Executors.newSingleThreadScheduledExecutor();
- final SettableFuture<Void> settableFuture = SettableFuture.create();
+ final var settableFuture = SettableFuture.<Void>create();
scheduledFuture = executorService.scheduleAtFixedRate(new CheckFinishedTask(settableFuture),
0, 1, TimeUnit.SECONDS);
public static String diffNodes(final MapNode expected, final MapNode actual) {
StringBuilder builder = new StringBuilder("MapNodes diff:");
- final YangInstanceIdentifier.NodeIdentifier itemNodeId = new YangInstanceIdentifier.NodeIdentifier(ITEM);
+ final var itemNodeId = new NodeIdentifier(ITEM);
- Map<NodeIdentifierWithPredicates, MapEntryNode> expIdIntMap = new HashMap<>();
- expected.body().forEach(node -> expIdIntMap.put(node.getIdentifier(), node));
+ final var expIdIntMap = new HashMap<NodeIdentifierWithPredicates, MapEntryNode>();
+ expected.body().forEach(node -> expIdIntMap.put(node.name(), node));
actual.body().forEach(actIdInt -> {
- final MapEntryNode expIdInt = expIdIntMap.remove(actIdInt.getIdentifier());
+ final var expIdInt = expIdIntMap.remove(actIdInt.name());
if (expIdInt == null) {
- builder.append('\n').append(" Unexpected id-int entry for ").append(actIdInt.getIdentifier());
+ builder.append('\n').append(" Unexpected id-int entry for ").append(actIdInt.name());
return;
}
- Map<NodeIdentifierWithPredicates, MapEntryNode> expItemMap = new HashMap<>();
- ((MapNode)expIdInt.findChildByArg(itemNodeId).orElseThrow()).body()
- .forEach(node -> expItemMap.put(node.getIdentifier(), node));
+ final var expItemMap = new HashMap<NodeIdentifierWithPredicates, MapEntryNode>();
+ ((MapNode)expIdInt.getChildByArg(itemNodeId)).body()
+ .forEach(node -> expItemMap.put(node.name(), node));
- ((MapNode)actIdInt.findChildByArg(itemNodeId).orElseThrow()).body().forEach(actItem -> {
- final MapEntryNode expItem = expItemMap.remove(actItem.getIdentifier());
+ ((MapNode)actIdInt.getChildByArg(itemNodeId)).body().forEach(actItem -> {
+ final var expItem = expItemMap.remove(actItem.name());
if (expItem == null) {
- builder.append('\n').append(" Unexpected item entry ").append(actItem.getIdentifier())
- .append(" for id-int entry ").append(actIdInt.getIdentifier());
+ builder.append('\n').append(" Unexpected item entry ").append(actItem.name())
+ .append(" for id-int entry ").append(actIdInt.name());
}
});
expItemMap.values().forEach(node -> builder.append('\n')
- .append(" Actual is missing item entry ").append(node.getIdentifier())
- .append(" for id-int entry ").append(actIdInt.getIdentifier()));
+ .append(" Actual is missing item entry ").append(node.name())
+ .append(" for id-int entry ").append(actIdInt.name()));
});
expIdIntMap.values().forEach(node -> builder.append('\n')
- .append(" Actual is missing id-int entry for ").append(node.getIdentifier()));
+ .append(" Actual is missing id-int entry for ").append(node.name()));
return builder.toString();
}
- private class CheckFinishedTask implements Runnable {
-
+ private final class CheckFinishedTask implements Runnable {
private final SettableFuture<Void> future;
CheckFinishedTask(final SettableFuture<Void> future) {
private final DOMRpcProviderService rpcProviderService;
private final String constant;
- private DOMRpcImplementationRegistration<SingletonGetConstantService> rpcRegistration;
+
+ private DOMRpcImplementationRegistration<SingletonGetConstantService> rpcRegistration = null;
private SingletonGetConstantService(final DOMRpcProviderService rpcProviderService, final String constant) {
this.rpcProviderService = rpcProviderService;
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>