X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fstatistics-manager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fstatistics%2Fmanager%2Fimpl%2FStatAbstractNotifyCommit.java;h=3f0e5e430e5db9c8c72098241e2d6e6fa513812f;hp=08871e99806c7b51be2480f40b2d50914d96c0f9;hb=f8670b417a2296050152faafe4157705ad2e085d;hpb=531621aac4cff9d39cbd8668a53bdeba8a0e6d81 diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatAbstractNotifyCommit.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatAbstractNotifyCommit.java index 08871e9980..3f0e5e430e 100644 --- a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatAbstractNotifyCommit.java +++ b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatAbstractNotifyCommit.java @@ -84,9 +84,9 @@ public abstract class StatAbstractNotifyCommit i return manager.isProvidedFlowNodeActive(nodeIdent); } - protected void notifyToCollectNextStatistics(final InstanceIdentifier nodeIdent) { + protected void notifyToCollectNextStatistics(final InstanceIdentifier nodeIdent, final TransactionId xid) { Preconditions.checkNotNull(nodeIdent, "FlowCapableNode ident can not be null!"); - manager.collectNextStatistics(nodeIdent); + manager.collectNextStatistics(nodeIdent, xid); } /** @@ -110,6 +110,29 @@ public abstract class StatAbstractNotifyCommit i return txContainer; } + /** + * Method validate TransactionCacheContainer. It needs to call before every txCacheContainer processing. + * + * @param txCacheContainer + * @return + */ + protected boolean isTransactionCacheContainerValid(final Optional> txCacheContainer) { + if ( ! txCacheContainer.isPresent()) { + LOG.debug("Transaction Cache Container is not presented!"); + return false; + } + if (txCacheContainer.get().getNodeId() == null) { + LOG.debug("Transaction Cache Container {} don't have Node ID!", txCacheContainer.get().getId()); + return false; + } + if (txCacheContainer.get().getNotifications() == null) { + LOG.debug("Transaction Cache Container {} for {} node don't have Notifications!", + txCacheContainer.get().getId(), txCacheContainer.get().getNodeId()); + return false; + } + return true; + } + /** * Wrapping Future object call to {@link org.opendaylight.controller.md.statistics.manager.StatRpcMsgManager} * isExpectedStatistics with 10sec TimeOut.