com.google.enterprise.adaptor.examples
Class GroupDefinitionsWriter

java.lang.Object
  extended by com.google.enterprise.adaptor.AbstractAdaptor
      extended by com.google.enterprise.adaptor.examples.GroupDefinitionsWriter
All Implemented Interfaces:
Adaptor

public class GroupDefinitionsWriter
extends AbstractAdaptor

Demonstrates sending group definitions to GSA.


Constructor Summary
GroupDefinitionsWriter()
           
 
Method Summary
 void getDocContent(Request req, Response res)
          Provides contents and metadata of particular document.
 void getDocIds(DocIdPusher pusher)
          Pushes all the DocIds that are suppose to be indexed by the GSA.
static void main(String[] args)
           
 
Methods inherited from class com.google.enterprise.adaptor.AbstractAdaptor
destroy, init, initConfig, main
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupDefinitionsWriter

public GroupDefinitionsWriter()
Method Detail

getDocIds

public void getDocIds(DocIdPusher pusher)
               throws InterruptedException
Description copied from interface: Adaptor
Pushes all the DocIds that are suppose to be indexed by the GSA. This will frequently involve re-sending DocIds to the GSA, but this allows healing previous errors and cache inconsistencies. Re-sending DocIds is very fast and should be considered free on the GSA. This method should determine a list of DocIds to push and call DocIdPusher.pushDocIds(java.lang.Iterable) one or more times and DocIdPusher.pushNamedResources(java.util.Map) if using named resources.

pusher is provided as convenience and is the same object provided to Adaptor.init(com.google.enterprise.adaptor.AdaptorContext) previously. This method may take a while and implementations are free to call Thread.sleep(long) occasionally to reduce load.

If you experience a fatal error, feel free to throw an IOException or RuntimeException. In the case of an error, the ExceptionHandler in use in AdaptorContext will determine if and when to retry.

Throws:
InterruptedException

getDocContent

public void getDocContent(Request req,
                          Response res)
                   throws IOException
Description copied from interface: Adaptor
Provides contents and metadata of particular document. This method should be highly parallelizable and support twenty or more concurrent calls. Two to three concurrent calls may be average during initial GSA crawling, but twenty or more concurrent calls is typical when the GSA is recrawling unmodified content.

If you experience a fatal error, feel free to throw an IOException or RuntimeException. In the case of an error, the GSA will determine if and when to retry.

Throws:
IOException

main

public static void main(String[] args)