@Test public void testFindConfigurationWithModel() { DesaConfiguration result = desaServices.findConfigurationWithModel("unknown", "model:id1"); assertNotNull(result); assertEquals("ds1", result.getServiceId()); result = desaServices.findConfigurationWithModel("unknown"); assertNull(result); }
public DesaConfiguration findConfigurationWithModel(String... modelIds) { for (String sid : config.getStringArray(PROPERTY_DESASERVICES)) { DesaConfiguration dc = readConfiguration(config, sid); List<String> exportModels = dc.getExportModels(); for (String modelId : modelIds) { if (exportModels.contains(modelId)) { return dc; } } } return null; }
DesaServices { public DesaConfiguration findConfigurationWithModel(String... modelIds) { for (String sid : config.getStringArray(PROPERTY_DESASERVICES)) { DesaConfiguration dc = readConfiguration(config, sid); List<String> exportModels = dc.getExportModels(); for (String modelId : modelIds) { if (exportModels.contains(modelId)) { return dc; } } } return null; } }
DesaServices { public DesaConfiguration findConfigurationWithModel(String... modelIds) { for (String sid : config.getStringArray(PROPERTY_DESASERVICES)) { DesaConfiguration dc = readConfiguration(config, sid); List<String> exportModels = dc.getExportModels(); for (String modelId : modelIds) { if (exportModels.contains(modelId)) { return dc; } } } return null; } DesaServices(Configuration config); }
DesaServices { public DesaConfiguration findConfigurationWithModel(String... modelIds) { for (String sid : config.getStringArray(PROPERTY_DESASERVICES)) { DesaConfiguration dc = readConfiguration(config, sid); List<String> exportModels = dc.getExportModels(); for (String modelId : modelIds) { if (exportModels.contains(modelId)) { return dc; } } } return null; } DesaServices(Configuration config); List<ValueMap> getValueMap(Nomenclatures n, String pluginId); Nomenclatures getNomenclatures(DesaConfiguration dc, UserProfile user); DesaClient getDesaClient(DesaConfiguration dc); String getOperatorName(UserProfile operator, DesaConfiguration dc); String getProducerCode(UserProfile operator, DesaConfiguration dc); DesaConfiguration findConfiguration(MetaModel model); DesaConfiguration findConfiguration(String serviceId); DesaConfiguration findConfigurationWithModel(String... modelIds); List<DesaConfiguration> getConfigurations(); }
DesaServices { public DesaConfiguration findConfigurationWithModel(String... modelIds) { for (String sid : config.getStringArray(PROPERTY_DESASERVICES)) { DesaConfiguration dc = readConfiguration(config, sid); List<String> exportModels = dc.getExportModels(); for (String modelId : modelIds) { if (exportModels.contains(modelId)) { return dc; } } } return null; } DesaServices(Configuration config); List<ValueMap> getValueMap(Nomenclatures n, String pluginId); Nomenclatures getNomenclatures(DesaConfiguration dc, UserProfile user); DesaClient getDesaClient(DesaConfiguration dc); String getOperatorName(UserProfile operator, DesaConfiguration dc); String getProducerCode(UserProfile operator, DesaConfiguration dc); DesaConfiguration findConfiguration(MetaModel model); DesaConfiguration findConfiguration(String serviceId); DesaConfiguration findConfigurationWithModel(String... modelIds); List<DesaConfiguration> getConfigurations(); static final String PROPERTY_DESASERVICES; static final String PREFIX_DESA; static final String REMOTE_USER_TYPE; }