|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.apache.manifoldcf.agents.output.solr.HttpPoster
public class HttpPoster
Posts an input stream to SOLR
| Nested Class Summary | |
|---|---|
protected static class |
HttpPoster.ByteBuffer
Byte buffer class |
protected static class |
HttpPoster.CodeDetails
Code+details paper object |
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.LaxTrustManager
Our own trust manager, which ignores certificate issues |
protected class |
HttpPoster.StatusThread
Killable thread that does a status check. |
| Field Summary | |
|---|---|
static java.lang.String |
_rcsid
|
protected static byte[] |
endBytes
|
protected static int |
HEADER_CHUNK
|
static java.lang.String |
ingestBufferSizeProperty
Ingestion buffer size property. |
static java.lang.String |
ingestCredentialsRealm
|
static java.lang.String |
ingestMaxConnectionsProperty
|
static java.lang.String |
ingestPasswordProperty
|
static java.lang.String |
ingestRescheduleInterval
|
static java.lang.String |
ingestResponseRetryCount
|
static java.lang.String |
ingestResponseRetryInterval
|
static java.lang.String |
ingestURIProperty
|
static java.lang.String |
ingestUserProperty
|
protected static javax.net.ssl.SSLSocketFactory |
openSecureSocketFactory
This is the secure socket factory we will use. |
protected static byte[] |
postambleBytes
|
protected static byte[] |
preambleBytes
|
protected static byte[] |
separatorBytes
The multipart separator we're going to use. |
| Constructor Summary | |
|---|---|
HttpPoster(java.lang.String protocol,
java.lang.String server,
int port,
java.lang.String webappName,
java.lang.String updatePath,
java.lang.String removePath,
java.lang.String statusPath,
java.lang.String realm,
java.lang.String userID,
java.lang.String password,
java.lang.String allowAttributeName,
java.lang.String denyAttributeName,
java.lang.String idAttributeName,
org.apache.manifoldcf.core.interfaces.IKeystoreManager keystoreManager)
Initialized the http poster. |
|
| Method Summary | |
|---|---|
void |
checkPost()
Post a check request. |
void |
commitPost()
Cause a commit to happen. |
protected static java.lang.String[] |
convertACL(java.lang.String[] acl,
java.lang.String authorityNameString,
org.apache.manifoldcf.agents.interfaces.IOutputAddActivity activities)
Convert an unqualified ACL to qualified form. |
protected java.net.Socket |
createSocket(long responseRetryCount)
Create a socket in a manner consistent with all of our specified parameters. |
void |
deletePost(java.lang.String documentURI,
org.apache.manifoldcf.agents.interfaces.IOutputRemoveActivity activities)
Post a delete request. |
protected static javax.net.ssl.SSLSocketFactory |
getOpenSecureSocketFactory()
Build a secure socket factory based on no keystore and a lax trust manager. |
protected HttpPoster.CodeDetails |
getResponse(java.io.InputStream in)
Get the response code of the post |
boolean |
indexPost(java.lang.String documentURI,
org.apache.manifoldcf.agents.interfaces.RepositoryDocument document,
java.util.Map arguments,
java.util.Map sourceTargets,
java.lang.String authorityNameString,
org.apache.manifoldcf.agents.interfaces.IOutputAddActivity activities)
Post the input stream to ingest |
protected int |
lengthACLs(java.lang.String aclType,
java.lang.String[] acl,
java.lang.String[] denyAcl)
Count the size of an acl level |
protected static int |
lengthBoundary(java.lang.String contentType,
java.lang.String name,
java.lang.String fileName)
Calculate the length of a boundary |
protected static int |
lengthField(java.lang.String fieldName,
java.lang.String fieldValue)
Calculate the length of a field |
protected static int |
lengthPostamble()
Calculate the length of the postamble |
protected static int |
lengthPreamble()
Calculate the length of the preamble |
protected static byte[] |
readInputStream(java.io.InputStream is)
Read input stream into an in-memory array |
protected static java.lang.String |
readLine(java.io.InputStream in)
Read an ascii line from an input stream |
protected void |
writeACLs(java.io.OutputStream out,
java.lang.String aclType,
java.lang.String[] acl,
java.lang.String[] denyAcl)
Output an acl level |
protected static void |
writeBoundary(java.io.OutputStream out,
java.lang.String contentType,
java.lang.String name,
java.lang.String fileName)
Write a boundary |
protected void |
writeCredentials(java.io.OutputStream out)
Write credentials to output |
protected static void |
writeField(java.io.OutputStream out,
java.lang.String fieldName,
java.lang.String fieldValue)
Write a field |
protected static void |
writePostamble(java.io.OutputStream out)
Write the postamble |
protected static void |
writePreamble(java.io.OutputStream out)
Write the preamble |
protected static java.lang.String |
xmlEncode(java.lang.String input)
XML encoding |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String _rcsid
public static java.lang.String ingestBufferSizeProperty
public static java.lang.String ingestCredentialsRealm
public static java.lang.String ingestResponseRetryCount
public static java.lang.String ingestResponseRetryInterval
public static java.lang.String ingestRescheduleInterval
public static java.lang.String ingestURIProperty
public static java.lang.String ingestUserProperty
public static java.lang.String ingestPasswordProperty
public static java.lang.String ingestMaxConnectionsProperty
protected static final int HEADER_CHUNK
protected static byte[] separatorBytes
protected static byte[] endBytes
protected static byte[] postambleBytes
protected static byte[] preambleBytes
protected static javax.net.ssl.SSLSocketFactory openSecureSocketFactory
| Constructor Detail |
|---|
public HttpPoster(java.lang.String protocol,
java.lang.String server,
int port,
java.lang.String webappName,
java.lang.String updatePath,
java.lang.String removePath,
java.lang.String statusPath,
java.lang.String realm,
java.lang.String userID,
java.lang.String password,
java.lang.String allowAttributeName,
java.lang.String denyAttributeName,
java.lang.String idAttributeName,
org.apache.manifoldcf.core.interfaces.IKeystoreManager keystoreManager)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
userID - is the unencoded user name, or null.password - is the unencoded password, or null.
org.apache.manifoldcf.core.interfaces.ManifoldCFException| Method Detail |
|---|
public void commitPost()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
org.apache.manifoldcf.core.interfaces.ManifoldCFException
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
public boolean indexPost(java.lang.String documentURI,
org.apache.manifoldcf.agents.interfaces.RepositoryDocument document,
java.util.Map arguments,
java.util.Map sourceTargets,
java.lang.String authorityNameString,
org.apache.manifoldcf.agents.interfaces.IOutputAddActivity activities)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.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.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, - ServiceInterruption
org.apache.manifoldcf.core.interfaces.ManifoldCFException
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
public void checkPost()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
org.apache.manifoldcf.core.interfaces.ManifoldCFException
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
public void deletePost(java.lang.String documentURI,
org.apache.manifoldcf.agents.interfaces.IOutputRemoveActivity activities)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
documentURI - is the document's URI.
org.apache.manifoldcf.core.interfaces.ManifoldCFException
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
protected static java.lang.String[] convertACL(java.lang.String[] acl,
java.lang.String authorityNameString,
org.apache.manifoldcf.agents.interfaces.IOutputAddActivity activities)
throws org.apache.manifoldcf.core.interfaces.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.
org.apache.manifoldcf.core.interfaces.ManifoldCFException
protected static java.lang.String readLine(java.io.InputStream in)
throws java.io.IOException
java.io.IOException
protected HttpPoster.CodeDetails getResponse(java.io.InputStream in)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
in - the stream the response is going to come from
org.apache.manifoldcf.core.interfaces.ManifoldCFException
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
protected static byte[] readInputStream(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
protected void writeCredentials(java.io.OutputStream out)
throws java.io.IOException
java.io.IOException
protected static javax.net.ssl.SSLSocketFactory getOpenSecureSocketFactory()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
org.apache.manifoldcf.core.interfaces.ManifoldCFException
protected java.net.Socket createSocket(long responseRetryCount)
throws java.io.IOException,
org.apache.manifoldcf.core.interfaces.ManifoldCFException
java.io.IOException
org.apache.manifoldcf.core.interfaces.ManifoldCFException
protected static int lengthPreamble()
throws java.io.IOException
java.io.IOException
protected static int lengthBoundary(java.lang.String contentType,
java.lang.String name,
java.lang.String fileName)
throws java.io.IOException
java.io.IOException
protected static int lengthPostamble()
throws java.io.IOException
java.io.IOException
protected static int lengthField(java.lang.String fieldName,
java.lang.String fieldValue)
throws java.io.IOException
java.io.IOException
protected int lengthACLs(java.lang.String aclType,
java.lang.String[] acl,
java.lang.String[] denyAcl)
throws java.io.IOException
java.io.IOException
protected static void writePreamble(java.io.OutputStream out)
throws java.io.IOException
java.io.IOException
protected static void writeBoundary(java.io.OutputStream out,
java.lang.String contentType,
java.lang.String name,
java.lang.String fileName)
throws java.io.IOException
java.io.IOException
protected static void writePostamble(java.io.OutputStream out)
throws java.io.IOException
java.io.IOException
protected static void writeField(java.io.OutputStream out,
java.lang.String fieldName,
java.lang.String fieldValue)
throws java.io.IOException
java.io.IOException
protected void writeACLs(java.io.OutputStream out,
java.lang.String aclType,
java.lang.String[] acl,
java.lang.String[] denyAcl)
throws java.io.IOException
java.io.IOExceptionprotected static java.lang.String xmlEncode(java.lang.String input)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||