@Test public void testOnServiceFunctionClassifierRemoved() throws Exception { ServiceFunctionClassifier serviceFunctionClassifier = buildServiceFunctionClassifier(); assertNull(SfcProviderAclAPI.readAccessListState(serviceFunctionClassifier.getAcl().getName(), serviceFunctionClassifier.getAcl().getType())); assertTrue(SfcProviderAclAPI.addClassifierToAccessListState(serviceFunctionClassifier.getAcl().getName(), serviceFunctionClassifier.getAcl().getType(), serviceFunctionClassifier.getName())); List<AclServiceFunctionClassifier> sfc = SfcProviderAclAPI.readAccessListState(serviceFunctionClassifier.getAcl().getName(), serviceFunctionClassifier.getAcl().getType()).getAclServiceFunctionClassifier(); assertTrue(sfc.get(0).getName().equals(SFC_NAME)); when(dataTreeModification.getRootNode()).thenReturn(dataObjectModification); when(dataObjectModification.getModificationType()).thenReturn(ModificationType.DELETE); when(dataObjectModification.getDataBefore()).thenReturn(serviceFunctionClassifier); collection.add(dataTreeModification); serviceFunctionClassifierListener.onDataTreeChanged(collection); Thread.sleep(500); assertEquals(SfcProviderAclAPI.readAccessListState(serviceFunctionClassifier.getAcl().getName(), serviceFunctionClassifier.getAcl().getType()).getAclServiceFunctionClassifier().size(),0); }
@Override protected void add(ServiceFunctionClassifier serviceFunctionClassifier) { if (serviceFunctionClassifier != null) { LOG.debug("Adding Service Function Classifier: {}", serviceFunctionClassifier.getName()); if (serviceFunctionClassifier.getName() != null && serviceFunctionClassifier.getAcl() != null) { SfcProviderAclAPI.addClassifierToAccessListState(serviceFunctionClassifier.getAcl().getName(), serviceFunctionClassifier.getAcl().getType(), serviceFunctionClassifier.getName()); } } }
ServiceFunctionClassifierListener extends AbstractDataTreeChangeListener<ServiceFunctionClassifier> { @Override protected void add(ServiceFunctionClassifier serviceFunctionClassifier) { if (serviceFunctionClassifier != null) { LOG.debug("Adding Service Function Classifier: {}", serviceFunctionClassifier.getName()); if (serviceFunctionClassifier.getName() != null && serviceFunctionClassifier.getAcl() != null) { SfcProviderAclAPI.addClassifierToAccessListState(serviceFunctionClassifier.getAcl().getName(), serviceFunctionClassifier.getAcl().getType(), serviceFunctionClassifier.getName()); } } } }
ServiceFunctionClassifierListener extends AbstractDataTreeChangeListener<ServiceFunctionClassifier> { @Override protected void add(ServiceFunctionClassifier serviceFunctionClassifier) { if (serviceFunctionClassifier != null) { LOG.debug("Adding Service Function Classifier: {}", serviceFunctionClassifier.getName()); if (serviceFunctionClassifier.getName() != null && serviceFunctionClassifier.getAcl() != null) { SfcProviderAclAPI.addClassifierToAccessListState(serviceFunctionClassifier.getAcl().getName(), serviceFunctionClassifier.getAcl().getType(), serviceFunctionClassifier.getName()); } } } ServiceFunctionClassifierListener(final DataBroker dataBroker); }
ServiceFunctionClassifierListener extends AbstractDataTreeChangeListener<ServiceFunctionClassifier> { @Override protected void add(ServiceFunctionClassifier serviceFunctionClassifier) { if (serviceFunctionClassifier != null) { LOG.debug("Adding Service Function Classifier: {}", serviceFunctionClassifier.getName()); if (serviceFunctionClassifier.getName() != null && serviceFunctionClassifier.getAcl() != null) { SfcProviderAclAPI.addClassifierToAccessListState(serviceFunctionClassifier.getAcl().getName(), serviceFunctionClassifier.getAcl().getType(), serviceFunctionClassifier.getName()); } } } ServiceFunctionClassifierListener(final DataBroker dataBroker); void init(); @Override void close(); }
ServiceFunctionClassifierListener extends AbstractDataTreeChangeListener<ServiceFunctionClassifier> { @Override protected void add(ServiceFunctionClassifier serviceFunctionClassifier) { if (serviceFunctionClassifier != null) { LOG.debug("Adding Service Function Classifier: {}", serviceFunctionClassifier.getName()); if (serviceFunctionClassifier.getName() != null && serviceFunctionClassifier.getAcl() != null) { SfcProviderAclAPI.addClassifierToAccessListState(serviceFunctionClassifier.getAcl().getName(), serviceFunctionClassifier.getAcl().getType(), serviceFunctionClassifier.getName()); } } } ServiceFunctionClassifierListener(final DataBroker dataBroker); void init(); @Override void close();  }