當前位置: 首頁>>代碼示例>>Java>>正文


Java NameUsageMatchingService類代碼示例

本文整理匯總了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);
  }
}
 
開發者ID:gbif,項目名稱:checklistbank,代碼行數:23,代碼來源:ChecklistBankWsClientModule.java

示例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);
}
 
開發者ID:gbif,項目名稱:checklistbank,代碼行數:11,代碼來源:NubMatchingModule.java

示例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));
  }
}
 
開發者ID:gbif,項目名稱:checklistbank,代碼行數:13,代碼來源:DeployedNubLookupCorrectnessTest.java

示例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;
}
 
開發者ID:gbif,項目名稱:occurrence,代碼行數:12,代碼來源:OccurrenceSearchImpl.java

示例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);
}
 
開發者ID:gbif,項目名稱:occurrence,代碼行數:11,代碼來源:OccurrenceSearchTestIT.java

示例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);
}
 
開發者ID:gbif,項目名稱:checklistbank,代碼行數:6,代碼來源:IdLookupWs.java

示例7: configure

import org.gbif.api.service.checklistbank.NameUsageMatchingService; //導入依賴的package包/類
@Override
protected void configure() {

  bind(NameUsageMatchingService.class).to(NubMatchingServiceImpl.class).asEagerSingleton();
  expose(NameUsageMatchingService.class);
}
 
開發者ID:gbif,項目名稱:checklistbank,代碼行數:7,代碼來源:NubMatchingTestModule.java

示例8: configure

import org.gbif.api.service.checklistbank.NameUsageMatchingService; //導入依賴的package包/類
@Override
protected void configure() {
  bind(NameUsageMatchingService.class).to(NameUsageMatchWsClient.class).in(Scopes.SINGLETON);
}
 
開發者ID:gbif,項目名稱:checklistbank,代碼行數:5,代碼來源:ChecklistBankWsMatchClientModule.java

示例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);
}
 
開發者ID:gbif,項目名稱:checklistbank,代碼行數:6,代碼來源:ChecklistBankWsClientModuleTest.java

示例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 + "]");
          }
        }
      }
    }
  }
 
開發者ID:gbif,項目名稱:checklistbank,代碼行數:47,代碼來源:DeployedNubLookupCorrectnessTest.java

示例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");
  }
 
開發者ID:gbif,項目名稱:checklistbank,代碼行數:14,代碼來源:NubMatchingServiceTestManual.java


注:本文中的org.gbif.api.service.checklistbank.NameUsageMatchingService類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。