@Override public Object getIdentifier() { return delegate.getIdentifier(); } }
@Override public void onFailure(final Throwable t) { LOG.error("Failed to initialize topology {} (transaction {}) by listener {}", AbstractTopologyBuilder.this.topology, trans.getIdentifier(), AbstractTopologyBuilder.this, t); } });
@Override public void onSuccess(Object o) { LOG.info("LacpAggregators updation write success for txt {}", write.getIdentifier()); } @Override
@Override public void onSuccess(Object o) { LOG.info("LacpAggregators deletion write success for txt {}", write.getIdentifier()); } @Override
@Override public void onSuccess(final Void result) { logger.trace("{}: Transaction({}) {} SUCCESSFUL", id, txType, transaction.getIdentifier()); }
@Override public void onSuccess(Object o) { log.debug("ConcurrentHashMap write successful for tx :{}", writeTx.getIdentifier()); }
@Override public void onFailure(final Throwable t) { logger.error("{}: Transaction({}) {} FAILED!", id, txType, transaction.getIdentifier(), t); throw new IllegalStateException(id + " Transaction(" + txType + ") not committed correctly", t); } });
@Override public void onFailure(final Throwable t) { logger.error("{}: Transaction({}) {} FAILED!", id, txType, transaction.getIdentifier(), t); throw new IllegalStateException(id + " Transaction(" + txType + ") not committed correctly", t); } });
@Override public void onFailure (Throwable throwable) { LOG.error("LacpNodeConnector updation write failed for tx {}", write.getIdentifier(), throwable.getCause()); } });
@Override public void onFailure(Throwable throwable) { LOG.error("LacpNode updation write failed for tx {}", write.getIdentifier(), throwable.getCause()); } });
@Override public void onFailure(Throwable throwable) { log.error("ConcurrentHashMap write transaction {} failed", writeTx.getIdentifier(), throwable.getCause()); } });
@Override public void onSuccess(final Void result) { LOG.debug("{}: Transaction({}) {} SUCCESSFUL", id.getValue(), txType, transaction.getIdentifier()); }
@Override public void onSuccess(final Void result) { LOG.trace("{}: Transaction({}) {} SUCCESSFUL", id.getValue(), txType, transaction.getIdentifier()); }
@Override public void onFailure(final Throwable t) { LOG.error("{}: Transaction({}) {} FAILED!", id.getValue(), txType, transaction.getIdentifier(), t); throw new IllegalStateException(id.getValue() + " Transaction(" + txType + ") not committed correctly", t); } });
private void removeDeviceConfigAndState() { final WriteTransaction transaction = txChain.newWriteOnlyTransaction(); logger.trace("{}: Close device state transaction {} removing all data started.", id, transaction.getIdentifier()); transaction.delete(LogicalDatastoreType.CONFIGURATION, id.getBindingPath()); transaction.delete(LogicalDatastoreType.OPERATIONAL, id.getBindingPath()); logger.trace("{}: Close device state transaction {} removing all data ended.", id, transaction.getIdentifier()); try { transaction.submit().get(); } catch (InterruptedException | ExecutionException e) { logger.error("{}: Transaction(close) {} FAILED!", id, transaction.getIdentifier(), e); throw new IllegalStateException(id + " Transaction(close) not committed correctly", e); } }
public void updateDeviceData(boolean up, NetconfDeviceCapabilities capabilities) { final Node data = buildDataForNetconfNode(up, capabilities); final WriteTransaction writeTx = txChain.newWriteOnlyTransaction(); logger.trace("{}: Update device state transaction {} merging operational data started.", id, writeTx.getIdentifier()); writeTx.put(LogicalDatastoreType.OPERATIONAL, id.getTopologyBindingPath(), data); logger.trace("{}: Update device state transaction {} merging operational data ended.", id, writeTx.getIdentifier()); commitTransaction(writeTx, "update"); }
private void createNetworkTopologyIfNotPresent(final WriteTransaction writeTx, final LogicalDatastoreType datastoreType) { final NetworkTopology networkTopology = new NetworkTopologyBuilder().build(); LOG.trace("{}: Merging {} container to ensure its presence", topologyId, NetworkTopology.QNAME, writeTx.getIdentifier()); writeTx.merge(datastoreType, networkTopologyPath, networkTopology); final Topology topology = new TopologyBuilder().setTopologyId(new TopologyId(topologyId)).build(); LOG.trace("{}: Merging {} container to ensure its presence", topologyId, Topology.QNAME, writeTx.getIdentifier()); writeTx.merge(datastoreType, topologyListPath, topology); } }
public void setDeviceAsFailed(Throwable throwable) { String reason = (throwable != null && throwable.getMessage() != null) ? throwable.getMessage() : UNKNOWN_REASON; final NetconfNode netconfNode = new NetconfNodeBuilder().setConnectionStatus(ConnectionStatus.UnableToConnect).setConnectedMessage(reason).build(); final Node data = getNodeIdBuilder(id).addAugmentation(NetconfNode.class, netconfNode).build(); final WriteTransaction writeTx = txChain.newWriteOnlyTransaction(); logger.trace("{}: Setting device state as failed {} putting operational data started.", id, writeTx.getIdentifier()); writeTx.put(LogicalDatastoreType.OPERATIONAL, id.getTopologyBindingPath(), data); logger.trace("{}: Setting device state as failed {} putting operational data ended.", id, writeTx.getIdentifier()); commitTransaction(writeTx, "update-failed-device"); }
private void createNetworkTopologyIfNotPresent(final WriteTransaction writeTx) { final NetworkTopology networkTopology = new NetworkTopologyBuilder().build(); logger.trace("{}: Merging {} container to ensure its presence", id, networkTopology.QNAME, writeTx.getIdentifier()); writeTx.merge(LogicalDatastoreType.CONFIGURATION, networkTopologyPath, networkTopology); writeTx.merge(LogicalDatastoreType.OPERATIONAL, networkTopologyPath, networkTopology); final Topology topology = new TopologyBuilder().setTopologyId(new TopologyId(TopologyNetconf.QNAME.getLocalName())).build(); logger.trace("{}: Merging {} container to ensure its presence", id, topology.QNAME, writeTx.getIdentifier()); writeTx.merge(LogicalDatastoreType.CONFIGURATION, topologyListPath, topology); writeTx.merge(LogicalDatastoreType.OPERATIONAL, topologyListPath, topology); }
private void createNodesListIfNotPresent(final WriteTransaction writeTx) { final Nodes nodes = new NodesBuilder().build(); final InstanceIdentifier<Nodes> path = InstanceIdentifier.builder(Nodes.class).build(); logger.trace("{}: Merging {} container to ensure its presence", id, Nodes.QNAME, writeTx.getIdentifier()); writeTx.merge(LogicalDatastoreType.CONFIGURATION, path, nodes); writeTx.merge(LogicalDatastoreType.OPERATIONAL, path, nodes); }