public abstract class AbstractAdaptor extends Object implements Adaptor
Adaptor
methods. Extending classes only need to implement Adaptor.getDocIds(com.google.enterprise.adaptor.DocIdPusher)
and Adaptor.getDocContent(com.google.enterprise.adaptor.Request, com.google.enterprise.adaptor.Response)
.Constructor and Description |
---|
AbstractAdaptor() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Shutdown and release resources of adaptor.
|
void |
init(AdaptorContext context)
Initialize adaptor with the current context.
|
void |
initConfig(Config config)
Provides the opportunity for the Adaptor to create new configuration values
or override default values.
|
static Application |
main(Adaptor adaptor,
String[] args)
Standard main for all adaptors (including those not extending
AbstractAdaptor).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDocContent, getDocIds
public void initConfig(Config config)
Config.addKey(java.lang.String, java.lang.String)
should likely be
called. The user's configuration will override any values set in this way.
This method is called by main(com.google.enterprise.adaptor.Adaptor, java.lang.String[])
before Adaptor.init(com.google.enterprise.adaptor.AdaptorContext)
is called.
This implementation does nothing.
initConfig
in interface Adaptor
config
- to modify with additional keyspublic void init(AdaptorContext context) throws Exception
context
points to other useful objects that can be used at any time. For example,
methods on DocIdPusher
provided via AdaptorContext.getDocIdPusher()
are allowed to be called whenever the
Adaptor wishes. This allows doing event-based incremental pushes at any
time.
The method is called at the end of GsaCommunicationHandler.start(java.lang.Runnable)
.
If you experience a fatal error during initialization, feel free to
throw an Exception
to cancel the startup process.
This implementation does nothing.
public void destroy()
This implementation does nothing.
public static Application main(Adaptor adaptor, String[] args)
This method starts the HTTP server for serving doc contents, schedules
sending DocId
s on a schedule, and optionally sends DocId
s
on startup.
adaptor
- to be initializedargs
- command line params passed to config