Пример #1
0
  @Bean
  ContentBootstrapper mongoBootstrapper() {
    ContentListingCriteria.Builder criteriaBuilder =
        defaultCriteria()
            .forPublishers(
                ImmutableSet.<Publisher>builder()
                    .add(Publisher.PA)
                    .addAll(Publisher.all())
                    .build()
                    .asList())
            .forContent(ImmutableSet.of(ContentCategory.CONTAINER, ContentCategory.TOP_LEVEL_ITEM));

    ContentBootstrapper.BuildStep bootstrapperBuilder =
        ContentBootstrapper.builder()
            .withTaskName("owl-search-bootstrap-mongo")
            .withProgressStore(progressStore())
            .withContentLister(new MongoContentLister(mongo(), contentResolver()))
            .withCriteriaBuilder(criteriaBuilder);

    if (Boolean.valueOf(enablePeople)) {
      LookupEntryStore entryStore =
          new MongoLookupEntryStore(
              mongo().collection("peopleLookup"), new DummyPersistenceAuditLog(), readPreference());
      MongoPersonStore personStore =
          new MongoPersonStore(
              mongo(),
              TransitiveLookupWriter.explicitTransitiveLookupWriter(entryStore),
              entryStore,
              new DummyPersistenceAuditLog());
      bootstrapperBuilder.withPeopleLister(personStore);
    }

    return bootstrapperBuilder.build();
  }
Пример #2
0
 @Bean
 ContentBootstrapper cassandraBootstrapper() {
   return ContentBootstrapper.builder()
       .withTaskName("owl-search-bootstrap-cassandra")
       .withProgressStore(progressStore())
       .withContentLister(cassandra())
       .build();
 }
Пример #3
0
  @Bean
  ContentBootstrapper musicBootstrapper() {
    List<Publisher> musicPublishers =
        ImmutableList.of(
            Publisher.BBC_MUSIC,
            Publisher.SPOTIFY,
            Publisher.YOUTUBE,
            Publisher.RDIO,
            Publisher.SOUNDCLOUD,
            Publisher.AMAZON_UK,
            Publisher.ITUNES);

    ContentListingCriteria.Builder criteriaBuilder =
        defaultCriteria().forContent(ContentCategory.TOP_LEVEL_ITEM).forPublishers(musicPublishers);

    return ContentBootstrapper.builder()
        .withTaskName("owl-search-bootstrap-music")
        .withProgressStore(progressStore())
        .withContentLister(new MongoContentLister(mongo(), contentResolver()))
        .withCriteriaBuilder(criteriaBuilder)
        .build();
  }