本文整理汇总了Java中org.gbif.api.service.checklistbank.NameUsageMatchingService类的典型用法代码示例。如果您正苦于以下问题:Java NameUsageMatchingService类的具体用法?Java NameUsageMatchingService怎么用?Java NameUsageMatchingService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NameUsageMatchingService类属于org.gbif.api.service.checklistbank包,在下文中一共展示了NameUsageMatchingService类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureClient
import org.gbif.api.service.checklistbank.NameUsageMatchingService; //导入依赖的package包/类
@Override
protected void configureClient() {
// install the 2 private modules that together implement the API
if (installServiceClients) {
install(new ChecklistBankWsServiceClientModule());
expose(NameUsageSearchService.class);
expose(NameUsageService.class);
expose(DescriptionService.class);
expose(DistributionService.class);
expose(IdentifierService.class);
expose(MultimediaService.class);
expose(ReferenceService.class);
expose(SpeciesProfileService.class);
expose(TypeSpecimenService.class);
expose(VernacularNameService.class);
expose(DatasetMetricsService.class);
}
if (installMatchClients) {
install(new ChecklistBankWsMatchClientModule());
expose(NameUsageMatchingService.class);
}
}
示例2: configure
import org.gbif.api.service.checklistbank.NameUsageMatchingService; //导入依赖的package包/类
@Override
protected void configure() {
bind(NubMatchingServiceImpl.class).asEagerSingleton();
bind(NameUsageMatchingService.class).to(NubMatchingServiceImpl.class);
bind(NameUsageMatchingService2.class).to(NubMatchingServiceImpl.class);
expose(NameUsageMatchingService.class);
expose(NameUsageMatchingService2.class);
}
示例3: DeployedNubLookupCorrectnessTest
import org.gbif.api.service.checklistbank.NameUsageMatchingService; //导入依赖的package包/类
public DeployedNubLookupCorrectnessTest() {
final String wsProp = "checklistbank.match.ws.url";
for (String url : WS_URLS) {
Properties props = new Properties();
props.setProperty(wsProp, url);
ChecklistBankWsClientModule mod = new ChecklistBankWsClientModule(props, false, true);
Injector injector = Guice.createInjector(mod);
CLIENTS.add(injector.getInstance(NameUsageMatchingService.class));
}
}
示例4: OccurrenceSearchImpl
import org.gbif.api.service.checklistbank.NameUsageMatchingService; //导入依赖的package包/类
@Inject
public OccurrenceSearchImpl(SolrClient solrClient, @Named(SOLR_REQUEST_HANDLER) String requestHandler,
OccurrenceService occurrenceService, NameUsageMatchingService nameUsageMatchingService,
@Named("max.offset") int maxOffset, @Named("max.limit") int maxLimit,
@Named("facets.enable") boolean facetsEnable) {
this.solrClient = solrClient;
occurrenceSearchRequestBuilder = new OccurrenceSearchRequestBuilder(requestHandler, SORT_ORDER,
maxOffset, maxLimit, facetsEnable);
this.occurrenceService = occurrenceService;
this.nameUsageMatchingService = nameUsageMatchingService;
}
示例5: configureService
import org.gbif.api.service.checklistbank.NameUsageMatchingService; //导入依赖的package包/类
@Override
protected void configureService() {
install(new SolrModule(solrConfig));
bind(NameUsageMatchingService.class).toInstance(Mockito.mock(NameUsageMatchingService.class));
bind(OccurrenceSearchService.class).to(OccurrenceSearchImpl.class);
expose(OccurrenceSearchService.class);
// Exposes the SolrClient because it is required to create the index.
expose(SolrClient.class);
}
示例6: IdLookupWs
import org.gbif.api.service.checklistbank.NameUsageMatchingService; //导入依赖的package包/类
public IdLookupWs(Properties props) {
ChecklistBankWsClientModule module = new ChecklistBankWsClientModule(props, false, true);
Injector inj = Guice.createInjector(module);
service = inj.getInstance(NameUsageMatchingService.class);
}
示例7: configure
import org.gbif.api.service.checklistbank.NameUsageMatchingService; //导入依赖的package包/类
@Override
protected void configure() {
bind(NameUsageMatchingService.class).to(NubMatchingServiceImpl.class).asEagerSingleton();
expose(NameUsageMatchingService.class);
}
示例8: configure
import org.gbif.api.service.checklistbank.NameUsageMatchingService; //导入依赖的package包/类
@Override
protected void configure() {
bind(NameUsageMatchingService.class).to(NameUsageMatchWsClient.class).in(Scopes.SINGLETON);
}
示例9: testMatchingModule
import org.gbif.api.service.checklistbank.NameUsageMatchingService; //导入依赖的package包/类
@Test
public void testMatchingModule() {
Injector inj = Guice.createInjector(new ChecklistBankWsClientModule(properties, false, true));
inj.getInstance(NameUsageMatchingService.class);
}
示例10: testQuery
import org.gbif.api.service.checklistbank.NameUsageMatchingService; //导入依赖的package包/类
private void testQuery(Integer targetNubId, LinneanClassification cl, String scientificName, String authorship, Rank rank) {
List<NameUsageMatch> results = Lists.newArrayList();
for (NameUsageMatchingService client : CLIENTS) {
NameUsageMatch lookup = null;
try {
lookup = client.match(scientificName, rank, cl, false, true);
results.add(lookup);
boolean gotMatch;
if (targetNubId == null) {
gotMatch = lookup.getUsageKey() == null;
} else {
gotMatch = lookup.getUsageKey() != null && lookup.getUsageKey().equals(targetNubId);
}
if (rank != null && rank.isSuprageneric()){
if (lookup.getSpeciesKey()!=null || lookup.getSpecies()!=null){
System.err.println(
"Lookup for "+rank.name()+" [" + scientificName +"] contains non null species "+lookup.getSpecies()+" [" + lookup.getSpeciesKey() + "]");
}
}
if (gotMatch) {
System.out.println(
"Lookup good for sciName [" + scientificName + "] nubID [" + targetNubId + "] - " + client.toString());
} else {
System.err.println(
"Lookup mismatch for sciName [" + scientificName +"] - wanted [" + targetNubId + "], got [" + (lookup == null ? null : lookup.getUsageKey()) + "] - [" + client.toString() + "]");
}
} catch (Exception e) {
System.err.println("Webservice ERROR: " + e.getMessage());
}
}
for (NameUsageMatch outer : results) {
if (outer==null) continue;
for (NameUsageMatch inner : results) {
if (inner == null) continue;
if (System.identityHashCode(outer) != System.identityHashCode(inner)) {
if (!equalLookups(outer, inner)) {
System.err.println("Results are different from different servers for sciName [" + scientificName + "]");
}
}
}
}
}
示例11: NubMatchingServiceTestManual
import org.gbif.api.service.checklistbank.NameUsageMatchingService; //导入依赖的package包/类
public NubMatchingServiceTestManual() throws IOException {
LOG.info("Load clb properties");
Properties properties = PropertiesUtil.loadProperties("checklistbank.properties");
LOG.info("Create guice injector");
Injector inj = Guice.createInjector(new ChecklistBankServiceMyBatisModule(properties), new NubMatchingModule());
LOG.info("Create matching service");
matcher = inj.getInstance(NameUsageMatchingService.class);
LOG.info("Nub Matching setup complete");
}