@Test public void findServiceFunctionPathFromServiceChainName_noPaths() { stub(method(SfcProviderServicePathAPI.class, "readAllServiceFunctionPaths")).toReturn(null); final ServiceFunctionPath result = ServiceChainingUtil.findServiceFunctionPathFromServiceChainName(new SfcName(SFC_CHAIN_NAME)); assertNull(result); }
static ServiceFunctionPath findServiceFunctionPathFromServiceChainName(@Nonnull final SfcName chainName) { final ServiceFunctionPaths allPaths = SfcProviderServicePathAPI.readAllServiceFunctionPaths(); if (allPaths == null || allPaths.getServiceFunctionPath() == null || allPaths.getServiceFunctionPath().isEmpty()) { return null; } for (ServiceFunctionPath serviceFunctionPath : allPaths.getServiceFunctionPath()) { if (chainName.equals(serviceFunctionPath.getServiceChainName())) { return serviceFunctionPath; } } return null; }
ServiceChainingUtil { static ServiceFunctionPath findServiceFunctionPathFromServiceChainName(@Nonnull final SfcName chainName) { final ServiceFunctionPaths allPaths = SfcProviderServicePathAPI.readAllServiceFunctionPaths(); if (allPaths == null || allPaths.getServiceFunctionPath() == null || allPaths.getServiceFunctionPath().isEmpty()) { return null; } for (ServiceFunctionPath serviceFunctionPath : allPaths.getServiceFunctionPath()) { if (chainName.equals(serviceFunctionPath.getServiceChainName())) { return serviceFunctionPath; } } return null; } }
ServiceChainingUtil { static ServiceFunctionPath findServiceFunctionPathFromServiceChainName(@Nonnull final SfcName chainName) { final ServiceFunctionPaths allPaths = SfcProviderServicePathAPI.readAllServiceFunctionPaths(); if (allPaths == null || allPaths.getServiceFunctionPath() == null || allPaths.getServiceFunctionPath().isEmpty()) { return null; } for (ServiceFunctionPath serviceFunctionPath : allPaths.getServiceFunctionPath()) { if (chainName.equals(serviceFunctionPath.getServiceChainName())) { return serviceFunctionPath; } } return null; } private  ServiceChainingUtil(); }
ServiceChainingUtil { static ServiceFunctionPath findServiceFunctionPathFromServiceChainName(@Nonnull final SfcName chainName) { final ServiceFunctionPaths allPaths = SfcProviderServicePathAPI.readAllServiceFunctionPaths(); if (allPaths == null || allPaths.getServiceFunctionPath() == null || allPaths.getServiceFunctionPath().isEmpty()) { return null; } for (ServiceFunctionPath serviceFunctionPath : allPaths.getServiceFunctionPath()) { if (chainName.equals(serviceFunctionPath.getServiceChainName())) { return serviceFunctionPath; } } return null; } private  ServiceChainingUtil(); static boolean resolveRemoteSfcComponents(final RenderedServicePath renderedServicePath,
                                                      final PolicyConfigurationContext context); static RenderedServicePath resolveReversedRenderedServicePath(final ServiceFunctionPath sfp, final TenantId tenantId,
                                                                          final DataBroker dataBroker, final Sgt sourceSgt,
                                                                          final Sgt destinationSgt, final PolicyConfigurationContext context); @VisibleForTesting static void setTimeout(long value); }
ServiceChainingUtil { static ServiceFunctionPath findServiceFunctionPathFromServiceChainName(@Nonnull final SfcName chainName) { final ServiceFunctionPaths allPaths = SfcProviderServicePathAPI.readAllServiceFunctionPaths(); if (allPaths == null || allPaths.getServiceFunctionPath() == null || allPaths.getServiceFunctionPath().isEmpty()) { return null; } for (ServiceFunctionPath serviceFunctionPath : allPaths.getServiceFunctionPath()) { if (chainName.equals(serviceFunctionPath.getServiceChainName())) { return serviceFunctionPath; } } return null; } private  ServiceChainingUtil(); static boolean resolveRemoteSfcComponents(final RenderedServicePath renderedServicePath,
                                                      final PolicyConfigurationContext context); static RenderedServicePath resolveReversedRenderedServicePath(final ServiceFunctionPath sfp, final TenantId tenantId,
                                                                          final DataBroker dataBroker, final Sgt sourceSgt,
                                                                          final Sgt destinationSgt, final PolicyConfigurationContext context); @VisibleForTesting static void setTimeout(long value);  }