@Test public void testOnServiceFunctionRemoved() throws Exception { ServiceFunction serviceFunction = build_service_function(); assertTrue(SfcProviderServiceTypeAPI.createServiceFunctionTypeEntry(serviceFunction)); when(dataTreeModification.getRootNode()).thenReturn(dataObjectModification); when(dataObjectModification.getModificationType()).thenReturn(ModificationType.DELETE); when(dataObjectModification.getDataBefore()).thenReturn(serviceFunction); collection.add(dataTreeModification); serviceFunctionListener.onDataTreeChanged(collection); Thread.sleep(500); assertNull(SfcProviderServiceTypeAPI.readServiceFunctionTypeEntry(serviceFunction)); }
@Override public void add(ServiceFunction serviceFunction) { if (serviceFunction != null) { LOG.debug("Adding Service Function: {}", serviceFunction.getName()); if (!SfcProviderServiceTypeAPI.createServiceFunctionTypeEntry(serviceFunction)) { LOG.error("Failed to create Service Function: ", serviceFunction.getName()); } } }
ServiceFunctionListener extends AbstractDataTreeChangeListener<ServiceFunction> { @Override public void add(ServiceFunction serviceFunction) { if (serviceFunction != null) { LOG.debug("Adding Service Function: {}", serviceFunction.getName()); if (!SfcProviderServiceTypeAPI.createServiceFunctionTypeEntry(serviceFunction)) { LOG.error("Failed to create Service Function: ", serviceFunction.getName()); } } } }
ServiceFunctionListener extends AbstractDataTreeChangeListener<ServiceFunction> { @Override public void add(ServiceFunction serviceFunction) { if (serviceFunction != null) { LOG.debug("Adding Service Function: {}", serviceFunction.getName()); if (!SfcProviderServiceTypeAPI.createServiceFunctionTypeEntry(serviceFunction)) { LOG.error("Failed to create Service Function: ", serviceFunction.getName()); } } } ServiceFunctionListener(final DataBroker dataBroker); }
ServiceFunctionListener extends AbstractDataTreeChangeListener<ServiceFunction> { @Override public void add(ServiceFunction serviceFunction) { if (serviceFunction != null) { LOG.debug("Adding Service Function: {}", serviceFunction.getName()); if (!SfcProviderServiceTypeAPI.createServiceFunctionTypeEntry(serviceFunction)) { LOG.error("Failed to create Service Function: ", serviceFunction.getName()); } } } ServiceFunctionListener(final DataBroker dataBroker); void init(); @Override void close(); @Override void add(ServiceFunction serviceFunction); @Override void remove(ServiceFunction serviceFunction); }
ServiceFunctionListener extends AbstractDataTreeChangeListener<ServiceFunction> { @Override public void add(ServiceFunction serviceFunction) { if (serviceFunction != null) { LOG.debug("Adding Service Function: {}", serviceFunction.getName()); if (!SfcProviderServiceTypeAPI.createServiceFunctionTypeEntry(serviceFunction)) { LOG.error("Failed to create Service Function: ", serviceFunction.getName()); } } } ServiceFunctionListener(final DataBroker dataBroker); void init(); @Override void close(); @Override void add(ServiceFunction serviceFunction); @Override void remove(ServiceFunction serviceFunction);  }