@Test public void testOnDelete() { when(rootNode.getModificationType()).thenReturn(DataObjectModification.ModificationType.DELETE); WriteTransaction wt = resetTransaction(); listener.onDataTreeChanged(changes); verify(listener).onDelete(rootNode, rootIdentifier); }
@Override protected void onDelete(DataObjectModification<ActionDefinition> rootNode, InstanceIdentifier<ActionDefinition> rootIdentifier) { ActionDefinition actionDefinitionBefore = checkNotNull(rootNode.getDataBefore()); Action ourAction = SubjectFeatures.getAction(actionDefinitionBefore.getId()); if (ourAction != null) { SupportedActionDefinitionKey supportedActionDefinitionKey = new SupportedActionDefinitionKey(ourAction.getId()); WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.OPERATIONAL, CAPABILITIES_IID.child(SupportedActionDefinition.class, supportedActionDefinitionKey)); Futures.addCallback(wTx.submit(), logDebugResult(supportedActionDefinitionKey, DELETED), MoreExecutors.directExecutor()); } }
ActionDefinitionListener extends DataTreeChangeHandler<ActionDefinition> { @Override protected void onDelete(DataObjectModification<ActionDefinition> rootNode, InstanceIdentifier<ActionDefinition> rootIdentifier) { ActionDefinition actionDefinitionBefore = checkNotNull(rootNode.getDataBefore()); Action ourAction = SubjectFeatures.getAction(actionDefinitionBefore.getId()); if (ourAction != null) { SupportedActionDefinitionKey supportedActionDefinitionKey = new SupportedActionDefinitionKey(ourAction.getId()); WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.OPERATIONAL, CAPABILITIES_IID.child(SupportedActionDefinition.class, supportedActionDefinitionKey)); Futures.addCallback(wTx.submit(), logDebugResult(supportedActionDefinitionKey, DELETED), MoreExecutors.directExecutor()); } } }
ActionDefinitionListener extends DataTreeChangeHandler<ActionDefinition> { @Override protected void onDelete(DataObjectModification<ActionDefinition> rootNode, InstanceIdentifier<ActionDefinition> rootIdentifier) { ActionDefinition actionDefinitionBefore = checkNotNull(rootNode.getDataBefore()); Action ourAction = SubjectFeatures.getAction(actionDefinitionBefore.getId()); if (ourAction != null) { SupportedActionDefinitionKey supportedActionDefinitionKey = new SupportedActionDefinitionKey(ourAction.getId()); WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.OPERATIONAL, CAPABILITIES_IID.child(SupportedActionDefinition.class, supportedActionDefinitionKey)); Futures.addCallback(wTx.submit(), logDebugResult(supportedActionDefinitionKey, DELETED), MoreExecutors.directExecutor()); } } ActionDefinitionListener(DataBroker dataBroker); }
ActionDefinitionListener extends DataTreeChangeHandler<ActionDefinition> { @Override protected void onDelete(DataObjectModification<ActionDefinition> rootNode, InstanceIdentifier<ActionDefinition> rootIdentifier) { ActionDefinition actionDefinitionBefore = checkNotNull(rootNode.getDataBefore()); Action ourAction = SubjectFeatures.getAction(actionDefinitionBefore.getId()); if (ourAction != null) { SupportedActionDefinitionKey supportedActionDefinitionKey = new SupportedActionDefinitionKey(ourAction.getId()); WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.OPERATIONAL, CAPABILITIES_IID.child(SupportedActionDefinition.class, supportedActionDefinitionKey)); Futures.addCallback(wTx.submit(), logDebugResult(supportedActionDefinitionKey, DELETED), MoreExecutors.directExecutor()); } } ActionDefinitionListener(DataBroker dataBroker);  }
ActionDefinitionListener extends DataTreeChangeHandler<ActionDefinition> { @Override protected void onDelete(DataObjectModification<ActionDefinition> rootNode, InstanceIdentifier<ActionDefinition> rootIdentifier) { ActionDefinition actionDefinitionBefore = checkNotNull(rootNode.getDataBefore()); Action ourAction = SubjectFeatures.getAction(actionDefinitionBefore.getId()); if (ourAction != null) { SupportedActionDefinitionKey supportedActionDefinitionKey = new SupportedActionDefinitionKey(ourAction.getId()); WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.OPERATIONAL, CAPABILITIES_IID.child(SupportedActionDefinition.class, supportedActionDefinitionKey)); Futures.addCallback(wTx.submit(), logDebugResult(supportedActionDefinitionKey, DELETED), MoreExecutors.directExecutor()); } } ActionDefinitionListener(DataBroker dataBroker);   }