blob: 4c139b752181c3972b0c8612ef168521adb37b58 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>Adaptor</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Adaptor";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/google/enterprise/adaptor/Acl.InheritanceType.html" title="enum in com.google.enterprise.adaptor"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../com/google/enterprise/adaptor/AdaptorContext.html" title="interface in com.google.enterprise.adaptor"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/google/enterprise/adaptor/Adaptor.html" target="_top">FRAMES</a></li>
<li><a href="Adaptor.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY:&nbsp;</li>
<li>NESTED&nbsp;|&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li>CONSTR&nbsp;|&nbsp;</li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL:&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li>CONSTR&nbsp;|&nbsp;</li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<p class="subTitle">com.google.enterprise.adaptor</p>
<h2 title="Interface Adaptor" class="title">Interface Adaptor</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../com/google/enterprise/adaptor/AbstractAdaptor.html" title="class in com.google.enterprise.adaptor">AbstractAdaptor</a>, <a href="../../../../com/google/enterprise/adaptor/examples/AdaptorTemplate.html" title="class in com.google.enterprise.adaptor.examples">AdaptorTemplate</a>, <a href="../../../../com/google/enterprise/adaptor/examples/AdaptorWithCrawlTimeMetadataTemplate.html" title="class in com.google.enterprise.adaptor.examples">AdaptorWithCrawlTimeMetadataTemplate</a>, <a href="../../../../com/google/enterprise/adaptor/prebuilt/CommandLineAdaptor.html" title="class in com.google.enterprise.adaptor.prebuilt">CommandLineAdaptor</a>, <a href="../../../../com/google/enterprise/adaptor/examples/DbAdaptorTemplate.html" title="class in com.google.enterprise.adaptor.examples">DbAdaptorTemplate</a>, <a href="../../../../com/google/enterprise/adaptor/examples/FileSystemAdaptor.html" title="class in com.google.enterprise.adaptor.examples">FileSystemAdaptor</a>, <a href="../../../../com/google/enterprise/adaptor/prebuilt/FileSystemAdaptor.html" title="class in com.google.enterprise.adaptor.prebuilt">FileSystemAdaptor</a>, <a href="../../../../com/google/enterprise/adaptor/examples/GroupDefinitionsFromCsv.html" title="class in com.google.enterprise.adaptor.examples">GroupDefinitionsFromCsv</a>, <a href="../../../../com/google/enterprise/adaptor/examples/GroupDefinitionsWriter.html" title="class in com.google.enterprise.adaptor.examples">GroupDefinitionsWriter</a></dd>
</dl>
<hr>
<br>
<pre>public interface <strong>Adaptor</strong></pre>
<div class="block">Interface for user-specific implementation details of an Adaptor.
Implementations must be thread-safe. Implementations are encouraged to not
keep any state or only soft-state like a connection cache.
<p>Once configuration is prepared, <a href="../../../../com/google/enterprise/adaptor/Adaptor.html#init(com.google.enterprise.adaptor.AdaptorContext)"><code>init(com.google.enterprise.adaptor.AdaptorContext)</code></a> will be called. This is
guaranteed to occur before any calls to <a href="../../../../com/google/enterprise/adaptor/Adaptor.html#getDocContent(com.google.enterprise.adaptor.Request, com.google.enterprise.adaptor.Response)"><code>getDocContent(com.google.enterprise.adaptor.Request, com.google.enterprise.adaptor.Response)</code></a> or <a href="../../../../com/google/enterprise/adaptor/Adaptor.html#getDocIds(com.google.enterprise.adaptor.DocIdPusher)"><code>getDocIds(com.google.enterprise.adaptor.DocIdPusher)</code></a>. When the adaptor needs to shutdown, <a href="../../../../com/google/enterprise/adaptor/Adaptor.html#destroy()"><code>destroy()</code></a> will be
called.
<p>If the adaptor is using <a href="../../../../com/google/enterprise/adaptor/AbstractAdaptor.html#main(com.google.enterprise.adaptor.Adaptor, java.lang.String[])"><code>AbstractAdaptor.main(com.google.enterprise.adaptor.Adaptor, java.lang.String[])</code></a>, then <a href="../../../../com/google/enterprise/adaptor/Adaptor.html#initConfig(com.google.enterprise.adaptor.Config)"><code>initConfig(com.google.enterprise.adaptor.Config)</code></a> will be called before <a href="../../../../com/google/enterprise/adaptor/Adaptor.html#init(com.google.enterprise.adaptor.AdaptorContext)"><code>init(com.google.enterprise.adaptor.AdaptorContext)</code></a> to allow the adaptor an
opportunity to set and override default configuration values.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../com/google/enterprise/adaptor/examples/AdaptorTemplate.html" title="class in com.google.enterprise.adaptor.examples"><code>AdaptorTemplate</code></a>,
<a href="../../../../com/google/enterprise/adaptor/AbstractAdaptor.html" title="class in com.google.enterprise.adaptor"><code>AbstractAdaptor</code></a>,
<a href="../../../../com/google/enterprise/adaptor/PollingIncrementalLister.html" title="interface in com.google.enterprise.adaptor"><code>PollingIncrementalLister</code></a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/google/enterprise/adaptor/Adaptor.html#destroy()">destroy</a></strong>()</code>
<div class="block">Shutdown and release resources of adaptor.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/google/enterprise/adaptor/Adaptor.html#getDocContent(com.google.enterprise.adaptor.Request, com.google.enterprise.adaptor.Response)">getDocContent</a></strong>(<a href="../../../../com/google/enterprise/adaptor/Request.html" title="interface in com.google.enterprise.adaptor">Request</a>&nbsp;request,
<a href="../../../../com/google/enterprise/adaptor/Response.html" title="interface in com.google.enterprise.adaptor">Response</a>&nbsp;response)</code>
<div class="block">Provides contents and metadata of particular document.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/google/enterprise/adaptor/Adaptor.html#getDocIds(com.google.enterprise.adaptor.DocIdPusher)">getDocIds</a></strong>(<a href="../../../../com/google/enterprise/adaptor/DocIdPusher.html" title="interface in com.google.enterprise.adaptor">DocIdPusher</a>&nbsp;pusher)</code>
<div class="block">Pushes all the <code>DocId</code>s that are suppose to be indexed by the GSA.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/google/enterprise/adaptor/Adaptor.html#init(com.google.enterprise.adaptor.AdaptorContext)">init</a></strong>(<a href="../../../../com/google/enterprise/adaptor/AdaptorContext.html" title="interface in com.google.enterprise.adaptor">AdaptorContext</a>&nbsp;context)</code>
<div class="block">Initialize adaptor with the current context.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/google/enterprise/adaptor/Adaptor.html#initConfig(com.google.enterprise.adaptor.Config)">initConfig</a></strong>(<a href="../../../../com/google/enterprise/adaptor/Config.html" title="class in com.google.enterprise.adaptor">Config</a>&nbsp;config)</code>
<div class="block">Provides the opportunity for the Adaptor to create new configuration values
or override default values.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getDocContent(com.google.enterprise.adaptor.Request, com.google.enterprise.adaptor.Response)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDocContent</h4>
<pre>void&nbsp;getDocContent(<a href="../../../../com/google/enterprise/adaptor/Request.html" title="interface in com.google.enterprise.adaptor">Request</a>&nbsp;request,
<a href="../../../../com/google/enterprise/adaptor/Response.html" title="interface in com.google.enterprise.adaptor">Response</a>&nbsp;response)
throws <a href="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="http://download.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></pre>
<div class="block">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.
<p>If you experience a fatal error, feel free to throw an <a href="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io"><code>IOException</code></a> or <a href="http://download.oracle.com/javase/6/docs/api/java/lang/RuntimeException.html?is-external=true" title="class or interface in java.lang"><code>RuntimeException</code></a>. In the case of an error, the GSA
will determine if and when to retry.</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code></dd></dl>
</li>
</ul>
<a name="getDocIds(com.google.enterprise.adaptor.DocIdPusher)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDocIds</h4>
<pre>void&nbsp;getDocIds(<a href="../../../../com/google/enterprise/adaptor/DocIdPusher.html" title="interface in com.google.enterprise.adaptor">DocIdPusher</a>&nbsp;pusher)
throws <a href="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="http://download.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></pre>
<div class="block">Pushes all the <code>DocId</code>s that are suppose to be indexed by the GSA.
This will frequently involve re-sending <code>DocId</code>s to the GSA, but this
allows healing previous errors and cache inconsistencies. Re-sending <code>DocIds</code> is very fast and should be considered free on the GSA. This method
should determine a list of <code>DocId</code>s to push and call <a href="../../../../com/google/enterprise/adaptor/DocIdPusher.html#pushDocIds(java.lang.Iterable)"><code>DocIdPusher.pushDocIds(java.lang.Iterable<com.google.enterprise.adaptor.DocId>)</code></a> one or more times and <a href="../../../../com/google/enterprise/adaptor/DocIdPusher.html#pushNamedResources(java.util.Map)"><code>DocIdPusher.pushNamedResources(java.util.Map<com.google.enterprise.adaptor.DocId, com.google.enterprise.adaptor.Acl>)</code></a> if using named resources.
<p><code>pusher</code> is provided as convenience and is the same object
provided to <a href="../../../../com/google/enterprise/adaptor/Adaptor.html#init(com.google.enterprise.adaptor.AdaptorContext)"><code>init(com.google.enterprise.adaptor.AdaptorContext)</code></a> previously. This method may take a while and
implementations are free to call <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Thread.html?is-external=true#sleep(long)" title="class or interface in java.lang"><code>Thread.sleep(long)</code></a> occasionally to
reduce load.
<p>If you experience a fatal error, feel free to throw an <a href="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io"><code>IOException</code></a> or <a href="http://download.oracle.com/javase/6/docs/api/java/lang/RuntimeException.html?is-external=true" title="class or interface in java.lang"><code>RuntimeException</code></a>. In the case of an error, the
<a href="../../../../com/google/enterprise/adaptor/ExceptionHandler.html" title="interface in com.google.enterprise.adaptor"><code>ExceptionHandler</code></a> in use in <a href="../../../../com/google/enterprise/adaptor/AdaptorContext.html" title="interface in com.google.enterprise.adaptor"><code>AdaptorContext</code></a> will
determine if and when to retry.</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code></dd></dl>
</li>
</ul>
<a name="initConfig(com.google.enterprise.adaptor.Config)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initConfig</h4>
<pre>void&nbsp;initConfig(<a href="../../../../com/google/enterprise/adaptor/Config.html" title="class in com.google.enterprise.adaptor">Config</a>&nbsp;config)</pre>
<div class="block">Provides the opportunity for the Adaptor to create new configuration values
or override default values. Only <a href="../../../../com/google/enterprise/adaptor/Config.html#addKey(java.lang.String, java.lang.String)"><code>Config.addKey(java.lang.String, java.lang.String)</code></a> should likely be
called. The user's configuration will override any values set in this way.
This method is called by <a href="../../../../com/google/enterprise/adaptor/AbstractAdaptor.html#main(com.google.enterprise.adaptor.Adaptor, java.lang.String[])"><code>AbstractAdaptor.main(com.google.enterprise.adaptor.Adaptor, java.lang.String[])</code></a> before <a href="../../../../com/google/enterprise/adaptor/Adaptor.html#init(com.google.enterprise.adaptor.AdaptorContext)"><code>init(com.google.enterprise.adaptor.AdaptorContext)</code></a>
is called.</div>
</li>
</ul>
<a name="init(com.google.enterprise.adaptor.AdaptorContext)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>init</h4>
<pre>void&nbsp;init(<a href="../../../../com/google/enterprise/adaptor/AdaptorContext.html" title="interface in com.google.enterprise.adaptor">AdaptorContext</a>&nbsp;context)
throws <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
<div class="block">Initialize adaptor with the current context. This is the ideal time to
start any threads to do extra behind-the-scenes work. The <code>context</code>
points to other useful objects that can be used at any time. For example,
methods on <a href="../../../../com/google/enterprise/adaptor/DocIdPusher.html" title="interface in com.google.enterprise.adaptor"><code>DocIdPusher</code></a> provided via <a href="../../../../com/google/enterprise/adaptor/AdaptorContext.html#getDocIdPusher()"><code>AdaptorContext.getDocIdPusher()</code></a> are allowed to be called whenever the
Adaptor wishes. This allows doing event-based incremental pushes at any
time.
<p>The method is called at the end of <a href="../../../../com/google/enterprise/adaptor/GsaCommunicationHandler.html#start()"><code>GsaCommunicationHandler.start()</code></a>.
<p>If you experience a fatal error during initialization, feel free to
throw an <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang"><code>Exception</code></a> to cancel the startup process.</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code></dd></dl>
</li>
</ul>
<a name="destroy()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>destroy</h4>
<pre>void&nbsp;destroy()</pre>
<div class="block">Shutdown and release resources of adaptor.</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/google/enterprise/adaptor/Acl.InheritanceType.html" title="enum in com.google.enterprise.adaptor"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../com/google/enterprise/adaptor/AdaptorContext.html" title="interface in com.google.enterprise.adaptor"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/google/enterprise/adaptor/Adaptor.html" target="_top">FRAMES</a></li>
<li><a href="Adaptor.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY:&nbsp;</li>
<li>NESTED&nbsp;|&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li>CONSTR&nbsp;|&nbsp;</li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL:&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li>CONSTR&nbsp;|&nbsp;</li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>