public class HttpPoster extends Object
Modifier and Type | Class and Description |
---|---|
protected class |
HttpPoster.CommitThread
Killable thread that does a commit.
|
protected class |
HttpPoster.DeleteThread
Killable thread that does deletions.
|
protected class |
HttpPoster.IngestThread
Killable thread that does ingestions.
|
protected static class |
HttpPoster.RepositoryDocumentStream
Class for importing documents into Solr via SolrJ
|
protected static class |
HttpPoster.SolrPing
Special version of ping class where we can control the URL
|
protected class |
HttpPoster.StatusThread
Killable thread that does a status check.
|
Modifier and Type | Field and Description |
---|---|
static String |
_rcsid |
protected org.apache.http.impl.conn.PoolingHttpClientConnectionManager |
connectionManager |
static String |
ingestBufferSizeProperty
Ingestion buffer size property.
|
static String |
ingestCredentialsRealm |
static String |
ingestMaxConnectionsProperty |
static String |
ingestPasswordProperty |
static String |
ingestRescheduleInterval |
static String |
ingestResponseRetryCount |
static String |
ingestResponseRetryInterval |
static String |
ingestURIProperty |
static String |
ingestUserProperty |
protected org.apache.solr.client.solrj.SolrClient |
solrServer |
Constructor and Description |
---|
HttpPoster(String zookeeperHosts,
String collection,
int zkClientTimeout,
int zkConnectTimeout,
String updatePath,
String removePath,
String statusPath,
String allowAttributeName,
String denyAttributeName,
String idAttributeName,
String originalSizeAttributeName,
String modifiedDateAttributeName,
String createdDateAttributeName,
String indexedDateAttributeName,
String fileNameAttributeName,
String mimeTypeAttributeName,
String contentAttributeName,
Long maxDocumentLength,
String commitWithin,
boolean useExtractUpdateHandler,
boolean useUrlEncoding)
Initialize the SolrCloud http poster.
|
HttpPoster(String protocol,
String server,
int port,
String webapp,
String core,
int connectionTimeout,
int socketTimeout,
String updatePath,
String removePath,
String statusPath,
String realm,
String userID,
String password,
String allowAttributeName,
String denyAttributeName,
String idAttributeName,
String originalSizeAttributeName,
String modifiedDateAttributeName,
String createdDateAttributeName,
String indexedDateAttributeName,
String fileNameAttributeName,
String mimeTypeAttributeName,
String contentAttributeName,
IKeystoreManager keystoreManager,
Long maxDocumentLength,
String commitWithin,
boolean useExtractUpdateHandler,
boolean useUrlEncoding)
Initialize the standard http poster.
|
Modifier and Type | Method and Description |
---|---|
void |
checkPost()
Post a check request.
|
void |
commitPost()
Cause a commit to happen.
|
protected String |
conditionallyEncode(String fieldName)
Conditionally encode
|
protected static String[] |
convertACL(String[] acl,
String authorityNameString,
IOutputAddActivity activities)
Convert an unqualified ACL to qualified form.
|
void |
deletePost(String documentURI,
IOutputRemoveActivity activities)
Post a delete request.
|
protected static void |
handleIOException(IOException e,
String context)
Handle an IOException.
|
protected static void |
handleRuntimeException(RuntimeException e,
String context)
Handle a RuntimeException.
|
protected static void |
handleSolrException(org.apache.solr.common.SolrException e,
String context)
Handle a SolrException.
|
protected static void |
handleSolrServerException(org.apache.solr.client.solrj.SolrServerException e,
String context)
Handle a SolrServerException.
|
boolean |
indexPost(String documentURI,
RepositoryDocument document,
Map<String,List<String>> arguments,
Map<String,List<String>> sourceTargets,
boolean keepAllMetadata,
String authorityNameString,
IOutputAddActivity activities)
Post the input stream to ingest
|
protected String |
makeSafeLuceneField(String inputField)
See CONNECTORS-956.
|
void |
shutdown()
Shut down the poster.
|
protected void |
writeACLs(org.apache.solr.common.params.ModifiableSolrParams out,
String aclType,
String[] acl,
String[] denyAcl)
Output an acl level
|
protected void |
writeACLsInSolrDoc(org.apache.solr.common.SolrInputDocument inputDoc,
String aclType,
String[] acl,
String[] denyAcl)
Output an acl level in a SolrInputDocument
|
protected void |
writeField(org.apache.solr.common.params.ModifiableSolrParams out,
String fieldName,
List<String> fieldValues)
Write a field
|
protected void |
writeField(org.apache.solr.common.params.ModifiableSolrParams out,
String fieldName,
String fieldValue)
Write a field
|
protected void |
writeField(org.apache.solr.common.params.ModifiableSolrParams out,
String fieldName,
String[] fieldValues)
Write a field
|
public static final String _rcsid
public static String ingestBufferSizeProperty
public static String ingestCredentialsRealm
public static String ingestResponseRetryCount
public static String ingestResponseRetryInterval
public static String ingestRescheduleInterval
public static String ingestURIProperty
public static String ingestUserProperty
public static String ingestPasswordProperty
public static String ingestMaxConnectionsProperty
protected org.apache.http.impl.conn.PoolingHttpClientConnectionManager connectionManager
protected org.apache.solr.client.solrj.SolrClient solrServer
public HttpPoster(String zookeeperHosts, String collection, int zkClientTimeout, int zkConnectTimeout, String updatePath, String removePath, String statusPath, String allowAttributeName, String denyAttributeName, String idAttributeName, String originalSizeAttributeName, String modifiedDateAttributeName, String createdDateAttributeName, String indexedDateAttributeName, String fileNameAttributeName, String mimeTypeAttributeName, String contentAttributeName, Long maxDocumentLength, String commitWithin, boolean useExtractUpdateHandler, boolean useUrlEncoding) throws ManifoldCFException
ManifoldCFException
public HttpPoster(String protocol, String server, int port, String webapp, String core, int connectionTimeout, int socketTimeout, String updatePath, String removePath, String statusPath, String realm, String userID, String password, String allowAttributeName, String denyAttributeName, String idAttributeName, String originalSizeAttributeName, String modifiedDateAttributeName, String createdDateAttributeName, String indexedDateAttributeName, String fileNameAttributeName, String mimeTypeAttributeName, String contentAttributeName, IKeystoreManager keystoreManager, Long maxDocumentLength, String commitWithin, boolean useExtractUpdateHandler, boolean useUrlEncoding) throws ManifoldCFException
ManifoldCFException
public void shutdown()
public void commitPost() throws ManifoldCFException, ServiceInterruption
protected static void handleRuntimeException(RuntimeException e, String context) throws ManifoldCFException, ServiceInterruption
protected static void handleSolrServerException(org.apache.solr.client.solrj.SolrServerException e, String context) throws ManifoldCFException, ServiceInterruption
protected static void handleSolrException(org.apache.solr.common.SolrException e, String context) throws ManifoldCFException, ServiceInterruption
protected static void handleIOException(IOException e, String context) throws ManifoldCFException, ServiceInterruption
public boolean indexPost(String documentURI, RepositoryDocument document, Map<String,List<String>> arguments, Map<String,List<String>> sourceTargets, boolean keepAllMetadata, String authorityNameString, IOutputAddActivity activities) throws ManifoldCFException, ServiceInterruption
documentURI
- is the document's uri.document
- is the document structure to ingest.arguments
- are the configuration arguments to pass in the post. Key is argument name, value is a list of the argument values.keepAllMetadata
- authorityNameString
- is the name of the governing authority for this document's acls, or null if none.activities
- is the activities object, so we can report what's happening. @return true if the ingestion was successful, or false if the ingestion is illegal.ManifoldCFException,
- ServiceInterruptionManifoldCFException
ServiceInterruption
public void checkPost() throws ManifoldCFException, ServiceInterruption
public void deletePost(String documentURI, IOutputRemoveActivity activities) throws ManifoldCFException, ServiceInterruption
documentURI
- is the document's URI.ManifoldCFException
ServiceInterruption
protected static String[] convertACL(String[] acl, String authorityNameString, IOutputAddActivity activities) throws ManifoldCFException
acl
- is the initial, unqualified ACL.authorityNameString
- is the name of the governing authority for this document's acls, or null if none.activities
- is the activities object, so we can report what's happening.ManifoldCFException
protected void writeField(org.apache.solr.common.params.ModifiableSolrParams out, String fieldName, String[] fieldValues)
protected void writeField(org.apache.solr.common.params.ModifiableSolrParams out, String fieldName, List<String> fieldValues)
protected void writeField(org.apache.solr.common.params.ModifiableSolrParams out, String fieldName, String fieldValue)
protected void writeACLs(org.apache.solr.common.params.ModifiableSolrParams out, String aclType, String[] acl, String[] denyAcl)
protected void writeACLsInSolrDoc(org.apache.solr.common.SolrInputDocument inputDoc, String aclType, String[] acl, String[] denyAcl)