• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DocIdPusher类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.enterprise.adaptor.DocIdPusher的典型用法代码示例。如果您正苦于以下问题:Java DocIdPusher类的具体用法?Java DocIdPusher怎么用?Java DocIdPusher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DocIdPusher类属于com.google.enterprise.adaptor包,在下文中一共展示了DocIdPusher类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getDocIds

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
/** Crawls/pushes all groups from all AdServers. */

  @Override
  public void getDocIds(DocIdPusher pusher) throws InterruptedException,
      IOException {
    log.log(Level.FINER, "getDocIds invoked - waiting for lock.");
    mutex.lock();
    try {
      clearLastCompleteGroupCatalog();
      GroupCatalog cumulativeCatalog = makeFullCatalog();
      // all servers were able to successfully populate the catalog: do a push
      // TODO(myk): Rework the structure so that a member variable of
      // cumulativeCatalog isn't passed in as a parameter to its own method.
      cumulativeCatalog.resolveForeignSecurityPrincipals(
          cumulativeCatalog.entities);
      Map<GroupPrincipal, List<Principal>> groups =
          cumulativeCatalog.makeDefs(cumulativeCatalog.entities);
      pusher.pushGroupDefinitions(groups, EVERYTHING_CASE_INSENSITIVE, REPLACE,
          null, null);
      // no longer clear cumulativeCatalog.members as part of fix for b/18028678
      lastCompleteGroupCatalog = cumulativeCatalog;
    } finally {
      mutex.unlock();
      log.log(Level.FINE, "getDocIds ending - lock released.");
    }
  }
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:27,代码来源:AdAdaptor.java


示例2: getModifiedDocIds

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
/**
 * Attempts an incremental push of updated groups from all AdServers.
 * <p>
 * When a server cannot do an incremental push, it does a full crawl without
 * doing a push afterwards -- this sets up its state so that subsequent
 * incremental pushes can work.
 */
@Override
public void getModifiedDocIds(DocIdPusher pusher) throws InterruptedException,
    IOException {
  if (!mutex.tryLock()) {
    log.log(Level.FINE, "getModifiedDocIds could not acquire lock; "
        + "will retry later.");
    return;
  }
  try {
    log.log(Level.FINE, "getModifiedDocIds starting - acquired lock.");
    getModifiedDocIdsHelper(pusher);
  } finally {
    mutex.unlock();
    log.log(Level.FINE, "getModifiedDocIds ending - lock released.");
  }
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:24,代码来源:AdAdaptor.java


示例3: getDocIdsSiteCollectionOnly

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
private void getDocIdsSiteCollectionOnly(DocIdPusher pusher)
    throws InterruptedException,IOException {
  log.entering("SharePointAdaptor", "getDocIdsSiteCollectionOnly", pusher);
  SiteAdaptor scAdaptor = getSiteAdaptor(sharePointUrl.getSharePointUrl(), 
      sharePointUrl.getSharePointUrl());
  SiteDataClient scClient = scAdaptor.getSiteDataClient();
  Site site = scClient.getContentSite();
  String siteCollectionUrl = getCanonicalUrl(site.getMetadata().getURL());
  // Reset site collection URL instance to use correct URL.
  scAdaptor = getSiteAdaptor(siteCollectionUrl, siteCollectionUrl);
  DocId siteCollectionDocId = scAdaptor.encodeDocId(siteCollectionUrl);
  pusher.pushDocIds(Arrays.asList(siteCollectionDocId));
  Map<GroupPrincipal, Collection<Principal>> groupDefs 
      = new HashMap<GroupPrincipal, Collection<Principal>>();
  groupDefs.putAll(scAdaptor.computeMembersForGroups(site.getGroups()));
  String siteId = site.getMetadata().getID();
  sitePushGroupDefinitions(siteId, pusher, groupDefs);
  log.exiting("SharePointAdaptor", "getDocIdsSiteCollectionOnly");
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:20,代码来源:SharePointAdaptor.java


示例4: testOverflowToDocIdPusher

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
@Test
public void testOverflowToDocIdPusher() throws Exception {
  final String golden = "<!DOCTYPE html>\n"
      + "<html><head><title>s</title></head>"
      + "<body><h1><!--googleoff: index-->Site<!--googleon: index--> s</h1>"
      + "<p><!--googleoff: index-->Lists<!--googleon: index--></p>"
      + "<ul><li><a href=\"s/l\">My List</a></li></ul>"
      + "</body></html>";
  final List<DocIdPusher.Record> goldenRecords = Arrays.asList(
      new DocIdPusher.Record.Builder(new DocId("s/l")).build());
  RecordingDocIdPusher docIdPusher = new RecordingDocIdPusher();
  writer = new HtmlResponseWriter(baos, charset,
      context.getDocIdEncoder(), Locale.ENGLISH, 1, docIdPusher,
      executor);
  writer.start(new DocId("s"), ObjectType.SITE, null);
  writer.startSection(ObjectType.LIST);
  writer.addLink(new DocId("s/l"), "My List");
  writer.finish();
  assertEquals(golden, new String(baos.toByteArray(), charset));
  assertEquals(goldenRecords, docIdPusher.getRecords());
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:22,代码来源:HtmlResponseWriterTest.java


示例5: pushCollection

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
@Override
protected Checkpoint pushCollection(DocIdPusher pusher)
    throws InterruptedException {
  FeedType feedType;
  if ((queryBatchSize > 0) || caughtException || prevError) {
    feedType = FeedType.INCREMENTAL;
  } else {
    feedType = this.feedType;
  }

  Map<GroupPrincipal, Collection<Principal>> groupDefs = groups.build();
  pusher.pushGroupDefinitions(groupDefs,
      caseSensitivityType == CaseSensitivityType.EVERYTHING_CASE_SENSITIVE,
      feedType, null, null);
  // If we caught an exception, then the next push will also be incomplete,
  // else (modulo batching) we finished sending all the groups, and the
  // next push can be full again.
  prevError = caughtException;
  return groupsCheckpoint;
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:21,代码来源:DocumentumAdaptor.java


示例6: getModifiedDocIdsHelper

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
@VisibleForTesting
void getModifiedDocIdsHelper(DocIdPusher pusher) throws InterruptedException,
    IOException {
  if (lastCompleteGroupCatalog == null) {
    log.log(Level.FINE, "getModifiedDocIds doing a fetch with no push.");
    lastCompleteGroupCatalog = makeFullCatalog();
    return;
  }

  Set<AdEntity> allNewOrUpdatedEntities = new HashSet<AdEntity>();
  for (AdServer server : servers) {
    String previousServiceName = server.getDsServiceName();
    String previousInvocationId = server.getInvocationID();
    long previousHighestUSN = server.getHighestCommittedUSN();
    try {
      server.ensureConnectionIsCurrent();
      allNewOrUpdatedEntities.addAll(
          lastCompleteGroupCatalog.readUpdatesFrom(server,
              previousServiceName, previousInvocationId,
              previousHighestUSN));
    } catch (NamingException ne) {
      // invalidate the saved group catalog
      clearLastCompleteGroupCatalog();
      String host = server.getHostName();
      throw new IOException("could not get entities from " + host, ne);
    }
  }

  // all servers were able to successfully update the catalog: do a push
  lastCompleteGroupCatalog.resolveForeignSecurityPrincipals(
      allNewOrUpdatedEntities);
  Map<GroupPrincipal, List<Principal>> groups =
      lastCompleteGroupCatalog.makeDefs(allNewOrUpdatedEntities);
  pusher.pushGroupDefinitions(groups, EVERYTHING_CASE_INSENSITIVE,
      INCREMENTAL, null, null);
  // no longer clear cumulativeCatalog.members as part of fix for b/18028678
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:38,代码来源:AdAdaptor.java


示例7: pushGroupDefinitions

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
public static void pushGroupDefinitions(AdAdaptor adaptor,
    Map<String, String> configEntries, final DocIdPusher pusher,
    boolean fullPush, boolean init) throws Exception {
  if (init) {
    initializeAdaptorConfig(adaptor, configEntries);
  }
  if (fullPush) {
    adaptor.getDocIds(pusher);
  } else {
    adaptor.getModifiedDocIds(pusher);
  }
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:13,代码来源:AdAdaptorTest.java


示例8: getDocIds

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
/** Crawls/pushes ids of all people from all LDAP Servers. */
@Override
public void getDocIds(DocIdPusher pusher) throws InterruptedException,
    IOException {
  log.entering("LdapAdaptor", "getDocIds");
  String badHosts = ""; // built up as we run into errors
  NamingException lastException = null;
  for (int serverNumber = 0; serverNumber < servers.size(); serverNumber++) {
    LdapServer server = servers.get(serverNumber);
    try {
      server.ensureConnectionIsCurrent();
      Set<LdapPerson> entities = server.scanAll();
      ArrayList<DocId> docIds = new ArrayList<DocId>();
      log.fine("received " + entities.size() + " entities from server");
      for (LdapPerson person : entities) {
        docIds.add(makeDocId(serverNumber, person.getDn()));
      }
      log.fine("About to push " + docIds.size() + " docIds for host "
          + server.getHostName() + "");
      pusher.pushDocIds(docIds);
      log.finer("Done with push of " + docIds.size() + " docIds for host "
          + server.getHostName() + "");
    } catch (NamingException ne) {
      String host = server.getHostName();
      badHosts += "," + host;
      lastException = ne;
      log.log(Level.WARNING, "Could not get entitites from " + host + "", ne);
      continue; // just log for now; throw exception at very end.
    }
  }
  log.exiting("LdapAdaptor", "getDocIds", (lastException != null));
  if (lastException != null) {
    throw new IOException("Could not get entities from the following "
        + "server(s): " + badHosts.substring(1) + "", lastException);
  }
}
 
开发者ID:googlegsa,项目名称:ldap,代码行数:37,代码来源:LdapAdaptor.java


示例9: pushGroupDefinitions

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
public static void pushGroupDefinitions(LdapAdaptor adaptor,
    Map<String, String> configEntries, final DocIdPusher pusher,
    boolean fullPush, boolean init) throws Exception {
  if (init) {
    initializeAdaptorConfig(adaptor, configEntries);
  }
  if (fullPush) {
    adaptor.getDocIds(pusher);
  } else {
    // adaptor.getModifiedDocIds(pusher);
    throw new IllegalArgumentException("Incremental Push not implemented");
  }
}
 
开发者ID:googlegsa,项目名称:ldap,代码行数:14,代码来源:LdapAdaptorTest.java


示例10: getDocIds

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
@Override
public void getDocIds(DocIdPusher pusher) throws InterruptedException,
    IOException {
  log.entering("SharePointAdaptor", "getDocIds", pusher);
  if (sharePointUrl.isSiteCollectionUrl()) {
    getDocIdsSiteCollectionOnly(pusher);
  } else {
    getDocIdsVirtualServer(pusher);
  } 
  log.exiting("SharePointAdaptor", "getDocIds");
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:12,代码来源:SharePointAdaptor.java


示例11: sitePushGroupDefinitions

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
private void sitePushGroupDefinitions(String siteId, DocIdPusher pusher,
    Map<GroupPrincipal, Collection<Principal>> groupDefs)
    throws InterruptedException {
  String sourceId = "SITEID-" + siteId.replaceAll("[{}]", "");
  pusher.pushGroupDefinitions(groupDefs, EVERYTHING_CASE_INSENSITIVE,
      REPLACE, sourceId, null);
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:8,代码来源:SharePointAdaptor.java


示例12: getModifiedDocIds

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
@Override
public void getModifiedDocIds(DocIdPusher pusher)
    throws InterruptedException {
  log.entering("SharePointAdaptor", "getModifiedDocIds", pusher);
  if (sharePointUrl.isSiteCollectionUrl()) {
    getModifiedDocIdsSiteCollection(pusher);
  } else {
    getModifiedDocIdsVirtualServer(pusher);
  }    
  log.exiting("SharePointAdaptor", "getModifiedDocIds", pusher);
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:12,代码来源:SharePointAdaptor.java


示例13: pushIncrementalUpdatesAndGroups

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
private void pushIncrementalUpdatesAndGroups(DocIdPusher pusher, 
  SiteAdaptor siteAdaptor, Set<DocId> docIds,
  Set<String> updatedSiteSecurity) throws InterruptedException {
  List<DocIdPusher.Record> records
      = new ArrayList<DocIdPusher.Record>(docIds.size());
  DocIdPusher.Record.Builder builder
      = new DocIdPusher.Record.Builder(new DocId("to-be-replaced-name"))
      .setCrawlImmediately(true);
  for (DocId docId : docIds) {
    records.add(builder.setDocId(docId).build());
  }
  pusher.pushRecords(records);
  if (updatedSiteSecurity.isEmpty()) {
    return;
  }
  for (String siteUrl : updatedSiteSecurity) {
    Site site;
    try {
      site = getSiteAdaptor(siteUrl, siteUrl).getSiteDataClient()
          .getContentSite();
    } catch (IOException ex) {
      log.log(Level.WARNING, "Failed to get local groups for site: "
          + siteUrl, ex);
      continue;
    }
    Map<GroupPrincipal, Collection<Principal>> groupDefs
        = siteAdaptor.computeMembersForGroups(site.getGroups());
    String siteId = site.getMetadata().getID();
    sitePushGroupDefinitions(siteId, pusher, groupDefs);
  }      
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:32,代码来源:SharePointAdaptor.java


示例14: HtmlResponseWriter

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
public HtmlResponseWriter(OutputStream os, Charset charset,
    DocIdEncoder docIdEncoder, Locale locale, long thresholdBytes,
    DocIdPusher pusher, Executor executor) {
  if (os == null) {
    throw new NullPointerException();
  }
  if (charset == null) {
    throw new NullPointerException();
  }
  if (docIdEncoder == null) {
    throw new NullPointerException();
  }
  if (locale == null) {
    throw new NullPointerException();
  }
  if (pusher == null) {
    throw new NullPointerException();
  }
  if (executor == null) {
    throw new NullPointerException();
  }
  countingOutputStream = new CountingOutputStream(os);
  this.writer = new OutputStreamWriter(countingOutputStream, charset);
  this.docIdEncoder = docIdEncoder;
  this.locale = locale;
  this.thresholdBytes = thresholdBytes;
  this.pusher = pusher;
  this.executor = executor;
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:30,代码来源:HtmlResponseWriter.java


示例15: getModifiedDocIds

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
@Override
public void getModifiedDocIds(DocIdPusher pusher)
    throws InterruptedException, IOException {
  userProfileChangeToken = userProfileServiceClient.getModifiedDocIds(pusher,
      userProfileChangeToken);
  log.log(Level.FINE, "getModifiedDocIds returned change token: {0}",
      userProfileChangeToken);
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:9,代码来源:SharePointUserProfileAdaptor.java


示例16: pushRecord

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
@Override
public boolean pushRecord(DocIdPusher.Record record) {
  try {
    pusher.pushRecords(Collections.singletonList(record));
    return true;
  } catch (InterruptedException e) {
    log.log(Level.WARNING, "Interrupted during pushRecord", e);
    Thread.currentThread().interrupt();
    return false;
  }
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:12,代码来源:AccumulatingAsyncDocIdPusher.java


示例17: MockAdaptorContext

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
public MockAdaptorContext(Config config, DocIdPusher pusher) {
  if (config == null) {
    throw new NullPointerException();
  }
  this.config = config;
  this.pusher = pusher;
  this.asynPusher = new AccumulatingAsyncDocIdPusher(pusher);
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:9,代码来源:MockAdaptorContext.java


示例18: getDocIdPusher

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
@Override
public DocIdPusher getDocIdPusher() {
  if (pusher == null) {
    throw new UnsupportedOperationException();
  } else {
    return pusher;
  }
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:9,代码来源:MockAdaptorContext.java


示例19: run

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
public void run(DocIdPusher pusher, Collection<DfException> savedExceptions)
    throws IOException, InterruptedException {
  boolean isComplete;
  do {
    logger.log(Level.FINE, "{0} running from checkpoint {1}",
        new Object[] {getClass().getSimpleName(), checkpoint});
    Checkpoint previousCheckpoint = checkpoint;
    DfException caughtException = null;
    createCollection();
    IDfSession dmSession = getDfSession();
    try {
      Principals principals = new Principals(dmSession, localNamespace,
          globalNamespace, windowsDomain);
      isComplete = fillCollection(dmSession, principals, checkpoint);
    } catch (DfException e) {
      logger.log(Level.FINER, "Caught exception: " + e);
      isComplete = false;
      caughtException = e;
    } finally {
      dmSessionManager.release(dmSession);
    }
    checkpoint = pushCollection(pusher);

    if (caughtException != null) {
      if (!Objects.equals(checkpoint, previousCheckpoint)) {
        logger.log(Level.WARNING, "Error in traversal", caughtException);
        logger.log(Level.FINEST, "Waiting for {0}", sleeper);
        sleeper.sleep();
      } else {
        logger.log(Level.FINE, "Error with no progress at checkpoint {0}",
            checkpoint);
        savedExceptions.add(caughtException);
        break;
      }
    }
  } while (!isComplete);
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:38,代码来源:DocumentumAdaptor.java


示例20: getModifiedDocIds

import com.google.enterprise.adaptor.DocIdPusher; //导入依赖的package包/类
@Override
public void getModifiedDocIds(DocIdPusher pusher) throws IOException,
    InterruptedException {
  logger.entering("DocumentumAdaptor", "getModifiedDocIds");

  ArrayDeque<DfException> savedExceptions = new ArrayDeque<>();

  // Push modified documents.
  modifiedDocumentTraverser.run(pusher, savedExceptions);

  if (!markAllDocsAsPublic) {
    // Push modified ACLs, groups and document permissions.
    modifiedAclTraverser.run(pusher, savedExceptions);
    modifiedGroupTraverser.run(pusher, savedExceptions);
    modifiedPermissionsTraverser.run(pusher, savedExceptions);
  }

  if (!savedExceptions.isEmpty()) {
    DfException cause = savedExceptions.removeFirst();
    for (DfException e : savedExceptions) {
      cause.addSuppressed(e);
    }
    throw new IOException(cause);
  }

  logger.exiting("DocumentumAdaptor", "getModifiedDocIds");
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:28,代码来源:DocumentumAdaptor.java



注:本文中的com.google.enterprise.adaptor.DocIdPusher类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SqlTypeFactoryImpl类代码示例发布时间:2022-05-23
下一篇:
Java SharedAccessBlobPermissions类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap